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

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

Issue 1958233002: Reland of Update NTP to new material design spec. (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
new file mode 100644
index 0000000000000000000000000000000000000000..4d9a005acfc8041b95ceb8a156c908f646a1fac0
--- /dev/null
+++ b/chrome/android/java/src/org/chromium/chrome/browser/ntp/NtpColorUtils.java
@@ -0,0 +1,27 @@
+// Copyright 2016 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+package org.chromium.chrome.browser.ntp;
+
+import android.content.res.Resources;
+
+import org.chromium.base.ApiCompatibilityUtils;
+import org.chromium.chrome.R;
+import org.chromium.chrome.browser.ChromeFeatureList;
+
+/**
+ * Utility class for figuring out which colors to use for the NTP. This class is needed while we
+ * transition the NTP to the new material design spec.
+ */
+public class NtpColorUtils {
+
+ private NtpColorUtils() {}
+
+ public static int getBackgroundColorResource(Resources res) {
+ return (ChromeFeatureList.isEnabled(ChromeFeatureList.NTP_SNIPPETS)
+ || ChromeFeatureList.isEnabled(ChromeFeatureList.NTP_MATERIAL_DESIGN))
+ ? ApiCompatibilityUtils.getColor(res, R.color.ntp_material_design_bg)
+ : ApiCompatibilityUtils.getColor(res, R.color.ntp_bg);
+ }
+}

Powered by Google App Engine
This is Rietveld 408576698