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

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

Issue 2088933002: Force standard progress bar colors if native page (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Force standard progress bar colors if native page Created 4 years, 6 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/android/java/src/org/chromium/chrome/browser/toolbar/ToolbarPhone.java
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/toolbar/ToolbarPhone.java b/chrome/android/java/src/org/chromium/chrome/browser/toolbar/ToolbarPhone.java
index 4d539579922014188c6d820d477203c9e9b1591e..0f84346ef069c69f3a5887843796bd088a1cf2f1 100644
--- a/chrome/android/java/src/org/chromium/chrome/browser/toolbar/ToolbarPhone.java
+++ b/chrome/android/java/src/org/chromium/chrome/browser/toolbar/ToolbarPhone.java
@@ -1987,6 +1987,14 @@ public class ToolbarPhone extends ToolbarLayout
boolean visualStateChanged = mVisualState != newVisualState;
int currentPrimaryColor = getToolbarDataProvider().getPrimaryColor();
+ int themeColorForProgressBar = currentPrimaryColor;
+
+ // If The page is native force the use of the standard theme for the progress bar.
+ if (getToolbarDataProvider() != null && getToolbarDataProvider().getTab() != null
+ && getToolbarDataProvider().getTab().isNativePage()) {
+ themeColorForProgressBar = getToolbarColorForVisualState(VisualState.NORMAL);
Ted C 2016/06/24 16:19:06 What happens if you're on the incognito ntp?
mdjones 2016/06/24 17:05:28 The incognito flag is still passed into the functi
Ted C 2016/06/24 17:35:43 Acknowledged.
+ }
+
if (mVisualState == VisualState.BRAND_COLOR && !visualStateChanged) {
boolean useLightToolbarDrawables =
ColorUtils.shouldUseLightForegroundOnBackground(currentPrimaryColor);
@@ -1998,7 +2006,7 @@ public class ToolbarPhone extends ToolbarLayout
visualStateChanged = true;
} else {
updateToolbarBackground(VisualState.BRAND_COLOR);
- getProgressBar().setThemeColor(currentPrimaryColor, isIncognito());
+ getProgressBar().setThemeColor(themeColorForProgressBar, isIncognito());
}
}
@@ -2018,7 +2026,7 @@ public class ToolbarPhone extends ToolbarLayout
mUnfocusedLocationBarUsesTransparentBg = false;
mUrlBackgroundAlpha = 255;
updateToolbarBackground(mVisualState);
- getProgressBar().setThemeColor(currentPrimaryColor, isIncognito());
+ getProgressBar().setThemeColor(themeColorForProgressBar, isIncognito());
if (isInTabSwitcherMode) {
mUseLightToolbarDrawables = true;
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698