org.chromium.chrome.browser.compositor.layouts.LayoutManagerDocument Java Examples

The following examples show how to use org.chromium.chrome.browser.compositor.layouts.LayoutManagerDocument. 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: ChromeActivity.java    From AndroidChromium with Apache License 2.0 6 votes vote down vote up
/**
 * Initializes the {@link CompositorViewHolder} with the relevant content it needs to properly
 * show content on the screen.
 * @param layoutManager             A {@link LayoutManagerDocument} instance.  This class is
 *                                  responsible for driving all high level screen content and
 *                                  determines which {@link Layout} is shown when.
 * @param urlBar                    The {@link View} representing the URL bar (must be
 *                                  focusable) or {@code null} if none exists.
 * @param contentContainer          A {@link ViewGroup} that can have content attached by
 *                                  {@link Layout}s.
 * @param controlContainer          A {@link ControlContainer} instance to draw.
 */
protected void initializeCompositorContent(
        LayoutManagerDocument layoutManager, View urlBar, ViewGroup contentContainer,
        ControlContainer controlContainer) {
    if (mContextualSearchManager != null) {
        mContextualSearchManager.initialize(contentContainer);
        mContextualSearchManager.setSearchContentViewDelegate(layoutManager);
    }

    layoutManager.addSceneChangeObserver(this);
    mCompositorViewHolder.setLayoutManager(layoutManager);
    mCompositorViewHolder.setFocusable(false);
    mCompositorViewHolder.setControlContainer(controlContainer);
    mCompositorViewHolder.setFullscreenHandler(getFullscreenManager());
    mCompositorViewHolder.setUrlBar(urlBar);
    mCompositorViewHolder.onFinishNativeInitialization(getTabModelSelector(), this,
            getTabContentManager(), contentContainer, mContextualSearchManager,
            mReaderModeManager);

    if (controlContainer != null
            && DeviceClassManager.enableToolbarSwipe()) {
        controlContainer.setSwipeHandler(
                getCompositorViewHolder().getLayoutManager().getTopSwipeHandler());
    }
}
 
Example #2
Source File: ChromeActivity.java    From 365browser with Apache License 2.0 6 votes vote down vote up
/**
 * Initializes the {@link CompositorViewHolder} with the relevant content it needs to properly
 * show content on the screen.
 * @param layoutManager             A {@link LayoutManagerDocument} instance.  This class is
 *                                  responsible for driving all high level screen content and
 *                                  determines which {@link Layout} is shown when.
 * @param urlBar                    The {@link View} representing the URL bar (must be
 *                                  focusable) or {@code null} if none exists.
 * @param contentContainer          A {@link ViewGroup} that can have content attached by
 *                                  {@link Layout}s.
 * @param controlContainer          A {@link ControlContainer} instance to draw.
 */
protected void initializeCompositorContent(
        LayoutManagerDocument layoutManager, View urlBar, ViewGroup contentContainer,
        ControlContainer controlContainer) {
    if (mContextualSearchManager != null) {
        mContextualSearchManager.initialize(contentContainer);
        mContextualSearchManager.setSearchContentViewDelegate(layoutManager);
    }

    layoutManager.addSceneChangeObserver(this);
    mCompositorViewHolder.setLayoutManager(layoutManager);
    mCompositorViewHolder.setFocusable(false);
    mCompositorViewHolder.setControlContainer(controlContainer);
    mCompositorViewHolder.setFullscreenHandler(getFullscreenManager());
    mCompositorViewHolder.setUrlBar(urlBar);
    mCompositorViewHolder.onFinishNativeInitialization(getTabModelSelector(), this,
            getTabContentManager(), contentContainer, mContextualSearchManager,
            mReaderModeManager);

    if (controlContainer != null
            && DeviceClassManager.enableToolbarSwipe()) {
        controlContainer.setSwipeHandler(
                getCompositorViewHolder().getLayoutManager().getTopSwipeHandler());
    }
}
 
