Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(679)

Unified Diff: chrome/android/java/src/org/chromium/chrome/browser/toolbar/BottomToolbarPhone.java

Issue 2862113003: [Home] Disable theme colors in toolbar (Closed)
Patch Set: jk Created 3 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/android/java/src/org/chromium/chrome/browser/toolbar/BottomToolbarPhone.java
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/toolbar/BottomToolbarPhone.java b/chrome/android/java/src/org/chromium/chrome/browser/toolbar/BottomToolbarPhone.java
index 4d58b5301b95d05e4f26aa57b2bc1c518dff682f..0b2544572cc6195cbff4f63c0c4c1451f45b3d01 100644
--- a/chrome/android/java/src/org/chromium/chrome/browser/toolbar/BottomToolbarPhone.java
+++ b/chrome/android/java/src/org/chromium/chrome/browser/toolbar/BottomToolbarPhone.java
@@ -153,6 +153,17 @@ public class BottomToolbarPhone extends ToolbarPhone {
}
@Override
+ protected int getProgressBarColor() {
+ int color = super.getProgressBarColor();
+ if (getToolbarDataProvider().getTab() != null) {
+ // ToolbarDataProvider itself accounts for Chrome Home and will return default colors,
+ // so pull the progress bar color from the tab.
+ color = getToolbarDataProvider().getTab().getThemeColor();
+ }
+ return color;
+ }
+
+ @Override
protected int getProgressBarTopMargin() {
// In the case where the toolbar is at the bottom of the screen, the progress bar should
// be at the top of the screen.
@@ -332,6 +343,8 @@ public class BottomToolbarPhone extends ToolbarPhone {
protected void updateVisualsForToolbarState() {
super.updateVisualsForToolbarState();
+ getProgressBar().setThemeColor(getProgressBarColor(), isIncognito());
+
// TODO(mdjones): Creating a new tab from the tab switcher skips the
// drawTabSwitcherFadeAnimation which would otherwise make this line unnecessary.
if (mTabSwitcherState == STATIC_TAB && mUseToolbarHandle) mToolbarHandleView.setAlpha(1f);

Powered by Google App Engine
This is Rietveld 408576698