org.chromium.chrome.browser.compositor.LayerTitleCache Java Examples

The following examples show how to use org.chromium.chrome.browser.compositor.LayerTitleCache. 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: TabStripSceneLayer.java    From 365browser with Apache License 2.0 6 votes vote down vote up
private void pushStripTabs(StripLayoutHelperManager layoutHelper,
        LayerTitleCache layerTitleCache, ResourceManager resourceManager,
        StripLayoutTab[] stripTabs, int selectedTabId) {
    final int tabsCount = stripTabs != null ? stripTabs.length : 0;

    for (int i = 0; i < tabsCount; i++) {
        final StripLayoutTab st = stripTabs[i];
        boolean isSelected = st.getId() == selectedTabId;
        nativePutStripTabLayer(mNativePtr, st.getId(), st.getCloseButton().getResourceId(),
                st.getResourceId(isSelected), isSelected, st.getClosePressed(),
                layoutHelper.getWidth() * mDpToPx, st.getDrawX() * mDpToPx,
                st.getDrawY() * mDpToPx, st.getWidth() * mDpToPx, st.getHeight() * mDpToPx,
                st.getContentOffsetX() * mDpToPx, st.getCloseButton().getOpacity(),
                st.isLoading(), st.getLoadingSpinnerRotation(), layoutHelper.getBorderOpacity(),
                layerTitleCache, resourceManager);
    }
}
 
Example #2
Source File: Layout.java    From AndroidChromium with Apache License 2.0 6 votes vote down vote up
/**
 * Build a {@link SceneLayer} if it hasn't already been built, and update it and return it.
 *
 * @param viewport          A viewport in which to display content.
 * @param contentViewport   The visible section of the viewport.
 * @param layerTitleCache   A layer title cache.
 * @param tabContentManager A tab content manager.
 * @param resourceManager   A resource manager.
 * @param fullscreenManager A fullscreen manager.
 * @return                  A {@link SceneLayer} that represents the content for this
 *                          {@link Layout}.
 */
public final SceneLayer getUpdatedSceneLayer(Rect viewport, Rect contentViewport,
        LayerTitleCache layerTitleCache, TabContentManager tabContentManager,
        ResourceManager resourceManager, ChromeFullscreenManager fullscreenManager) {
    updateSceneLayer(viewport, contentViewport, layerTitleCache, tabContentManager,
            resourceManager, fullscreenManager);

    float offsetPx = fullscreenManager != null ? fullscreenManager.getTopControlOffset() : 0.f;
    float dpToPx = getContext().getResources().getDisplayMetrics().density;
    float offsetDp = offsetPx / dpToPx;

    SceneLayer content = getSceneLayer();
    for (int i = 0; i < mSceneOverlays.size(); i++) {
        // If the SceneOverlay is not showing, don't bother adding it to the tree.
        if (!mSceneOverlays.get(i).isSceneOverlayTreeShowing()) continue;

        SceneOverlayLayer overlayLayer = mSceneOverlays.get(i).getUpdatedSceneOverlayTree(
                layerTitleCache, resourceManager, offsetDp);

        overlayLayer.setContentTree(content);
        content = overlayLayer;
    }

    return content;
}
 
Example #3
Source File: StaticLayout.java    From AndroidChromium with Apache License 2.0 6 votes vote down vote up
@Override
protected void updateSceneLayer(Rect viewport, Rect contentViewport,
        LayerTitleCache layerTitleCache, TabContentManager tabContentManager,
        ResourceManager resourceManager, ChromeFullscreenManager fullscreenManager) {
    super.updateSceneLayer(viewport, contentViewport, layerTitleCache, tabContentManager,
            resourceManager, fullscreenManager);
    assert mSceneLayer != null;

    final LayoutTab[] tabs = getLayoutTabsToRender();
    if (tabs == null || tabs.length != 1 || tabs[0].getId() == Tab.INVALID_TAB_ID) {
        return;
    }
    LayoutTab layoutTab = tabs[0];
    final float dpToPx = getContext().getResources().getDisplayMetrics().density;

    mSceneLayer.update(dpToPx, contentViewport, layerTitleCache, tabContentManager,
            fullscreenManager, layoutTab);

    // TODO(dtrainor): Find the best way to properly track this metric for cold starts.
    // We should probably erase the thumbnail when we select a tab that we need to restore.
    if (tabContentManager != null
            && tabContentManager.hasFullCachedThumbnail(layoutTab.getId())) {
        TabModelImpl.logPerceivedTabSwitchLatencyMetric();
    }
}
 
