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

The following examples show how to use org.chromium.chrome.browser.compositor.bottombar.OverlayPanel#StateChangeReason . 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: ContextualSearchSelectionController.java    From delion with Apache License 2.0 5 votes vote down vote up
/**
 * Notifies that the Contextual Search has ended.
 * @param reason The reason for ending the Contextual Search.
 */
void onSearchEnded(OverlayPanel.StateChangeReason reason) {
    // If the user explicitly closes the panel after establishing a selection with long press,
    // it should not reappear until a new selection is made. This prevents the panel from
    // reappearing when a long press selection is modified after the user has taken action to
    // get rid of the panel. See crbug.com/489461.
    if (shouldPreventHandlingCurrentSelectionModification(reason)) {
        preventHandlingCurrentSelectionModification();
    }

    // Long press selections should remain visible after ending a Contextual Search.
    if (mSelectionType == SelectionType.TAP) {
        clearSelection();
    }
}
 
Example 2
Source File: ContextualSearchSelectionController.java    From delion with Apache License 2.0 5 votes vote down vote up
/**
 * This method checks whether the selection modification should be handled. This method
 * is needed to allow modifying selections that are occluded by the Panel.
 * See crbug.com/489461.
 *
 * @param reason The reason the panel is closing.
 * @return Whether the selection modification should be handled.
 */
private boolean shouldPreventHandlingCurrentSelectionModification(
        OverlayPanel.StateChangeReason reason) {
    return getSelectionType() == SelectionType.LONG_PRESS
            && (reason == OverlayPanel.StateChangeReason.BACK_PRESS
            || reason == OverlayPanel.StateChangeReason.BASE_PAGE_SCROLL
            || reason == OverlayPanel.StateChangeReason.SWIPE
            || reason == OverlayPanel.StateChangeReason.FLING
            || reason == OverlayPanel.StateChangeReason.CLOSE_BUTTON);
}
 
Example 3
Source File: ContextualSearchSelectionController.java    From AndroidChromium with Apache License 2.0 5 votes vote down vote up
/**
 * Notifies that the Contextual Search has ended.
 * @param reason The reason for ending the Contextual Search.
 */
void onSearchEnded(OverlayPanel.StateChangeReason reason) {
    // If the user explicitly closes the panel after establishing a selection with long press,
    // it should not reappear until a new selection is made. This prevents the panel from
    // reappearing when a long press selection is modified after the user has taken action to
    // get rid of the panel. See crbug.com/489461.
    if (shouldPreventHandlingCurrentSelectionModification(reason)) {
        preventHandlingCurrentSelectionModification();
    }

    // Long press selections should remain visible after ending a Contextual Search.
    if (mSelectionType == SelectionType.TAP) {
        clearSelection();
    }
}
 
Example 4
Source File: ContextualSearchSelectionController.java    From AndroidChromium with Apache License 2.0 5 votes vote down vote up
/**
 * This method checks whether the selection modification should be handled. This method
 * is needed to allow modifying selections that are occluded by the Panel.
 * See crbug.com/489461.
 *
 * @param reason The reason the panel is closing.
 * @return Whether the selection modification should be handled.
 */
private boolean shouldPreventHandlingCurrentSelectionModification(
        OverlayPanel.StateChangeReason reason) {
    return getSelectionType() == SelectionType.LONG_PRESS
            && (reason == OverlayPanel.StateChangeReason.BACK_PRESS
            || reason == OverlayPanel.StateChangeReason.BASE_PAGE_SCROLL
            || reason == OverlayPanel.StateChangeReason.SWIPE
            || reason == OverlayPanel.StateChangeReason.FLING
            || reason == OverlayPanel.StateChangeReason.CLOSE_BUTTON);
}
 
Example 5
Source File: ContextualSearchSelectionController.java    From 365browser with Apache License 2.0 5 votes vote down vote up
/**
 * Notifies that the Contextual Search has ended.
 * @param reason The reason for ending the Contextual Search.
 */
void onSearchEnded(OverlayPanel.StateChangeReason reason) {
    // If the user explicitly closes the panel after establishing a selection with long press,
    // it should not reappear until a new selection is made. This prevents the panel from
    // reappearing when a long press selection is modified after the user has taken action to
    // get rid of the panel. See crbug.com/489461.
    if (shouldPreventHandlingCurrentSelectionModification(reason)) {
        preventHandlingCurrentSelectionModification();
    }

    // Long press selections should remain visible after ending a Contextual Search.
    if (mSelectionType == SelectionType.TAP) {
        clearSelection();
    }
}
 
Example 6
Source File: ContextualSearchSelectionController.java    From 365browser with Apache License 2.0 5 votes vote down vote up
/**
 * This method checks whether the selection modification should be handled. This method
 * is needed to allow modifying selections that are occluded by the Panel.
 * See crbug.com/489461.
 *
 * @param reason The reason the panel is closing.
 * @return Whether the selection modification should be handled.
 */
private boolean shouldPreventHandlingCurrentSelectionModification(
        OverlayPanel.StateChangeReason reason) {
    return getSelectionType() == SelectionType.LONG_PRESS
            && (reason == OverlayPanel.StateChangeReason.BACK_PRESS
            || reason == OverlayPanel.StateChangeReason.BASE_PAGE_SCROLL
            || reason == OverlayPanel.StateChangeReason.SWIPE
            || reason == OverlayPanel.StateChangeReason.FLING
            || reason == OverlayPanel.StateChangeReason.CLOSE_BUTTON);
}