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

Unified Diff: base/android/java/src/org/chromium/base/ApiCompatibilityUtils.java

Issue 1141793003: Update from https://crrev.com/329939 (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 5 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
« no previous file with comments | « base/android/build_info.cc ('k') | base/android/java/src/org/chromium/base/PathUtils.java » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/android/java/src/org/chromium/base/ApiCompatibilityUtils.java
diff --git a/base/android/java/src/org/chromium/base/ApiCompatibilityUtils.java b/base/android/java/src/org/chromium/base/ApiCompatibilityUtils.java
index 3df7b923a322265079b550209763384cdc168988..76d73967d49c891b45f4552ea388c0c86cf9f5d4 100644
--- a/base/android/java/src/org/chromium/base/ApiCompatibilityUtils.java
+++ b/base/android/java/src/org/chromium/base/ApiCompatibilityUtils.java
@@ -349,6 +349,7 @@ public class ApiCompatibilityUtils {
/**
* @see android.view.Window#setStatusBarColor(int color).
+ * TODO(ianwen): remove this method after downstream rolling.
*/
public static void setStatusBarColor(Activity activity, int statusBarColor) {
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
@@ -365,6 +366,22 @@ public class ApiCompatibilityUtils {
}
/**
+ * @see android.view.Window#setStatusBarColor(int color).
+ */
+ public static void setStatusBarColor(Window window, int statusBarColor) {
+ if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
+ // If both system bars are black, we can remove these from our layout,
+ // removing or shrinking the SurfaceFlinger overlay required for our views.
+ if (statusBarColor == Color.BLACK && window.getNavigationBarColor() == Color.BLACK) {
+ window.clearFlags(WindowManager.LayoutParams.FLAG_DRAWS_SYSTEM_BAR_BACKGROUNDS);
+ } else {
+ window.addFlags(WindowManager.LayoutParams.FLAG_DRAWS_SYSTEM_BAR_BACKGROUNDS);
+ }
+ window.setStatusBarColor(statusBarColor);
+ }
+ }
+
+ /**
* @see android.content.res.Resources#getDrawable(int id).
*/
@SuppressWarnings("deprecation")
« no previous file with comments | « base/android/build_info.cc ('k') | base/android/java/src/org/chromium/base/PathUtils.java » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698