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

Unified Diff: chrome/android/java/src/org/chromium/chrome/browser/infobar/InfoBarControlLayout.java

Issue 1889643003: Permissions: Add new Infobar to support grouped permission requests on Android (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase Created 4 years, 7 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
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 d3c31651238fb1a42d5c6bbc2a70c378df385de9..49aaf9b518c8899d3986287d84d622677b112a95 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
@@ -275,15 +275,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);

Powered by Google App Engine
This is Rietveld 408576698