Example #4
Source File: StaticTabSceneLayer.java    From AndroidChromium with Apache License 2.0 6 votes vote down vote up
/**
 * Update {@link StaticTabSceneLayer} with the given parameters.
 *
 * @param dpToPx            The ratio of dp to px.
 * @param contentViewport   The viewport of the content.
 * @param layerTitleCache   The LayerTitleCache.
 * @param tabContentManager The TabContentManager.
 * @param fullscreenManager The FullscreenManager.
 * @param layoutTab         The LayoutTab.
 */
public void update(float dpToPx, Rect contentViewport, LayerTitleCache layerTitleCache,
        TabContentManager tabContentManager, ChromeFullscreenManager fullscreenManager,
        LayoutTab layoutTab) {
    if (layoutTab == null) {
        return;
    }

    float contentOffset =
            fullscreenManager != null ? fullscreenManager.getContentOffset() : 0.f;

    // TODO(dtrainor, clholgat): remove "* dpToPx" once the native part is fully supporting dp.
    nativeUpdateTabLayer(mNativePtr, contentViewport.left, contentViewport.top,
            contentViewport.width(), contentViewport.height(), tabContentManager,
            layoutTab.getId(), mResToolbarControlContainer, layoutTab.canUseLiveTexture(),
            layoutTab.getBackgroundColor(), layoutTab.getRenderX() * dpToPx,
            layoutTab.getRenderY() * dpToPx, layoutTab.getScaledContentWidth() * dpToPx,
            layoutTab.getScaledContentHeight() * dpToPx, contentOffset,
            layoutTab.getStaticToViewBlend(), layoutTab.getSaturation(),
            layoutTab.getBrightness());
}
 
Example #5
Source File: TabStripSceneLayer.java    From AndroidChromium with Apache License 2.0 6 votes vote down vote up
/**
 * Pushes all relevant {@link StripLayoutTab}s to the CC Layer tree.
 * This also pushes any other assets required to draw the Tab Strip.  This should only be called
 * when the Compositor has disabled ScheduleComposite calls as this will change the tree and
 * could subsequently cause unnecessary follow up renders.
 *
 * @param layoutHelper A layout helper for the tab strip.
 * @param layerTitleCache A layer title cache.
 * @param resourceManager A resource manager.
 * @param stripLayoutTabsToRender Array of strip layout tabs.
 * @param yOffset Current browser controls offset in dp.
 */
public void pushAndUpdateStrip(StripLayoutHelperManager layoutHelper,
        LayerTitleCache layerTitleCache, ResourceManager resourceManager,
        StripLayoutTab[] stripLayoutTabsToRender, float yOffset, int selectedTabId) {
    if (mNativePtr == 0) return;

    final boolean visible = yOffset > -layoutHelper.getHeight();
    // This will hide the tab strips if necessary.
    nativeBeginBuildingFrame(mNativePtr, visible);
    // When strip tabs are completely off screen, we don't need to update it.
    if (visible) {
        pushButtonsAndBackground(layoutHelper, resourceManager, yOffset);
        pushStripTabs(layoutHelper, layerTitleCache, resourceManager, stripLayoutTabsToRender,
                selectedTabId);
    }
    nativeFinishBuildingFrame(mNativePtr);
}
 
Example #6
Source File: TabStripSceneLayer.java    From AndroidChromium with Apache License 2.0 6 votes vote down vote up
private void pushStripTabs(StripLayoutHelperManager layoutHelper,
        LayerTitleCache layerTitleCache, ResourceManager resourceManager,
        StripLayoutTab[] stripTabs, int selectedTabId) {
    final int tabsCount = stripTabs != null ? stripTabs.length : 0;

    for (int i = 0; i < tabsCount; i++) {
        final StripLayoutTab st = stripTabs[i];
        boolean isSelected = st.getId() == selectedTabId;
        nativePutStripTabLayer(mNativePtr, st.getId(), st.getCloseButton().getResourceId(),
                st.getResourceId(isSelected), isSelected, st.getClosePressed(),
                layoutHelper.getWidth() * mDpToPx, st.getDrawX() * mDpToPx,
                st.getDrawY() * mDpToPx, st.getWidth() * mDpToPx, st.getHeight() * mDpToPx,
                st.getContentOffsetX() * mDpToPx, st.getCloseButton().getOpacity(),
                st.isLoading(), st.getLoadingSpinnerRotation(), layoutHelper.getBorderOpacity(),
                layerTitleCache, resourceManager);
    }
}
 
