| 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;
|
|
|