Java Code Examples for org.chromium.base.metrics.RecordHistogram#recordCount100Histogram()

The following examples show how to use org.chromium.base.metrics.RecordHistogram#recordCount100Histogram() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: ChildBackgroundTabShowObserver.java    From delion with Apache License 2.0 6 votes vote down vote up
@Override
public void onShown(Tab tab) {
    int rank = mTabCreationOrder.indexOf(tab);
    int reverseRank = mTabCreationOrder.size() - rank - 1;

    // Record which tab the user switches to first by recording the creation order of the tab
    // that the user switches to. Record both the "Creation Rank" and the
    // "Reverse Creation Rank" because we want to know whether most users switch to the
    // newest background tab or oldest background tab first.
    RecordHistogram.recordCount100Histogram("Tabs.FirstSwitchedToForegroundCreationRank", rank);
    RecordHistogram.recordCount100Histogram(
            "Tabs.FirstSwitchedToForegroundCreationReverseRank", reverseRank);

    for (Tab stopObservingTab : mTabCreationOrder) {
        stopObservingTab.removeObserver(this);
    }
    mTabCreationOrder.clear();
}
 
Example 2
Source File: ToolbarProgressBar.java    From delion with Apache License 2.0 6 votes vote down vote up
/**
 * Start hiding progress bar animation.
 * @param delayed Whether a delayed fading out animation should be posted.
 */
public void finish(boolean delayed) {
    mIsStarted = false;

    if (delayed) {
        updateVisibleProgress();
        RecordHistogram.recordCount1000Histogram(PROGRESS_BAR_UPDATE_COUNT_HISTOGRAM,
                getProgressUpdateCount());
        RecordHistogram.recordCount100Histogram(
                PROGRESS_BAR_BREAK_POINT_UPDATE_COUNT_HISTOGRAM,
                mTargetProgressUpdateCount);
    } else {
        removeCallbacks(mHideRunnable);
        animate().cancel();
        if (mAnimatingView != null) {
            removeCallbacks(mStartSmoothIndeterminate);
            mAnimatingView.cancelAnimation();
            mTargetProgress = 0;
        }
        mIsRunningSmoothIndeterminate = false;
        setAlpha(0.0f);
    }
}
 
Example 3
Source File: ChildBackgroundTabShowObserver.java    From AndroidChromium with Apache License 2.0 6 votes vote down vote up
@Override
public void onShown(Tab tab) {
    int rank = mTabCreationOrder.indexOf(tab);
    int reverseRank = mTabCreationOrder.size() - rank - 1;

    // Record which tab the user switches to first by recording the creation order of the tab
    // that the user switches to. Record both the "Creation Rank" and the
    // "Reverse Creation Rank" because we want to know whether most users switch to the
    // newest background tab or oldest background tab first.
    RecordHistogram.recordCount100Histogram("Tabs.FirstSwitchedToForegroundCreationRank", rank);
    RecordHistogram.recordCount100Histogram(
            "Tabs.FirstSwitchedToForegroundCreationReverseRank", reverseRank);

    for (Tab stopObservingTab : mTabCreationOrder) {
        stopObservingTab.removeObserver(this);
    }
    mTabCreationOrder.clear();
}
 
Example 4
Source File: ToolbarProgressBar.java    From AndroidChromium with Apache License 2.0 6 votes vote down vote up
/**
 * Start hiding progress bar animation.
 * @param delayed Whether a delayed fading out animation should be posted.
 */
public void finish(boolean delayed) {
    mIsStarted = false;

    if (delayed) {
        updateVisibleProgress();
        RecordHistogram.recordCount1000Histogram(PROGRESS_BAR_UPDATE_COUNT_HISTOGRAM,
                getProgressUpdateCount());
        RecordHistogram.recordCount100Histogram(
                PROGRESS_BAR_BREAK_POINT_UPDATE_COUNT_HISTOGRAM,
                mTargetProgressUpdateCount);
    } else {
        removeCallbacks(mHideRunnable);
        animate().cancel();
        if (mAnimatingView != null) {
            removeCallbacks(mStartSmoothIndeterminate);
            mAnimatingView.cancelAnimation();
            mTargetProgress = 0;
        }
        mIsRunningSmoothIndeterminate = false;
        setAlpha(0.0f);
    }
}
 
Example 5
Source File: ChildBackgroundTabShowObserver.java    From 365browser with Apache License 2.0 6 votes vote down vote up
@Override
public void onShown(Tab tab) {
    int rank = mTabCreationOrder.indexOf(tab);
    int reverseRank = mTabCreationOrder.size() - rank - 1;

    // Record which tab the user switches to first by recording the creation order of the tab
    // that the user switches to. Record both the "Creation Rank" and the
    // "Reverse Creation Rank" because we want to know whether most users switch to the
    // newest background tab or oldest background tab first.
    RecordHistogram.recordCount100Histogram("Tabs.FirstSwitchedToForegroundCreationRank", rank);
    RecordHistogram.recordCount100Histogram(
            "Tabs.FirstSwitchedToForegroundCreationReverseRank", reverseRank);

    for (Tab stopObservingTab : mTabCreationOrder) {
        stopObservingTab.removeObserver(this);
    }
    mTabCreationOrder.clear();
}
 
Example 6
Source File: TabUma.java    From delion with Apache License 2.0 5 votes vote down vote up
/**
 * Records the number of background tabs which were opened from this tab's
 * current URL. Does not record anything if no background tabs were opened.
 */
private void recordNumBackgroundTabsOpened() {
    if (mNumBackgroundTabsOpened > 0) {
        RecordHistogram.recordCount100Histogram(
                "Tab.BackgroundTabsOpenedViaContextMenuCount", mNumBackgroundTabsOpened);
    }
    mNumBackgroundTabsOpened = 0;
    mChildBackgroundTabShowObserver = null;
}
 
Example 7
Source File: TabUma.java    From AndroidChromium with Apache License 2.0 5 votes vote down vote up
/**
 * Records the number of background tabs which were opened from this tab's
 * current URL. Does not record anything if no background tabs were opened.
 */
private void recordNumBackgroundTabsOpened() {
    if (mNumBackgroundTabsOpened > 0) {
        RecordHistogram.recordCount100Histogram(
                "Tab.BackgroundTabsOpenedViaContextMenuCount", mNumBackgroundTabsOpened);
    }
    mNumBackgroundTabsOpened = 0;
    mChildBackgroundTabShowObserver = null;
}
 
Example 8
Source File: TabUma.java    From 365browser with Apache License 2.0 5 votes vote down vote up
/**
 * Records the number of background tabs which were opened from this tab's
 * current URL. Does not record anything if no background tabs were opened.
 */
private void recordNumBackgroundTabsOpened() {
    if (mNumBackgroundTabsOpened > 0) {
        RecordHistogram.recordCount100Histogram(
                "Tab.BackgroundTabsOpenedViaContextMenuCount", mNumBackgroundTabsOpened);
    }
    mNumBackgroundTabsOpened = 0;
    mChildBackgroundTabShowObserver = null;
}
 
Example 9
Source File: HistoryManager.java    From 365browser with Apache License 2.0 4 votes vote down vote up
/**
 * Records the number of selected items when a multi-select action is performed.
 * @param action The multi-select action that was performed.
 */
private void recordSelectionCountHistorgram(String action) {
    List<HistoryItem> selectedItems = mSelectionDelegate.getSelectedItems();
    RecordHistogram.recordCount100Histogram(
            METRICS_PREFIX + action + "Selected", selectedItems.size());
}