Example #7
Source File: TabStripSceneLayer.java    From delion with Apache License 2.0 6 votes vote down vote up
private void pushStripTabs(StripLayoutHelperManager layoutHelper,
        LayerTitleCache layerTitleCache, ResourceManager resourceManager,
        StripLayoutTab[] stripTabs, int selectedTabId) {
    final int tabsCount = stripTabs != null ? stripTabs.length : 0;

    for (int i = 0; i < tabsCount; i++) {
        final StripLayoutTab st = stripTabs[i];
        boolean isSelected = st.getId() == selectedTabId;
        nativePutStripTabLayer(mNativePtr, st.getId(), st.getCloseButton().getResourceId(),
                st.getResourceId(isSelected), isSelected, st.getClosePressed(),
                layoutHelper.getWidth() * mDpToPx, st.getDrawX() * mDpToPx,
                st.getDrawY() * mDpToPx, st.getWidth() * mDpToPx, st.getHeight() * mDpToPx,
                st.getContentOffsetX() * mDpToPx, st.getCloseButton().getOpacity(),
                st.isLoading(), st.getLoadingSpinnerRotation(), layoutHelper.getBorderOpacity(),
                layerTitleCache, resourceManager);
    }
}
 
Example #8
Source File: TabStripSceneLayer.java    From delion with Apache License 2.0 6 votes vote down vote up
/**
 * Pushes all relevant {@link StripLayoutTab}s to the CC Layer tree.
 * This also pushes any other assets required to draw the Tab Strip.  This should only be called
 * when the Compositor has disabled ScheduleComposite calls as this will change the tree and
 * could subsequently cause unnecessary follow up renders.
 *
 * @param layoutHelper A layout helper for the tab strip.
 * @param layerTitleCache A layer title cache.
 * @param resourceManager A resource manager.
 * @param stripLayoutTabsToRender Array of strip layout tabs.
 * @param yOffset Current top controls offset in dp.
 */
public void pushAndUpdateStrip(StripLayoutHelperManager layoutHelper,
        LayerTitleCache layerTitleCache, ResourceManager resourceManager,
        StripLayoutTab[] stripLayoutTabsToRender, float yOffset, int selectedTabId) {
    if (mNativePtr == 0) return;

    final boolean visible = yOffset > -layoutHelper.getHeight();
    // This will hide the tab strips if necessary.
    nativeBeginBuildingFrame(mNativePtr, visible);
    // When strip tabs are completely off screen, we don't need to update it.
    if (visible) {
        pushButtonsAndBackground(layoutHelper, resourceManager, yOffset);
        pushStripTabs(layoutHelper, layerTitleCache, resourceManager, stripLayoutTabsToRender,
                selectedTabId);
    }
    nativeFinishBuildingFrame(mNativePtr);
}
 
Example #9
Source File: StaticTabSceneLayer.java    From delion with Apache License 2.0 6 votes vote down vote up
/**
 * Update {@link StaticTabSceneLayer} with the given parameters.
 *
 * @param dpToPx            The ratio of dp to px.
 * @param contentViewport   The viewport of the content.
 * @param layerTitleCache   The LayerTitleCache.
 * @param tabContentManager The TabContentManager.
 * @param fullscreenManager The FullscreenManager.
 * @param layoutTab         The LayoutTab.
 */
public void update(float dpToPx, Rect contentViewport, LayerTitleCache layerTitleCache,
        TabContentManager tabContentManager, ChromeFullscreenManager fullscreenManager,
        LayoutTab layoutTab) {
    if (layoutTab == null) {
        return;
    }

    float contentOffset =
            fullscreenManager != null ? fullscreenManager.getContentOffset() : 0.f;

    // TODO(dtrainor, clholgat): remove "* dpToPx" once the native part is fully supporting dp.
    nativeUpdateTabLayer(mNativePtr, contentViewport.left, contentViewport.top,
            contentViewport.width(), contentViewport.height(), tabContentManager,
            layoutTab.getId(), mResToolbarControlContainer, layoutTab.canUseLiveTexture(),
            layoutTab.getBackgroundColor(), layoutTab.getRenderX() * dpToPx,
            layoutTab.getRenderY() * dpToPx, layoutTab.getScaledContentWidth() * dpToPx,
            layoutTab.getScaledContentHeight() * dpToPx, contentOffset,
            layoutTab.getStaticToViewBlend(), layoutTab.getSaturation(),
            layoutTab.getBrightness());
}
 
