Search in sources :

Example 1 with SingleTabModelSelector

use of org.chromium.chrome.browser.tabmodel.SingleTabModelSelector in project AndroidChromium by JackyAndroid.

the class Tab method initContentViewCore.

/**
     * Creates and initializes the {@link ContentViewCore}.
     *
     * @param webContents The WebContents object that will be used to build the
     *                    {@link ContentViewCore}.
     */
protected void initContentViewCore(WebContents webContents) {
    ContentViewCore cvc = new ContentViewCore(mThemedApplicationContext, PRODUCT_VERSION);
    ContentView cv = ContentView.createContentView(mThemedApplicationContext, cvc);
    cv.setContentDescription(mThemedApplicationContext.getResources().getString(R.string.accessibility_content_view));
    cvc.initialize(ViewAndroidDelegate.createBasicDelegate(cv), cv, webContents, getWindowAndroid());
    setContentViewCore(cvc);
    if (getTabModelSelector() instanceof SingleTabModelSelector) {
        getContentViewCore().setFullscreenRequiredForOrientationLock(false);
    }
}
Also used : ContentViewCore(org.chromium.content.browser.ContentViewCore) ContentView(org.chromium.content.browser.ContentView) SingleTabModelSelector(org.chromium.chrome.browser.tabmodel.SingleTabModelSelector)

Example 2 with SingleTabModelSelector

use of org.chromium.chrome.browser.tabmodel.SingleTabModelSelector in project AndroidChromium by JackyAndroid.

the class FullScreenActivity method preInflationStartup.

@Override
public void preInflationStartup() {
    super.preInflationStartup();
    setTabCreators(createTabDelegate(false), createTabDelegate(true));
    setTabModelSelector(new SingleTabModelSelector(this, false, false) {

        @Override
        public Tab openNewTab(LoadUrlParams loadUrlParams, TabLaunchType type, Tab parent, boolean incognito) {
            getTabCreator(incognito).createNewTab(loadUrlParams, type, parent);
            return null;
        }
    });
}
Also used : Tab(org.chromium.chrome.browser.tab.Tab) LoadUrlParams(org.chromium.content_public.browser.LoadUrlParams) TabLaunchType(org.chromium.chrome.browser.tabmodel.TabModel.TabLaunchType) SingleTabModelSelector(org.chromium.chrome.browser.tabmodel.SingleTabModelSelector)

Aggregations

SingleTabModelSelector (org.chromium.chrome.browser.tabmodel.SingleTabModelSelector)2 Tab (org.chromium.chrome.browser.tab.Tab)1 TabLaunchType (org.chromium.chrome.browser.tabmodel.TabModel.TabLaunchType)1 ContentView (org.chromium.content.browser.ContentView)1 ContentViewCore (org.chromium.content.browser.ContentViewCore)1 LoadUrlParams (org.chromium.content_public.browser.LoadUrlParams)1