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

Unified Diff: chrome/android/java/src/org/chromium/chrome/browser/customtabs/CustomTabActivity.java

Issue 1216963009: Make chrome custom tab's task description color same as toolbar (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: respond to comments Created 5 years, 5 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/android/java/src/org/chromium/chrome/browser/customtabs/CustomTabActivity.java
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/customtabs/CustomTabActivity.java b/chrome/android/java/src/org/chromium/chrome/browser/customtabs/CustomTabActivity.java
index c24c181056c46a5c80c7f9d59d9c2cab753f3cd4..41e0e68a09784f7a33a628e2d18788cca11d9da3 100644
--- a/chrome/android/java/src/org/chromium/chrome/browser/customtabs/CustomTabActivity.java
+++ b/chrome/android/java/src/org/chromium/chrome/browser/customtabs/CustomTabActivity.java
@@ -127,8 +127,15 @@ public class CustomTabActivity extends ChromeActivity {
getToolbarManager().setCloseButtonIcon(mIntentDataProvider.getCloseButtonIconResId());
getToolbarManager().setShowTitle(mIntentDataProvider.getTitleVisibilityState()
== CustomTabIntentDataProvider.CUSTOM_TAB_SHOW_PAGE_TITLE);
- getToolbarManager().updatePrimaryColor(mIntentDataProvider.getToolbarColor());
- setStatusBarColor(mIntentDataProvider.getToolbarColor());
+ int toolbarColor = mIntentDataProvider.getToolbarColor();
+ getToolbarManager().updatePrimaryColor(toolbarColor);
+ if (toolbarColor != getResources().getColor(R.color.default_primary_color)) {
+ ApiCompatibilityUtils.setStatusBarColor(getWindow(),
+ BrandColorUtils.computeStatusBarColor(toolbarColor));
+ }
+
+ // Setting task title and icon to be null will preserve the client app's title and icon.
+ ApiCompatibilityUtils.setTaskDescription(this, null, null, toolbarColor);
if (mIntentDataProvider.shouldShowActionButton()) {
getToolbarManager().addCustomActionButton(mIntentDataProvider.getActionButtonIcon(),
new OnClickListener() {
@@ -227,17 +234,6 @@ public class CustomTabActivity extends ChromeActivity {
mTab.loadUrlAndTrackFromTimestamp(params, timeStamp);
}
- /**
- * Calculate the proper color for status bar and update it. Only works on L and future versions.
- */
- private void setStatusBarColor(int color) {
- // If the client did not specify the toolbar color, we do not change the status bar color.
- if (color == getResources().getColor(R.color.default_primary_color)) return;
-
- ApiCompatibilityUtils.setStatusBarColor(getWindow(),
- BrandColorUtils.computeStatusBarColor(color));
- }
-
@Override
public boolean createContextualSearchTab(ContentViewCore searchContentViewCore) {
if (mTab == null) return false;
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698