Index: chrome/android/java/src/org/chromium/chrome/browser/infobar/InfoBarControlLayout.java |
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/infobar/InfoBarControlLayout.java b/chrome/android/java/src/org/chromium/chrome/browser/infobar/InfoBarControlLayout.java |
index a82736ee06632e3c065dac2de45d07490c524a06..c1554186274c1227a6f5446d10cff1da91d69518 100644 |
--- a/chrome/android/java/src/org/chromium/chrome/browser/infobar/InfoBarControlLayout.java |
+++ b/chrome/android/java/src/org/chromium/chrome/browser/infobar/InfoBarControlLayout.java |
@@ -274,15 +274,19 @@ public final class InfoBarControlLayout extends ViewGroup { |
* @param iconResourceId ID of the drawable to use for the icon. |
* @param primaryMessage Message to display for the toggle. |
* @param secondaryMessage Additional descriptive text for the toggle. May be null. |
+ * @param iconColorId ID of the tint color for the icon, or 0 for default. |
*/ |
- public View addIcon( |
- int iconResourceId, CharSequence primaryMessage, CharSequence secondaryMessage) { |
+ public View addIcon(int iconResourceId, CharSequence primaryMessage, |
+ CharSequence secondaryMessage, int iconColorId) { |
LinearLayout layout = (LinearLayout) LayoutInflater.from(getContext()).inflate( |
R.layout.infobar_control_icon_with_description, this, false); |
addView(layout, new ControlLayoutParams()); |
ImageView iconView = (ImageView) layout.findViewById(R.id.control_icon); |
iconView.setImageResource(iconResourceId); |
+ if (iconColorId != 0) { |
+ iconView.setColorFilter(ApiCompatibilityUtils.getColor(getResources(), iconColorId)); |
+ } |
// The primary message text is always displayed. |
TextView primaryView = (TextView) layout.findViewById(R.id.control_message); |