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

The following examples show how to use org.chromium.content.browser.ContentViewCore#setAccessibilityState() . 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: ChromeTabbedActivity.java    From delion with Apache License 2.0 5 votes vote down vote up
private void toggleOverview() {
    Tab currentTab = getActivityTab();
    ContentViewCore contentViewCore =
            currentTab != null ? currentTab.getContentViewCore() : null;

    if (!mLayoutManager.overviewVisible()) {
        getCompositorViewHolder().hideKeyboard(new Runnable() {
            @Override
            public void run() {
                mLayoutManager.showOverview(true);
            }
        });
        if (contentViewCore != null) {
            contentViewCore.setAccessibilityState(false);
        }
    } else {
        Layout activeLayout = mLayoutManager.getActiveLayout();
        if (activeLayout instanceof StackLayout) {
            ((StackLayout) activeLayout).commitOutstandingModelState(LayoutManager.time());
        }
        if (getCurrentTabModel().getCount() != 0) {
            // Don't hide overview if current tab stack is empty()
            mLayoutManager.hideOverview(true);

            // hideOverview could change the current tab.  Update the local variables.
            currentTab = getActivityTab();
            contentViewCore = currentTab != null ? currentTab.getContentViewCore() : null;

            if (contentViewCore != null) {
                contentViewCore.setAccessibilityState(true);
            }
        }
    }
}
 
Example 2
Source File: LayoutManagerDocumentTabSwitcher.java    From delion with Apache License 2.0 5 votes vote down vote up
public void toggleOverview() {
    Tab tab = getTabModelSelector().getCurrentTab();
    ContentViewCore contentViewCore = tab != null ? tab.getContentViewCore() : null;

    if (!overviewVisible()) {
        mHost.hideKeyboard(new Runnable() {
            @Override
            public void run() {
                showOverview(true);
            }
        });
        if (contentViewCore != null) {
            contentViewCore.setAccessibilityState(false);
        }
    } else {
        Layout activeLayout = getActiveLayout();
        if (activeLayout instanceof StackLayout) {
            ((StackLayout) activeLayout).commitOutstandingModelState(LayoutManager.time());
        }
        if (getTabModelSelector().getCurrentModel().getCount() != 0) {
            // Don't hide overview if current tab stack is empty()
            hideOverview(true);

            // hideOverview could change the current tab.  Update the local variables.
            tab = getTabModelSelector().getCurrentTab();
            contentViewCore = tab != null ? tab.getContentViewCore() : null;

            if (contentViewCore != null) {
                contentViewCore.setAccessibilityState(true);
            }
        }
    }
}
 
Example 3
Source File: ChromeTabbedActivity.java    From AndroidChromium with Apache License 2.0 5 votes vote down vote up
private void toggleOverview() {
    Tab currentTab = getActivityTab();
    ContentViewCore contentViewCore =
            currentTab != null ? currentTab.getContentViewCore() : null;

    if (!mLayoutManager.overviewVisible()) {
        getCompositorViewHolder().hideKeyboard(new Runnable() {
            @Override
            public void run() {
                mLayoutManager.showOverview(true);
            }
        });
        if (contentViewCore != null) {
            contentViewCore.setAccessibilityState(false);
        }
    } else {
        Layout activeLayout = mLayoutManager.getActiveLayout();
        if (activeLayout instanceof StackLayout) {
            ((StackLayout) activeLayout).commitOutstandingModelState(LayoutManager.time());
        }
        if (getCurrentTabModel().getCount() != 0) {
            // Don't hide overview if current tab stack is empty()
            mLayoutManager.hideOverview(true);

            // hideOverview could change the current tab.  Update the local variables.
            currentTab = getActivityTab();
            contentViewCore = currentTab != null ? currentTab.getContentViewCore() : null;

            if (contentViewCore != null) {
                contentViewCore.setAccessibilityState(true);
            }
        }
    }
}
 
Example 4
Source File: ChromeTabbedActivity.java    From 365browser with Apache License 2.0 5 votes vote down vote up
private void toggleOverview() {
    Tab currentTab = getActivityTab();
    ContentViewCore contentViewCore =
            currentTab != null ? currentTab.getContentViewCore() : null;

    if (!mLayoutManager.overviewVisible()) {
        getCompositorViewHolder().hideKeyboard(new Runnable() {
            @Override
            public void run() {
                mLayoutManager.showOverview(true);
            }
        });
        if (contentViewCore != null) {
            contentViewCore.setAccessibilityState(false);
        }
    } else {
        Layout activeLayout = mLayoutManager.getActiveLayout();
        if (activeLayout instanceof StackLayout) {
            ((StackLayout) activeLayout).commitOutstandingModelState(LayoutManager.time());
        }
        if (getCurrentTabModel().getCount() != 0) {
            // Don't hide overview if current tab stack is empty()
            mLayoutManager.hideOverview(true);

            // hideOverview could change the current tab.  Update the local variables.
            currentTab = getActivityTab();
            contentViewCore = currentTab != null ? currentTab.getContentViewCore() : null;

            if (contentViewCore != null) {
                contentViewCore.setAccessibilityState(true);
            }
        }
    }
}