Example #10
Source File: StaticLayout.java    From 365browser with Apache License 2.0 6 votes vote down vote up
@Override
protected void updateSceneLayer(RectF viewport, RectF contentViewport,
        LayerTitleCache layerTitleCache, TabContentManager tabContentManager,
        ResourceManager resourceManager, ChromeFullscreenManager fullscreenManager) {
    super.updateSceneLayer(viewport, contentViewport, layerTitleCache, tabContentManager,
            resourceManager, fullscreenManager);
    assert mSceneLayer != null;

    final LayoutTab[] tabs = getLayoutTabsToRender();
    if (tabs == null || tabs.length != 1 || tabs[0].getId() == Tab.INVALID_TAB_ID) {
        return;
    }
    LayoutTab layoutTab = tabs[0];
    final float dpToPx = getContext().getResources().getDisplayMetrics().density;

    mSceneLayer.update(
            dpToPx, layerTitleCache, tabContentManager, fullscreenManager, layoutTab);

    // TODO(dtrainor): Find the best way to properly track this metric for cold starts.
    // We should probably erase the thumbnail when we select a tab that we need to restore.
    if (tabContentManager != null
            && tabContentManager.hasFullCachedThumbnail(layoutTab.getId())) {
        TabModelImpl.logPerceivedTabSwitchLatencyMetric();
    }
}
 
Example #11
Source File: Layout.java    From 365browser with Apache License 2.0 6 votes vote down vote up
/**
 * Build a {@link SceneLayer} if it hasn't already been built, and update it and return it.
 *
 * @param viewport          A viewport in which to display content in px.
 * @param visibleViewport   The visible section of the viewport in px.
 * @param layerTitleCache   A layer title cache.
 * @param tabContentManager A tab content manager.
 * @param resourceManager   A resource manager.
 * @param fullscreenManager A fullscreen manager.
 * @return                  A {@link SceneLayer} that represents the content for this
 *                          {@link Layout}.
 */
public final SceneLayer getUpdatedSceneLayer(RectF viewport, RectF visibleViewport,
        LayerTitleCache layerTitleCache, TabContentManager tabContentManager,
        ResourceManager resourceManager, ChromeFullscreenManager fullscreenManager) {
    updateSceneLayer(viewport, visibleViewport, layerTitleCache, tabContentManager,
            resourceManager, fullscreenManager);

    float offsetPx = fullscreenManager != null ? fullscreenManager.getTopControlOffset() : 0.f;
    float dpToPx = getContext().getResources().getDisplayMetrics().density;
    float offsetDp = offsetPx / dpToPx;

    SceneLayer content = getSceneLayer();
    for (int i = 0; i < mSceneOverlays.size(); i++) {
        // If the SceneOverlay is not showing, don't bother adding it to the tree.
        if (!mSceneOverlays.get(i).isSceneOverlayTreeShowing()) continue;

        SceneOverlayLayer overlayLayer = mSceneOverlays.get(i).getUpdatedSceneOverlayTree(
                viewport, visibleViewport, layerTitleCache, resourceManager, offsetDp);

        overlayLayer.setContentTree(content);
        content = overlayLayer;
    }

    return content;
}
 
