org.chromium.chrome.browser.tabmodel.TabReparentingParams Java Examples

The following examples show how to use org.chromium.chrome.browser.tabmodel.TabReparentingParams. 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: Tab.java    From delion with Apache License 2.0 5 votes vote down vote up
/**
 * Finishes the tab reparenting process. Attaches the tab to the new activity, and updates the
 * tab and related objects to reference the new activity. This updates many delegates inside the
 * tab and {@link ContentViewCore} both on java and native sides.
 *
 * @param activity The new activity this tab should be associated with.
 * @param tabDelegateFactory The new delegate factory this tab should be using.
 * @Param reparentingParams The TabReparentingParams associated with this reparenting process.
 */
public void attachAndFinishReparenting(ChromeActivity activity,
        TabDelegateFactory tabDelegateFactory, TabReparentingParams reparentingParams) {
    // TODO(yusufo): Share these calls with the construction related calls.
    // crbug.com/590281

    // Update and propagate for the new WindowAndroid.
    mWindowAndroid = activity.getWindowAndroid();
    mContentViewCore.updateWindowAndroid(mWindowAndroid);

    // Update for the controllers that need the Compositor from the new Activity.
    attachTabContentManager(activity.getTabContentManager());
    mFullscreenManager = activity.getFullscreenManager();
    activity.getCompositorViewHolder().prepareForTabReparenting();

    // Update the delegate factory, then recreate and propagate all delegates.
    mDelegateFactory = tabDelegateFactory;
    mWebContentsDelegate = mDelegateFactory.createWebContentsDelegate(this);
    nativeUpdateDelegates(mNativeTabAndroid,
            mWebContentsDelegate, mDelegateFactory.createContextMenuPopulator(this));
    mTopControlsVisibilityDelegate = mDelegateFactory.createTopControlsVisibilityDelegate(this);
    setInterceptNavigationDelegate(mDelegateFactory.createInterceptNavigationDelegate(this));
    mAppBannerManager = mDelegateFactory.createAppBannerManager(this);

    // Reload the NativePage (if any), since the old NativePage has a reference to the old
    // activity.
    maybeShowNativePage(getUrl(), true);

    reparentingParams.finalizeTabReparenting();
    mIsDetachedForReparenting = false;

    for (TabObserver observer : mObservers) {
        observer.onReparentingFinished(this);
    }
}
 
Example #2
Source File: Tab.java    From AndroidChromium with Apache License 2.0 5 votes vote down vote up
/**
 * Finishes the tab reparenting process. Attaches the tab to the new activity, and updates the
 * tab and related objects to reference the new activity. This updates many delegates inside the
 * tab and {@link ContentViewCore} both on java and native sides.
 *
 * @param activity The new activity this tab should be associated with.
 * @param tabDelegateFactory The new delegate factory this tab should be using.
 * @Param reparentingParams The TabReparentingParams associated with this reparenting process.
 */
public void attachAndFinishReparenting(ChromeActivity activity,
        TabDelegateFactory tabDelegateFactory, TabReparentingParams reparentingParams) {
    // TODO(yusufo): Share these calls with the construction related calls.
    // crbug.com/590281

    updateWindowAndroid(activity.getWindowAndroid());

    // Update for the controllers that need the Compositor from the new Activity.
    attachTabContentManager(activity.getTabContentManager());
    mFullscreenManager = activity.getFullscreenManager();
    activity.getCompositorViewHolder().prepareForTabReparenting();

    // Update the delegate factory, then recreate and propagate all delegates.
    mDelegateFactory = tabDelegateFactory;
    mWebContentsDelegate = mDelegateFactory.createWebContentsDelegate(this);
    nativeUpdateDelegates(mNativeTabAndroid,
            mWebContentsDelegate, mDelegateFactory.createContextMenuPopulator(this));
    mBrowserControlsVisibilityDelegate =
            mDelegateFactory.createBrowserControlsVisibilityDelegate(this);
    setInterceptNavigationDelegate(mDelegateFactory.createInterceptNavigationDelegate(this));
    getAppBannerManager().setIsEnabledForTab(mDelegateFactory.canShowAppBanners(this));

    reparentingParams.finalizeTabReparenting();
    mIsDetachedForReparenting = false;

    // Reload the NativePage (if any), since the old NativePage has a reference to the old
    // activity.
    maybeShowNativePage(getUrl(), true);

    mIsTabStateDirty = true;

    for (TabObserver observer : mObservers) {
        observer.onReparentingFinished(this);
    }
}
 
Example #3
Source File: Tab.java    From 365browser with Apache License 2.0 5 votes vote down vote up
/**
 * Finishes the tab reparenting process. Attaches the tab to the new activity, and updates the
 * tab and related objects to reference the new activity. This updates many delegates inside the
 * tab and {@link ContentViewCore} both on java and native sides.
 *
 * @param activity The new activity this tab should be associated with.
 * @param tabDelegateFactory The new delegate factory this tab should be using.
 * @Param reparentingParams The TabReparentingParams associated with this reparenting process.
 */
public void attachAndFinishReparenting(ChromeActivity activity,
        TabDelegateFactory tabDelegateFactory, TabReparentingParams reparentingParams) {
    // TODO(yusufo): Share these calls with the construction related calls.
    // crbug.com/590281

    updateWindowAndroid(activity.getWindowAndroid());

    // Update for the controllers that need the Compositor from the new Activity.
    attachTabContentManager(activity.getTabContentManager());
    mFullscreenManager = activity.getFullscreenManager();
    activity.getCompositorViewHolder().prepareForTabReparenting();
    // Update the delegate factory, then recreate and propagate all delegates.
    mDelegateFactory = tabDelegateFactory;
    mWebContentsDelegate = mDelegateFactory.createWebContentsDelegate(this);
    nativeUpdateDelegates(mNativeTabAndroid,
            mWebContentsDelegate, mDelegateFactory.createContextMenuPopulator(this));
    mBrowserControlsVisibilityDelegate =
            mDelegateFactory.createBrowserControlsVisibilityDelegate(this);
    setInterceptNavigationDelegate(mDelegateFactory.createInterceptNavigationDelegate(this));
    getAppBannerManager().setIsEnabledForTab(mDelegateFactory.canShowAppBanners(this));

    reparentingParams.finalizeTabReparenting();
    mIsDetached = false;
    nativeAttachDetachedTab(mNativeTabAndroid);

    // Reload the NativePage (if any), since the old NativePage has a reference to the old
    // activity.
    maybeShowNativePage(getUrl(), true);

    mIsTabStateDirty = true;

    for (TabObserver observer : mObservers) {
        observer.onReparentingFinished(this);
    }
}