Java Code Examples for org.chromium.content.browser.ContentViewCore#isFocusedNodeEditable()

The following examples show how to use org.chromium.content.browser.ContentViewCore#isFocusedNodeEditable() . 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 6 votes vote down vote up
@VisibleForTesting
boolean isValidSelection(String selection, ContentViewCore baseContentView) {
    if (selection.length() > MAX_SELECTION_LENGTH) {
        return false;
    }

    if (!doesContainAWord(selection)) {
        return false;
    }

    if (baseContentView != null && baseContentView.isFocusedNodeEditable()) {
        return false;
    }

    return true;
}
 
Example 2
Source File: ContextualSearchSelectionController.java    From AndroidChromium with Apache License 2.0 6 votes vote down vote up
@VisibleForTesting
boolean isValidSelection(String selection, ContentViewCore baseContentView) {
    if (selection.length() > MAX_SELECTION_LENGTH) {
        return false;
    }

    if (!doesContainAWord(selection)) {
        return false;
    }

    if (baseContentView != null && baseContentView.isFocusedNodeEditable()) {
        return false;
    }

    return true;
}
 
Example 3
Source File: ContextualSearchSelectionController.java    From 365browser with Apache License 2.0 6 votes vote down vote up
@VisibleForTesting
boolean isValidSelection(String selection, ContentViewCore baseContentView) {
    if (selection.length() > MAX_SELECTION_LENGTH) {
        return false;
    }

    if (!doesContainAWord(selection)) {
        return false;
    }

    if (baseContentView != null && baseContentView.isFocusedNodeEditable()) {
        return false;
    }

    return true;
}
 
Example 4
Source File: TopControlsVisibilityDelegate.java    From delion with Apache License 2.0 5 votes vote down vote up
/**
 * @return Whether hiding top controls is enabled or not.
 */
public boolean isHidingTopControlsEnabled() {
    WebContents webContents = mTab.getWebContents();
    if (webContents == null || webContents.isDestroyed()) return false;

    String url = mTab.getUrl();
    boolean enableHidingTopControls = url != null;
    enableHidingTopControls &= !url.startsWith(UrlConstants.CHROME_SCHEME);
    enableHidingTopControls &= !url.startsWith(UrlConstants.CHROME_NATIVE_SCHEME);

    int securityState = mTab.getSecurityLevel();
    enableHidingTopControls &= (securityState != ConnectionSecurityLevel.SECURITY_ERROR
            && securityState != ConnectionSecurityLevel.SECURITY_WARNING);

    enableHidingTopControls &=
            !AccessibilityUtil.isAccessibilityEnabled(mTab.getApplicationContext());

    ContentViewCore cvc = mTab.getContentViewCore();
    enableHidingTopControls &= cvc == null || !cvc.isFocusedNodeEditable();
    enableHidingTopControls &= !mTab.isShowingErrorPage();
    enableHidingTopControls &= !webContents.isShowingInterstitialPage();
    enableHidingTopControls &= (mTab.getFullscreenManager() != null);
    enableHidingTopControls &= DeviceClassManager.enableFullscreen();
    enableHidingTopControls &= !mTab.isFullscreenWaitingForLoad();

    return enableHidingTopControls;
}
 
Example 5
Source File: TabStateBrowserControlsVisibilityDelegate.java    From AndroidChromium with Apache License 2.0 5 votes vote down vote up
@Override
public boolean isHidingBrowserControlsEnabled() {
    WebContents webContents = mTab.getWebContents();
    if (webContents == null || webContents.isDestroyed()) return false;

    String url = mTab.getUrl();
    boolean enableHidingBrowserControls = url != null;
    enableHidingBrowserControls &= !url.startsWith(UrlConstants.CHROME_SCHEME);
    enableHidingBrowserControls &= !url.startsWith(UrlConstants.CHROME_NATIVE_SCHEME);

    int securityState = mTab.getSecurityLevel();
    enableHidingBrowserControls &= (securityState != ConnectionSecurityLevel.DANGEROUS
            && securityState != ConnectionSecurityLevel.SECURITY_WARNING);

    enableHidingBrowserControls &=
            !AccessibilityUtil.isAccessibilityEnabled(mTab.getApplicationContext());

    ContentViewCore cvc = mTab.getContentViewCore();
    enableHidingBrowserControls &= cvc == null || !cvc.isFocusedNodeEditable();
    enableHidingBrowserControls &= !mTab.isShowingErrorPage();
    enableHidingBrowserControls &= !webContents.isShowingInterstitialPage();
    enableHidingBrowserControls &= !mTab.isRendererUnresponsive();
    enableHidingBrowserControls &= (mTab.getFullscreenManager() != null);
    enableHidingBrowserControls &= DeviceClassManager.enableFullscreen();
    enableHidingBrowserControls &= !mIsFullscreenWaitingForLoad;

    return enableHidingBrowserControls;
}
 
Example 6
Source File: TabStateBrowserControlsVisibilityDelegate.java    From 365browser with Apache License 2.0 5 votes vote down vote up
@Override
public boolean isHidingBrowserControlsEnabled() {
    WebContents webContents = mTab.getWebContents();
    if (webContents == null || webContents.isDestroyed()) return false;

    String url = mTab.getUrl();
    boolean enableHidingBrowserControls = url != null;
    enableHidingBrowserControls &= !url.startsWith(UrlConstants.CHROME_URL_PREFIX);
    enableHidingBrowserControls &= !url.startsWith(UrlConstants.CHROME_NATIVE_URL_PREFIX);

    int securityState = mTab.getSecurityLevel();
    enableHidingBrowserControls &= (securityState != ConnectionSecurityLevel.DANGEROUS
            && securityState != ConnectionSecurityLevel.SECURITY_WARNING);

    enableHidingBrowserControls &= !AccessibilityUtil.isAccessibilityEnabled();

    ContentViewCore cvc = mTab.getContentViewCore();
    enableHidingBrowserControls &= cvc == null || !cvc.isFocusedNodeEditable();
    enableHidingBrowserControls &= !mTab.isShowingErrorPage();
    enableHidingBrowserControls &= !webContents.isShowingInterstitialPage();
    enableHidingBrowserControls &= !mTab.isRendererUnresponsive();
    enableHidingBrowserControls &= (mTab.getFullscreenManager() != null);
    enableHidingBrowserControls &= DeviceClassManager.enableFullscreen();
    enableHidingBrowserControls &= !mIsFullscreenWaitingForLoad;

    return enableHidingBrowserControls;
}