Example #12
Source File: ToolbarSceneLayer.java    From 365browser with Apache License 2.0 6 votes vote down vote up
@Override
public SceneOverlayLayer getUpdatedSceneOverlayTree(RectF viewport, RectF visibleViewport,
        LayerTitleCache layerTitleCache, ResourceManager resourceManager, float yOffset) {
    boolean forceHideBrowserControlsAndroidView =
            mLayoutProvider.getActiveLayout().forceHideBrowserControlsAndroidView();
    ViewportMode viewportMode = mLayoutProvider.getActiveLayout().getViewportMode();

    // TODO(mdjones): Create a "theme provider" to handle cases like this.
    int color = mRenderHost.getBrowserControlsBackgroundColor();
    float alpha = mRenderHost.getBrowserControlsUrlBarAlpha();
    ChromeFullscreenManager fullscreenManager = mLayoutProvider.getFullscreenManager();
    if (fullscreenManager.areBrowserControlsAtBottom() && fullscreenManager.getTab() != null) {
        color = fullscreenManager.getTab().getDefaultThemeColor();
        if (!fullscreenManager.getTab().isIncognito()) alpha = 1f;
    }

    update(color, alpha, mLayoutProvider.getFullscreenManager(), resourceManager,
            forceHideBrowserControlsAndroidView, viewportMode, DeviceFormFactor.isTablet(),
            viewport.height());

    return this;
}
 
Example #13
Source File: TabStripSceneLayer.java    From 365browser with Apache License 2.0 6 votes vote down vote up
/**
 * Pushes all relevant {@link StripLayoutTab}s to the CC Layer tree.
 * This also pushes any other assets required to draw the Tab Strip.  This should only be called
 * when the Compositor has disabled ScheduleComposite calls as this will change the tree and
 * could subsequently cause unnecessary follow up renders.
 *
 * @param layoutHelper A layout helper for the tab strip.
 * @param layerTitleCache A layer title cache.
 * @param resourceManager A resource manager.
 * @param stripLayoutTabsToRender Array of strip layout tabs.
 * @param yOffset Current browser controls offset in dp.
 */
public void pushAndUpdateStrip(StripLayoutHelperManager layoutHelper,
        LayerTitleCache layerTitleCache, ResourceManager resourceManager,
        StripLayoutTab[] stripLayoutTabsToRender, float yOffset, int selectedTabId) {
    if (mNativePtr == 0) return;

    final boolean visible = yOffset > -layoutHelper.getHeight();
    // This will hide the tab strips if necessary.
    nativeBeginBuildingFrame(mNativePtr, visible);
    // When strip tabs are completely off screen, we don't need to update it.
    if (visible) {
        pushButtonsAndBackground(layoutHelper, resourceManager, yOffset);
        pushStripTabs(layoutHelper, layerTitleCache, resourceManager, stripLayoutTabsToRender,
                selectedTabId);
    }
    nativeFinishBuildingFrame(mNativePtr);
}
 
Example #14
Source File: StaticTabSceneLayer.java    From 365browser with Apache License 2.0 6 votes vote down vote up
/**
 * Update {@link StaticTabSceneLayer} with the given parameters.
 *
 * @param dpToPx            The ratio of dp to px.
 * @param contentViewport   The viewport of the content.
 * @param layerTitleCache   The LayerTitleCache.
 * @param tabContentManager The TabContentManager.
 * @param fullscreenManager The FullscreenManager.
 * @param layoutTab         The LayoutTab.
 */
public void update(float dpToPx, LayerTitleCache layerTitleCache,
        TabContentManager tabContentManager, ChromeFullscreenManager fullscreenManager,
        LayoutTab layoutTab) {
    if (layoutTab == null) {
        return;
    }

    float contentOffset =
            fullscreenManager != null ? fullscreenManager.getContentOffset() : 0.f;
    float x = layoutTab.getRenderX() * dpToPx;
    float y = contentOffset + layoutTab.getRenderY() * dpToPx;

    nativeUpdateTabLayer(mNativePtr, tabContentManager, layoutTab.getId(),
            mResToolbarControlContainer, layoutTab.canUseLiveTexture(),
            layoutTab.getBackgroundColor(), x, y, layoutTab.getStaticToViewBlend(),
            layoutTab.getSaturation(), layoutTab.getBrightness());
}
 
Example #15
Source File: Layout.java    From delion with Apache License 2.0 6 votes vote down vote up
/**
 * Build a {@link SceneLayer} if it hasn't already been built, and update it and return it.
 *
 * @param viewport          A viewport in which to display content.
 * @param contentViewport   The visible section of the viewport.
 * @param layerTitleCache   A layer title cache.
 * @param tabContentManager A tab content manager.
 * @param resourceManager   A resource manager.
 * @param fullscreenManager A fullscreen manager.
 * @return                  A {@link SceneLayer} that represents the content for this
 *                          {@link Layout}.
 */
