Commit e8967cdb authored by Matthew Jones's avatar Matthew Jones Committed by Commit Bot

Remove obsolete theme color method from LayoutTab

Theme colors will be enabled for Chrome modern design, so there is no
need to force the default theme color in LayoutTab.

BUG=803098

Change-Id: Iab41c5f7ba8250a3dd2a62433392428f305efca4
Reviewed-on: https://chromium-review.googlesource.com/894694
Commit-Queue: Matthew Jones <mdjones@chromium.org>
Reviewed-by: default avatarTheresa <twellington@chromium.org>
Cr-Commit-Position: refs/heads/master@{#533326}
parent d1e3241f
...@@ -363,10 +363,6 @@ public class ToolbarSwipeLayout extends Layout { ...@@ -363,10 +363,6 @@ public class ToolbarSwipeLayout extends Layout {
ResourceManager resourceManager, ChromeFullscreenManager fullscreenManager) { ResourceManager resourceManager, ChromeFullscreenManager fullscreenManager) {
super.updateSceneLayer(viewport, contentViewport, layerTitleCache, tabContentManager, super.updateSceneLayer(viewport, contentViewport, layerTitleCache, tabContentManager,
resourceManager, fullscreenManager); 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; assert mSceneLayer != null;
// contentViewport is intentionally passed for both parameters below. // contentViewport is intentionally passed for both parameters below.
mSceneLayer.pushLayers(getContext(), contentViewport, contentViewport, this, mSceneLayer.pushLayers(getContext(), contentViewport, contentViewport, this,
......
...@@ -101,7 +101,6 @@ public class LayoutTab implements ChromeAnimation.Animatable<LayoutTab.Property> ...@@ -101,7 +101,6 @@ public class LayoutTab implements ChromeAnimation.Animatable<LayoutTab.Property>
private boolean mInsetBorderVertical; private boolean mInsetBorderVertical;
private float mToolbarYOffset; private float mToolbarYOffset;
private float mSideBorderScale; private float mSideBorderScale;
private boolean mForceDefaultThemeColor;
private final RectF mBounds = new RectF(); // Pre-allocated to avoid in-frame allocations. private final RectF mBounds = new RectF(); // Pre-allocated to avoid in-frame allocations.
private final RectF mClosePlacement = new RectF(); private final RectF mClosePlacement = new RectF();
...@@ -275,21 +274,6 @@ public class LayoutTab implements ChromeAnimation.Animatable<LayoutTab.Property> ...@@ -275,21 +274,6 @@ public class LayoutTab implements ChromeAnimation.Animatable<LayoutTab.Property>
return !mInitFromHostCalled; return !mInitFromHostCalled;
} }
/**
* @return Whether or not the object rendering this LayoutTab should force default theme colors.
*/
public boolean getForceDefaultThemeColor() {
return mForceDefaultThemeColor;
}
/**
* @param force Whether or not the object rendering this LayoutTab should force default theme
* colors.
*/
public void setForceDefaultThemeColor(boolean force) {
mForceDefaultThemeColor = force;
}
/** /**
* Helper function that gather the static constants from values/dimens.xml. * Helper function that gather the static constants from values/dimens.xml.
* *
......
...@@ -1330,11 +1330,6 @@ public class StackLayout extends Layout implements Animatable<StackLayout.Proper ...@@ -1330,11 +1330,6 @@ public class StackLayout extends Layout implements Animatable<StackLayout.Proper
ResourceManager resourceManager, ChromeFullscreenManager fullscreenManager) { ResourceManager resourceManager, ChromeFullscreenManager fullscreenManager) {
super.updateSceneLayer(viewport, contentViewport, layerTitleCache, tabContentManager, super.updateSceneLayer(viewport, contentViewport, layerTitleCache, tabContentManager,
resourceManager, fullscreenManager); 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; assert mSceneLayer != null;
mSceneLayer.pushLayers(getContext(), viewport, contentViewport, this, layerTitleCache, mSceneLayer.pushLayers(getContext(), viewport, contentViewport, this, layerTitleCache,
......
...@@ -76,17 +76,10 @@ public class TabListSceneLayer extends SceneLayer { ...@@ -76,17 +76,10 @@ public class TabListSceneLayer extends SceneLayer {
int toolbarBackgroundColor = getTabThemeColor(context, t); int toolbarBackgroundColor = getTabThemeColor(context, t);
int textBoxBackgroundColor = t.getTextBoxBackgroundColor(); int textBoxBackgroundColor = t.getTextBoxBackgroundColor();
float textBoxAlpha = t.getTextBoxAlpha();
if (t.getForceDefaultThemeColor()) {
toolbarBackgroundColor = defaultThemeColor;
textBoxBackgroundColor = ColorUtils.getTextBoxColorForToolbarBackground(
res, false, toolbarBackgroundColor, useModernDesign);
textBoxAlpha = t.isIncognito() ? textBoxAlpha : 1f;
}
// In the modern design, the text box is always drawn in the Java layer rather // In the modern design, the text box is always drawn in the Java layer rather
// than the compositor layer. // than the compositor layer.
if (useModernDesign) textBoxAlpha = 0.f; float textBoxAlpha = useModernDesign ? 0.f : t.getTextBoxAlpha();
int closeButtonColor = int closeButtonColor =
ColorUtils.getThemedAssetColor(toolbarBackgroundColor, t.isIncognito()); ColorUtils.getThemedAssetColor(toolbarBackgroundColor, t.isIncognito());
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment