Index: chrome/android/java/src/org/chromium/chrome/browser/toolbar/CustomTabToolbar.java |
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/toolbar/CustomTabToolbar.java b/chrome/android/java/src/org/chromium/chrome/browser/toolbar/CustomTabToolbar.java |
index 13394f0a741e18645378e8fb714d884644918ad4..e5783f51b4315bd0a4868c1f28a26f06a20a7c53 100644 |
--- a/chrome/android/java/src/org/chromium/chrome/browser/toolbar/CustomTabToolbar.java |
+++ b/chrome/android/java/src/org/chromium/chrome/browser/toolbar/CustomTabToolbar.java |
@@ -134,7 +134,7 @@ public class CustomTabToolbar extends ToolbarLayout implements LocationBar, |
} |
@Override |
- public void addCustomActionButton(Drawable drawable, String description, |
+ public void setCustomActionButton(Drawable drawable, String description, |
OnClickListener listener) { |
Resources resources = getResources(); |
@@ -155,6 +155,7 @@ public class CustomTabToolbar extends ToolbarLayout implements LocationBar, |
mCustomActionButton.setContentDescription(description); |
mCustomActionButton.setOnClickListener(listener); |
mCustomActionButton.setVisibility(VISIBLE); |
+ updateButtonsTint(); |
} |
/** |
@@ -275,15 +276,7 @@ public class CustomTabToolbar extends ToolbarLayout implements LocationBar, |
public void updateVisualsForState() { |
Resources resources = getResources(); |
updateSecurityIcon(getSecurityLevel()); |
- ColorStateList colorStateList = ApiCompatibilityUtils.getColorStateList(resources, |
- mUseDarkColors ? R.color.dark_mode_tint : R.color.light_mode_tint); |
- mMenuButton.setTint(colorStateList); |
- if (mCloseButton.getDrawable() instanceof TintedDrawable) { |
- ((TintedDrawable) mCloseButton.getDrawable()).setTint(colorStateList); |
- } |
- if (mCustomActionButton.getDrawable() instanceof TintedDrawable) { |
- ((TintedDrawable) mCustomActionButton.getDrawable()).setTint(colorStateList); |
- } |
+ updateButtonsTint(); |
mUrlBar.setUseDarkTextColors(mUseDarkColors); |
int titleTextColor = mUseDarkColors |
@@ -300,6 +293,19 @@ public class CustomTabToolbar extends ToolbarLayout implements LocationBar, |
} |
} |
+ private void updateButtonsTint() { |
+ Resources resources = getResources(); |
+ ColorStateList colorStateList = ApiCompatibilityUtils.getColorStateList(resources, |
+ mUseDarkColors ? R.color.dark_mode_tint : R.color.light_mode_tint); |
+ mMenuButton.setTint(colorStateList); |
+ if (mCloseButton.getDrawable() instanceof TintedDrawable) { |
+ ((TintedDrawable) mCloseButton.getDrawable()).setTint(colorStateList); |
+ } |
+ if (mCustomActionButton.getDrawable() instanceof TintedDrawable) { |
+ ((TintedDrawable) mCustomActionButton.getDrawable()).setTint(colorStateList); |
+ } |
+ } |
+ |
@Override |
public void setMenuButtonHelper(final AppMenuButtonHelper helper) { |
mMenuButton.setOnTouchListener(new OnTouchListener() { |