public final SceneLayer getUpdatedSceneLayer(Rect viewport, Rect contentViewport,
        LayerTitleCache layerTitleCache, TabContentManager tabContentManager,
        ResourceManager resourceManager, ChromeFullscreenManager fullscreenManager) {
    updateSceneLayer(viewport, contentViewport, layerTitleCache, tabContentManager,
            resourceManager, fullscreenManager);

    float offsetPx = fullscreenManager != null ? fullscreenManager.getControlOffset() : 0.f;
    float dpToPx = getContext().getResources().getDisplayMetrics().density;
    float offsetDp = offsetPx / dpToPx;

    SceneLayer content = getSceneLayer();
    for (int i = 0; i < mSceneOverlays.size(); i++) {
        // If the SceneOverlay is not showing, don't bother adding it to the tree.
        if (!mSceneOverlays.get(i).isSceneOverlayTreeShowing()) continue;

        SceneOverlayLayer overlayLayer = mSceneOverlays.get(i).getUpdatedSceneOverlayTree(
                layerTitleCache, resourceManager, offsetDp);

        overlayLayer.setContentTree(content);
        content = overlayLayer;
    }

    return content;
}
 
Example #16
Source File: StaticLayout.java    From delion with Apache License 2.0 6 votes vote down vote up
@Override
protected void updateSceneLayer(Rect viewport, Rect contentViewport,
        LayerTitleCache layerTitleCache, TabContentManager tabContentManager,
        ResourceManager resourceManager, ChromeFullscreenManager fullscreenManager) {
    super.updateSceneLayer(viewport, contentViewport, layerTitleCache, tabContentManager,
            resourceManager, fullscreenManager);
    assert mSceneLayer != null;

    final LayoutTab[] tabs = getLayoutTabsToRender();
    if (tabs == null || tabs.length != 1 || tabs[0].getId() == Tab.INVALID_TAB_ID) {
        return;
    }
    LayoutTab layoutTab = tabs[0];
    final float dpToPx = getContext().getResources().getDisplayMetrics().density;

    mSceneLayer.update(dpToPx, contentViewport, layerTitleCache, tabContentManager,
            fullscreenManager, layoutTab);

    // TODO(dtrainor): Find the best way to properly track this metric for cold starts.
    // We should probably erase the thumbnail when we select a tab that we need to restore.
    if (tabContentManager != null
            && tabContentManager.hasFullCachedThumbnail(layoutTab.getId())) {
        TabModelImpl.logPerceivedTabSwitchLatencyMetric();
    }
}
 
Example #17
Source File: SimpleAnimationLayout.java    From AndroidChromium with Apache License 2.0 5 votes vote down vote up
@Override
protected void updateSceneLayer(Rect viewport, Rect contentViewport,
        LayerTitleCache layerTitleCache, TabContentManager tabContentManager,
        ResourceManager resourceManager, ChromeFullscreenManager fullscreenManager) {
    super.updateSceneLayer(viewport, contentViewport, layerTitleCache, tabContentManager,
            resourceManager, fullscreenManager);
    assert mSceneLayer != null;
    mSceneLayer.pushLayers(getContext(), viewport, contentViewport, this, layerTitleCache,
            tabContentManager, resourceManager, fullscreenManager);
}
 
Example #18
Source File: LayoutManager.java    From 365browser with Apache License 2.0 5 votes vote down vote up
@Override
public SceneLayer getUpdatedActiveSceneLayer(LayerTitleCache layerTitleCache,
        TabContentManager tabContentManager, ResourceManager resourceManager,
        ChromeFullscreenManager fullscreenManager) {
    // Update the android browser controls state.
    if (fullscreenManager != null) {
        fullscreenManager.setHideBrowserControlsAndroidView(
                mActiveLayout.forceHideBrowserControlsAndroidView());
    }

    getViewportPixel(mCachedVisibleViewport);
    mHost.getWindowViewport(mCachedWindowViewport);
    return mActiveLayout.getUpdatedSceneLayer(mCachedWindowViewport, mCachedVisibleViewport,
            layerTitleCache, tabContentManager, resourceManager, fullscreenManager);
}
 
