Commit b2e5b444 authored by xingliu's avatar xingliu Committed by Commit bot

Add theme color for Blimp on Android.

Use Material Design color Light Blue 100 for a Blimp tab.
See https://material.google.com/style/color.html for details.

BUG=64425

Review-Url: https://codereview.chromium.org/2315953002
Cr-Commit-Position: refs/heads/master@{#417079}
parent cce31dd8
...@@ -25,6 +25,9 @@ public class BlimpContentsImpl implements BlimpContents { ...@@ -25,6 +25,9 @@ public class BlimpContentsImpl implements BlimpContents {
nativeBlimpContentsImplAndroid, navigationController, blimpView); nativeBlimpContentsImplAndroid, navigationController, blimpView);
} }
// Light blue theme color on Blimp tab.
private static final int BLIMP_THEME_COLOR = 0xb3e5fc;
private long mNativeBlimpContentsImplAndroid; private long mNativeBlimpContentsImplAndroid;
// Given the importance of the navigation controller, this member is kept directly in Java to // Given the importance of the navigation controller, this member is kept directly in Java to
...@@ -72,6 +75,13 @@ public class BlimpContentsImpl implements BlimpContents { ...@@ -72,6 +75,13 @@ public class BlimpContentsImpl implements BlimpContents {
return mBlimpNavigationController; return mBlimpNavigationController;
} }
// TODO(xingliu): Use the correct theme color for Blimp.
// crbug.com/644774
@Override
public int getThemeColor() {
return BLIMP_THEME_COLOR;
}
@Override @Override
public void addObserver(BlimpContentsObserver observer) { public void addObserver(BlimpContentsObserver observer) {
assert mNativeBlimpContentsImplAndroid != 0; assert mNativeBlimpContentsImplAndroid != 0;
......
...@@ -20,6 +20,11 @@ public interface BlimpContents { ...@@ -20,6 +20,11 @@ public interface BlimpContents {
*/ */
BlimpNavigationController getNavigationController(); BlimpNavigationController getNavigationController();
/**
* Returns the theme color for Blimp tab.
*/
int getThemeColor();
/** /**
* Adds an observer to this BlimpContents. * Adds an observer to this BlimpContents.
*/ */
......
...@@ -1114,6 +1114,12 @@ public class Tab implements ViewGroup.OnHierarchyChangeListener, ...@@ -1114,6 +1114,12 @@ public class Tab implements ViewGroup.OnHierarchyChangeListener,
if (themeColor != 0 && !ColorUtils.isValidThemeColor(themeColor)) themeColor = 0; if (themeColor != 0 && !ColorUtils.isValidThemeColor(themeColor)) themeColor = 0;
} }
// Apply theme color for Blimp tab.
if (isBlimpTab() && getBlimpContents() != null) {
themeColor = getBlimpContents().getThemeColor();
if (themeColor != 0 && !ColorUtils.isValidThemeColor(themeColor)) themeColor = 0;
}
// Do not apply the theme color if there are any security issues on the page. // Do not apply the theme color if there are any security issues on the page.
int securityLevel = getSecurityLevel(); int securityLevel = getSecurityLevel();
if (securityLevel == ConnectionSecurityLevel.SECURITY_ERROR if (securityLevel == ConnectionSecurityLevel.SECURITY_ERROR
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment