Java Code Examples for org.chromium.chrome.browser.compositor.bottombar.OverlayPanel.StateChangeReason#FLING

The following examples show how to use org.chromium.chrome.browser.compositor.bottombar.OverlayPanel.StateChangeReason#FLING . 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: ReaderModeManager.java    From delion with Apache License 2.0 6 votes vote down vote up
@Override
public void onClosed(StateChangeReason reason) {
    if (mReaderModePanel == null || mTabModelSelector == null) return;

    restoreInfobars();

    // Only dismiss the panel if the close was a result of user interaction.
    if (reason != StateChangeReason.FLING && reason != StateChangeReason.SWIPE
            && reason != StateChangeReason.CLOSE_BUTTON) {
        return;
    }

    // Record close button usage.
    if (reason == StateChangeReason.CLOSE_BUTTON) {
        RecordHistogram.recordBooleanHistogram("DomDistiller.BarCloseButtonUsage",
                mReaderModePanel.getPanelState() == PanelState.EXPANDED
                || mReaderModePanel.getPanelState() == PanelState.MAXIMIZED);
    }

    int currentTabId = mTabModelSelector.getCurrentTabId();
    if (!mTabStatusMap.containsKey(currentTabId)) return;
    mTabStatusMap.get(currentTabId).setIsDismissed(true);
}
 
Example 2
Source File: ReaderModeManager.java    From AndroidChromium with Apache License 2.0 6 votes vote down vote up
@Override
public void onClosed(StateChangeReason reason) {
    if (mReaderModePanel == null || mTabModelSelector == null) return;

    restoreInfobars();

    // Only dismiss the panel if the close was a result of user interaction.
    if (reason != StateChangeReason.FLING && reason != StateChangeReason.SWIPE
            && reason != StateChangeReason.CLOSE_BUTTON) {
        return;
    }

    // Record close button usage.
    if (reason == StateChangeReason.CLOSE_BUTTON) {
        RecordHistogram.recordBooleanHistogram("DomDistiller.BarCloseButtonUsage",
                mReaderModePanel.getPanelState() == PanelState.EXPANDED
                || mReaderModePanel.getPanelState() == PanelState.MAXIMIZED);
    }

    int currentTabId = mTabModelSelector.getCurrentTabId();
    if (!mTabStatusMap.containsKey(currentTabId)) return;
    mTabStatusMap.get(currentTabId).setIsDismissed(true);
}
 
Example 3
Source File: ReaderModeManager.java    From 365browser with Apache License 2.0 6 votes vote down vote up
@Override
public void onClosed(StateChangeReason reason) {
    if (mReaderModePanel == null || mTabModelSelector == null) return;

    restoreInfobars();

    // Only dismiss the panel if the close was a result of user interaction.
    if (reason != StateChangeReason.FLING && reason != StateChangeReason.SWIPE
            && reason != StateChangeReason.CLOSE_BUTTON) {
        return;
    }

    // Record close button usage.
    if (reason == StateChangeReason.CLOSE_BUTTON) {
        RecordHistogram.recordBooleanHistogram("DomDistiller.BarCloseButtonUsage",
                mReaderModePanel.getPanelState() == PanelState.EXPANDED
                || mReaderModePanel.getPanelState() == PanelState.MAXIMIZED);
    }

    int currentTabId = mTabModelSelector.getCurrentTabId();
    if (!mTabStatusMap.containsKey(currentTabId)) return;
    mTabStatusMap.get(currentTabId).setIsDismissed(true);
}
 
Example 4
Source File: ContextualSearchUma.java    From delion with Apache License 2.0 5 votes vote down vote up
/**
 * Logs a user action for a change to the Panel state, which allows sequencing of actions.
 * @param toState The state to transition to.
 * @param reason The reason for the state transition.
 */