Example #19
Source File: StackLayout.java    From AndroidChromium with Apache License 2.0 5 votes vote down vote up
@Override
protected void updateSceneLayer(Rect viewport, Rect contentViewport,
        LayerTitleCache layerTitleCache, TabContentManager tabContentManager,
        ResourceManager resourceManager, ChromeFullscreenManager fullscreenManager) {
    super.updateSceneLayer(viewport, contentViewport, layerTitleCache, tabContentManager,
            resourceManager, fullscreenManager);
    assert mSceneLayer != null;
    mSceneLayer.pushLayers(getContext(), viewport, contentViewport, this, layerTitleCache,
            tabContentManager, resourceManager, fullscreenManager);
}
 
Example #20
Source File: ReaderModePanel.java    From AndroidChromium with Apache License 2.0 5 votes vote down vote up
@Override
public SceneOverlayLayer getUpdatedSceneOverlayTree(LayerTitleCache layerTitleCache,
        ResourceManager resourceManager, float yOffset) {
    mSceneLayer.update(resourceManager, this, getBarTextViewId(), mReaderBarTextOpacity);

    return mSceneLayer;
}
 
Example #21
Source File: ContextualSearchPanel.java    From AndroidChromium with Apache License 2.0 5 votes vote down vote up
@Override
public SceneOverlayLayer getUpdatedSceneOverlayTree(LayerTitleCache layerTitleCache,
        ResourceManager resourceManager, float yOffset) {
    mSceneLayer.update(resourceManager, this,
            getSearchBarControl(),
            getPeekPromoControl(),
            getPromoControl(),
            getImageControl());

    return mSceneLayer;
}
 
Example #22
Source File: StripLayoutHelperManager.java    From delion with Apache License 2.0 5 votes vote down vote up
@Override
public SceneOverlayLayer getUpdatedSceneOverlayTree(LayerTitleCache layerTitleCache,
        ResourceManager resourceManager, float yOffset) {
    assert mTabStripTreeProvider != null;

    Tab selectedTab = mTabModelSelector.getCurrentModel().getTabAt(
            mTabModelSelector.getCurrentModel().index());
    int selectedTabId = selectedTab == null ? TabModel.INVALID_TAB_INDEX : selectedTab.getId();
    mTabStripTreeProvider.pushAndUpdateStrip(this, layerTitleCache, resourceManager,
            getActiveStripLayoutHelper().getStripLayoutTabsToRender(), yOffset,
            selectedTabId);
    return mTabStripTreeProvider;
}
 
Example #23
Source File: ToolbarSceneLayer.java    From AndroidChromium with Apache License 2.0 5 votes vote down vote up
@Override
public SceneOverlayLayer getUpdatedSceneOverlayTree(LayerTitleCache layerTitleCache,
        ResourceManager resourceManager, float yOffset) {
    boolean forceHideBrowserControlsAndroidView =
            mLayoutProvider.getActiveLayout().forceHideBrowserControlsAndroidView();
    int flags = mLayoutProvider.getActiveLayout().getSizingFlags();

    update(mRenderHost.getBrowserControlsBackgroundColor(),
            mRenderHost.getBrowserControlsUrlBarAlpha(), mLayoutProvider.getFullscreenManager(),
            resourceManager, forceHideBrowserControlsAndroidView, flags,
            DeviceFormFactor.isTablet(mContext));

    return this;
}
 
Example #24
Source File: StripLayoutHelperManager.java    From 365browser with Apache License 2.0 5 votes vote down vote up
@Override
public SceneOverlayLayer getUpdatedSceneOverlayTree(RectF viewport, RectF visibleViewport,
        LayerTitleCache layerTitleCache, ResourceManager resourceManager, float yOffset) {
    assert mTabStripTreeProvider != null;

    Tab selectedTab = mTabModelSelector.getCurrentModel().getTabAt(
            mTabModelSelector.getCurrentModel().index());
    int selectedTabId = selectedTab == null ? TabModel.INVALID_TAB_INDEX : selectedTab.getId();
    mTabStripTreeProvider.pushAndUpdateStrip(this, layerTitleCache, resourceManager,
            getActiveStripLayoutHelper().getStripLayoutTabsToRender(), yOffset,
            selectedTabId);
    return mTabStripTreeProvider;
}
 
