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

Unified Diff: chrome/android/java/src/org/chromium/chrome/browser/ntp/NtpColorUtils.java

Issue 1969403008: Fix background color for incognito tabs when material design is enabled (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 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/ntp/NtpColorUtils.java
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/ntp/NtpColorUtils.java b/chrome/android/java/src/org/chromium/chrome/browser/ntp/NtpColorUtils.java
index 4d9a005acfc8041b95ceb8a156c908f646a1fac0..f96353689ffaa020b85d4b34f16f96b8d4ead669 100644
--- a/chrome/android/java/src/org/chromium/chrome/browser/ntp/NtpColorUtils.java
+++ b/chrome/android/java/src/org/chromium/chrome/browser/ntp/NtpColorUtils.java
@@ -18,10 +18,24 @@ public class NtpColorUtils {
private NtpColorUtils() {}
- public static int getBackgroundColorResource(Resources res) {
- return (ChromeFeatureList.isEnabled(ChromeFeatureList.NTP_SNIPPETS)
- || ChromeFeatureList.isEnabled(ChromeFeatureList.NTP_MATERIAL_DESIGN))
+ public static int getBackgroundColorResource(Resources res, boolean isIncognito) {
+ if (isIncognito) {
+ return ApiCompatibilityUtils.getColor(res, R.color.ntp_bg_incognito);
+ }
+
+ return shouldUseMaterialColors()
? ApiCompatibilityUtils.getColor(res, R.color.ntp_material_design_bg)
: ApiCompatibilityUtils.getColor(res, R.color.ntp_bg);
}
+
+ public static int getToolbarBackgroundColorResource(Resources res) {
+ return shouldUseMaterialColors()
+ ? ApiCompatibilityUtils.getColor(res, R.color.ntp_material_design_bg)
+ : ApiCompatibilityUtils.getColor(res, R.color.ntp_bg);
+ }
+
+ private static boolean shouldUseMaterialColors() {
+ return ChromeFeatureList.isEnabled(ChromeFeatureList.NTP_SNIPPETS)
+ || ChromeFeatureList.isEnabled(ChromeFeatureList.NTP_MATERIAL_DESIGN);
+ }
}

Powered by Google App Engine
This is Rietveld 408576698