public static void logPanelStateUserAction(PanelState toState, StateChangeReason reason) {
    switch (toState) {
        case CLOSED:
            if (reason == StateChangeReason.BACK_PRESS) {
                RecordUserAction.record("ContextualSearch.BackPressClose");
            } else if (reason == StateChangeReason.CLOSE_BUTTON) {
                RecordUserAction.record("ContextualSearch.CloseButtonClose");
            } else if (reason == StateChangeReason.SWIPE || reason == StateChangeReason.FLING) {
                RecordUserAction.record("ContextualSearch.SwipeOrFlingClose");
            } else if (reason == StateChangeReason.TAB_PROMOTION) {
                RecordUserAction.record("ContextualSearch.TabPromotionClose");
            } else if (reason == StateChangeReason.BASE_PAGE_TAP) {
                RecordUserAction.record("ContextualSearch.BasePageTapClose");
            } else if (reason == StateChangeReason.BASE_PAGE_SCROLL) {
                RecordUserAction.record("ContextualSearch.BasePageScrollClose");
            } else if (reason == StateChangeReason.SEARCH_BAR_TAP) {
                RecordUserAction.record("ContextualSearch.SearchBarTapClose");
            } else if (reason == StateChangeReason.SERP_NAVIGATION) {
                RecordUserAction.record("ContextualSearch.NavigationClose");
            } else {
                RecordUserAction.record("ContextualSearch.UncommonClose");
            }
            break;
        case PEEKED:
            if (reason == StateChangeReason.TEXT_SELECT_TAP) {
                RecordUserAction.record("ContextualSearch.TapPeek");
            } else if (reason == StateChangeReason.SWIPE || reason == StateChangeReason.FLING) {
                RecordUserAction.record("ContextualSearch.SwipeOrFlingPeek");
            } else if (reason == StateChangeReason.TEXT_SELECT_LONG_PRESS) {
                RecordUserAction.record("ContextualSearch.LongpressPeek");
            }
            break;
        case EXPANDED:
            if (reason == StateChangeReason.SWIPE || reason == StateChangeReason.FLING) {
                RecordUserAction.record("ContextualSearch.SwipeOrFlingExpand");
            } else if (reason == StateChangeReason.SEARCH_BAR_TAP) {
                RecordUserAction.record("ContextualSearch.SearchBarTapExpand");
            }
            break;
        case MAXIMIZED:
            if (reason == StateChangeReason.SWIPE || reason == StateChangeReason.FLING) {
                RecordUserAction.record("ContextualSearch.SwipeOrFlingMaximize");
            } else if (reason == StateChangeReason.SERP_NAVIGATION) {
                RecordUserAction.record("ContextualSearch.NavigationMaximize");
            }
            break;
        default:
            break;
    }
}
 
Example 5
Source File: ContextualSearchUma.java    From AndroidChromium with Apache License 2.0 4 votes vote down vote up
/**
 * Logs a user action for a change to the Panel state, which allows sequencing of actions.
 * @param toState The state to transition to.
 * @param reason The reason for the state transition.
 */
public static void logPanelStateUserAction(PanelState toState, StateChangeReason reason) {
    switch (toState) {
        case CLOSED:
            if (reason == StateChangeReason.BACK_PRESS) {
                RecordUserAction.record("ContextualSearch.BackPressClose");
            } else if (reason == StateChangeReason.CLOSE_BUTTON) {
                RecordUserAction.record("ContextualSearch.CloseButtonClose");
            } else if (reason == StateChangeReason.SWIPE || reason == StateChangeReason.FLING) {
                RecordUserAction.record("ContextualSearch.SwipeOrFlingClose");
            } else if (reason == StateChangeReason.TAB_PROMOTION) {
                RecordUserAction.record("ContextualSearch.TabPromotionClose");
            } else if (reason == StateChangeReason.BASE_PAGE_TAP) {
                RecordUserAction.record("ContextualSearch.BasePageTapClose");
            } else if (reason == StateChangeReason.BASE_PAGE_SCROLL) {
                RecordUserAction.record("ContextualSearch.BasePageScrollClose");
            } else if (reason == StateChangeReason.SEARCH_BAR_TAP) {
                RecordUserAction.record("ContextualSearch.SearchBarTapClose");
            } else if (reason == StateChangeReason.SERP_NAVIGATION) {
                RecordUserAction.record("ContextualSearch.NavigationClose");
            } else {
                RecordUserAction.record("ContextualSearch.UncommonClose");
            }
            break;
        case PEEKED:
            if (reason == StateChangeReason.TEXT_SELECT_TAP) {
                RecordUserAction.record("ContextualSearch.TapPeek");
            } else if (reason == StateChangeReason.SWIPE || reason == StateChangeReason.FLING) {
                RecordUserAction.record("ContextualSearch.SwipeOrFlingPeek");
            } else if (reason == StateChangeReason.TEXT_SELECT_LONG_PRESS) {
                RecordUserAction.record("ContextualSearch.LongpressPeek");
            }
            break;
        case EXPANDED:
            if (reason == StateChangeReason.SWIPE || reason == StateChangeReason.FLING) {
                RecordUserAction.record("ContextualSearch.SwipeOrFlingExpand");
            } else if (reason == StateChangeReason.SEARCH_BAR_TAP) {
                RecordUserAction.record("ContextualSearch.SearchBarTapExpand");
            }
            break;
        case MAXIMIZED:
            if (reason == StateChangeReason.SWIPE || reason == StateChangeReason.FLING) {
                RecordUserAction.record("ContextualSearch.SwipeOrFlingMaximize");
            } else if (reason == StateChangeReason.SERP_NAVIGATION) {
                RecordUserAction.record("ContextualSearch.NavigationMaximize");
            }
            break;
        default:
            break;
    }
}
 
