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

Unified Diff: chrome/android/java/src/org/chromium/chrome/browser/util/ColorUtils.java

Issue 1417353003: Move UrlBar background drawing to CC. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix yusofo's nit Created 5 years, 2 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/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.

Powered by Google App Engine
This is Rietveld 408576698