Example #25
Source File: ContextualSearchPanel.java    From 365browser with Apache License 2.0 5 votes vote down vote up
@Override
public SceneOverlayLayer getUpdatedSceneOverlayTree(RectF viewport, RectF visibleViewport,
        LayerTitleCache layerTitleCache, ResourceManager resourceManager, float yOffset) {
    mSceneLayer.update(resourceManager, this,
            getSearchBarControl(),
            getPeekPromoControl(),
            getPromoControl(),
            getImageControl());

    return mSceneLayer;
}
 
Example #26
Source File: ReaderModePanel.java    From 365browser with Apache License 2.0 5 votes vote down vote up
@Override
public SceneOverlayLayer getUpdatedSceneOverlayTree(RectF viewport, RectF visibleViewport,
        LayerTitleCache layerTitleCache, ResourceManager resourceManager, float yOffset) {
    mSceneLayer.update(resourceManager, this, getBarTextViewId(), mReaderBarTextOpacity);

    return mSceneLayer;
}
 
Example #27
Source File: StackLayout.java    From 365browser with Apache License 2.0 5 votes vote down vote up
@Override
protected void updateSceneLayer(RectF viewport, RectF contentViewport,
        LayerTitleCache layerTitleCache, TabContentManager tabContentManager,
        ResourceManager resourceManager, ChromeFullscreenManager fullscreenManager) {
    super.updateSceneLayer(viewport, contentViewport, layerTitleCache, tabContentManager,
            resourceManager, fullscreenManager);
    // If the browser controls are at the bottom make sure to use theme colors for this layout
    // specifically.
    if (fullscreenManager.areBrowserControlsAtBottom() && mLayoutTabs != null) {
        for (LayoutTab t : mLayoutTabs) t.setForceDefaultThemeColor(false);
    }
    assert mSceneLayer != null;
    mSceneLayer.pushLayers(getContext(), viewport, contentViewport, this, layerTitleCache,
            tabContentManager, resourceManager, fullscreenManager);
}
 
Example #28
Source File: SimpleAnimationLayout.java    From 365browser with Apache License 2.0 5 votes vote down vote up
@Override
protected void updateSceneLayer(RectF viewport, RectF contentViewport,
        LayerTitleCache layerTitleCache, TabContentManager tabContentManager,
        ResourceManager resourceManager, ChromeFullscreenManager fullscreenManager) {
    super.updateSceneLayer(viewport, contentViewport, layerTitleCache, tabContentManager,
            resourceManager, fullscreenManager);
    assert mSceneLayer != null;
    // The content viewport is intentionally sent as both params below.
    mSceneLayer.pushLayers(getContext(), contentViewport, contentViewport, this,
            layerTitleCache, tabContentManager, resourceManager, fullscreenManager);
}
 
Example #29
Source File: ToolbarSwipeLayout.java    From 365browser with Apache License 2.0 5 votes vote down vote up
@Override
protected void updateSceneLayer(RectF viewport, RectF contentViewport,
        LayerTitleCache layerTitleCache, TabContentManager tabContentManager,
        ResourceManager resourceManager, ChromeFullscreenManager fullscreenManager) {
    super.updateSceneLayer(viewport, contentViewport, layerTitleCache, tabContentManager,
            resourceManager, fullscreenManager);
    // Use the default theme colors if the browser controls are at the bottom.
    if (fullscreenManager.areBrowserControlsAtBottom()) {
        for (LayoutTab t : mLayoutTabs) t.setForceDefaultThemeColor(true);
    }
    assert mSceneLayer != null;
    // contentViewport is intentionally passed for both parameters below.
    mSceneLayer.pushLayers(getContext(), contentViewport, contentViewport, this,
            layerTitleCache, tabContentManager, resourceManager, fullscreenManager);
}
 
Example #30
Source File: ToolbarSwipeLayout.java    From delion with Apache License 2.0 5 votes vote down vote up
@Override
protected void updateSceneLayer(Rect viewport, Rect contentViewport,
        LayerTitleCache layerTitleCache, TabContentManager tabContentManager,
        ResourceManager resourceManager, ChromeFullscreenManager fullscreenManager) {
    super.updateSceneLayer(viewport, contentViewport, layerTitleCache, tabContentManager,
            resourceManager, fullscreenManager);
    assert mSceneLayer != null;
    mSceneLayer.pushLayers(getContext(), viewport, contentViewport, this, layerTitleCache,
            tabContentManager, resourceManager);
}