Example #3
Source File: FullScreenActivity.java    From delion with Apache License 2.0 5 votes vote down vote up
@Override
public void finishNativeInitialization() {
    mTab = createTab();
    getTabModelSelector().setTab(mTab);
    mTab.show(TabSelectionType.FROM_NEW);

    ControlContainer controlContainer = (ControlContainer) findViewById(R.id.control_container);
    initializeCompositorContent(new LayoutManagerDocument(getCompositorViewHolder()),
            (View) controlContainer, (ViewGroup) findViewById(android.R.id.content),
            controlContainer);

    getActivityTab().setFullscreenManager(getFullscreenManager());
    super.finishNativeInitialization();
}
 
Example #4
Source File: ChromeActivity.java    From delion with Apache License 2.0 5 votes vote down vote up
/**
 * Initializes the {@link CompositorViewHolder} with the relevant content it needs to properly
 * show content on the screen.
 * @param layoutManager             A {@link LayoutManagerDocument} instance.  This class is
 *                                  responsible for driving all high level screen content and
 *                                  determines which {@link Layout} is shown when.
 * @param urlBar                    The {@link View} representing the URL bar (must be
 *                                  focusable) or {@code null} if none exists.
 * @param contentContainer          A {@link ViewGroup} that can have content attached by
 *                                  {@link Layout}s.
 * @param controlContainer          A {@link ControlContainer} instance to draw.
 */
protected void initializeCompositorContent(
        LayoutManagerDocument layoutManager, View urlBar, ViewGroup contentContainer,
        ControlContainer controlContainer) {
    if (controlContainer != null) {
        mFullscreenManager = createFullscreenManager(controlContainer);
    }

    if (mContextualSearchManager != null) {
        mContextualSearchManager.initialize(contentContainer);
        mContextualSearchManager.setSearchContentViewDelegate(layoutManager);
    }

    layoutManager.addSceneChangeObserver(this);
    mCompositorViewHolder.setLayoutManager(layoutManager);
    mCompositorViewHolder.setFocusable(false);
    mCompositorViewHolder.setControlContainer(controlContainer);
    mCompositorViewHolder.setFullscreenHandler(mFullscreenManager);
    mCompositorViewHolder.setUrlBar(urlBar);
    mCompositorViewHolder.onFinishNativeInitialization(getTabModelSelector(), this,
            getTabContentManager(), contentContainer, mContextualSearchManager,
            mReaderModeManager);

    if (controlContainer != null
            && DeviceClassManager.enableToolbarSwipe(FeatureUtilities.isDocumentMode(this))) {
        controlContainer.setSwipeHandler(
                getCompositorViewHolder().getLayoutManager().getTopSwipeHandler());
    }
}
 
Example #5
Source File: FullScreenActivity.java    From AndroidChromium with Apache License 2.0 5 votes vote down vote up
@Override
public void finishNativeInitialization() {
    mTab = createTab();
    handleTabContentChanged();
    getTabModelSelector().setTab(mTab);
    mTab.show(TabSelectionType.FROM_NEW);

    ControlContainer controlContainer = (ControlContainer) findViewById(R.id.control_container);
    initializeCompositorContent(new LayoutManagerDocument(getCompositorViewHolder()),
            (View) controlContainer, (ViewGroup) findViewById(android.R.id.content),
            controlContainer);

    if (getFullscreenManager() != null) getFullscreenManager().setTab(getActivityTab());
    super.finishNativeInitialization();
}
 
Example #6
Source File: FullScreenActivity.java    From 365browser with Apache License 2.0 5 votes vote down vote up
@Override
public void finishNativeInitialization() {
    ControlContainer controlContainer = (ControlContainer) findViewById(R.id.control_container);
    initializeCompositorContent(new LayoutManagerDocument(getCompositorViewHolder()),
            (View) controlContainer, (ViewGroup) findViewById(android.R.id.content),
            controlContainer);

    if (getFullscreenManager() != null) getFullscreenManager().setTab(getActivityTab());
    super.finishNativeInitialization();
}