Example 6
Source File: ContextualSearchUma.java    From 365browser with Apache License 2.0 4 votes vote down vote up
/**
 * Logs a user action for a change to the Panel state, which allows sequencing of actions.
 * @param toState The state to transition to.
 * @param reason The reason for the state transition.
 */
public static void logPanelStateUserAction(PanelState toState, StateChangeReason reason) {
    switch (toState) {
        case CLOSED:
            if (reason == StateChangeReason.BACK_PRESS) {
                RecordUserAction.record("ContextualSearch.BackPressClose");
            } else if (reason == StateChangeReason.CLOSE_BUTTON) {
                RecordUserAction.record("ContextualSearch.CloseButtonClose");
            } else if (reason == StateChangeReason.SWIPE || reason == StateChangeReason.FLING) {
                RecordUserAction.record("ContextualSearch.SwipeOrFlingClose");
            } else if (reason == StateChangeReason.TAB_PROMOTION) {
                RecordUserAction.record("ContextualSearch.TabPromotionClose");
            } else if (reason == StateChangeReason.BASE_PAGE_TAP) {
                RecordUserAction.record("ContextualSearch.BasePageTapClose");
            } else if (reason == StateChangeReason.BASE_PAGE_SCROLL) {
                RecordUserAction.record("ContextualSearch.BasePageScrollClose");
            } else if (reason == StateChangeReason.SEARCH_BAR_TAP) {
                RecordUserAction.record("ContextualSearch.SearchBarTapClose");
            } else if (reason == StateChangeReason.SERP_NAVIGATION) {
                RecordUserAction.record("ContextualSearch.NavigationClose");
            } else {
                RecordUserAction.record("ContextualSearch.UncommonClose");
            }
            break;
        case PEEKED:
            if (reason == StateChangeReason.TEXT_SELECT_TAP) {
                RecordUserAction.record("ContextualSearch.TapPeek");
            } else if (reason == StateChangeReason.SWIPE || reason == StateChangeReason.FLING) {
                RecordUserAction.record("ContextualSearch.SwipeOrFlingPeek");
            } else if (reason == StateChangeReason.TEXT_SELECT_LONG_PRESS) {
                RecordUserAction.record("ContextualSearch.LongpressPeek");
            }
            break;
        case EXPANDED:
            if (reason == StateChangeReason.SWIPE || reason == StateChangeReason.FLING) {
                RecordUserAction.record("ContextualSearch.SwipeOrFlingExpand");
            } else if (reason == StateChangeReason.SEARCH_BAR_TAP) {
                RecordUserAction.record("ContextualSearch.SearchBarTapExpand");
            }
            break;
        case MAXIMIZED:
            if (reason == StateChangeReason.SWIPE || reason == StateChangeReason.FLING) {
                RecordUserAction.record("ContextualSearch.SwipeOrFlingMaximize");
            } else if (reason == StateChangeReason.SERP_NAVIGATION) {
                RecordUserAction.record("ContextualSearch.NavigationMaximize");
            }
            break;
        default:
            break;
    }
}