Index: chrome/android/java/src/org/chromium/chrome/browser/util/ColorUtils.java |
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/util/ColorUtils.java b/chrome/android/java/src/org/chromium/chrome/browser/util/ColorUtils.java |
index 0057cea92b35677aa0a2ef24c68b857af2789a44..9a21d9e87bb7cff46f2d1a6000aeae88b6b3d262 100644 |
--- a/chrome/android/java/src/org/chromium/chrome/browser/util/ColorUtils.java |
+++ b/chrome/android/java/src/org/chromium/chrome/browser/util/ColorUtils.java |
@@ -6,6 +6,9 @@ package org.chromium.chrome.browser.util; |
import android.graphics.Color; |
+import org.chromium.chrome.browser.ntp.NewTabPage; |
+import org.chromium.chrome.browser.tab.Tab; |
+ |
/** |
* Helper functions for working with colors. |
*/ |
@@ -54,6 +57,18 @@ public class ColorUtils { |
} |
/** |
+ * @return Alpha for the textbox given a Tab. |
+ */ |
+ public static float getTextBoxAlphaForToolbarBackground(Tab tab) { |
+ int color = tab.getThemeColor(); |
+ if (tab.getNativePage() instanceof NewTabPage) { |
+ if (((NewTabPage) tab.getNativePage()).isLocationBarShownInNTP()) return 0f; |
+ } |
+ return shouldUseOpaqueTextboxBackground(color) |
+ ? 1f : LOCATION_BAR_TRANSPARENT_BACKGROUND_ALPHA; |
+ } |
+ |
+ /** |
* Gets the background color for light theme progress bar. |
* @param toolbarColor The color of the toolbar. |
* @return The color of the progress bar in light theme, given the toolbar color. |