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

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

Issue 889613003: Add support for passing bitmaps to Android infobars (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Comments Created 5 years, 11 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/InfoBar.java
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/infobar/InfoBar.java b/chrome/android/java/src/org/chromium/chrome/browser/infobar/InfoBar.java
index 36f4aad81109d2ea261e4391e4f5db214c19991c..be4d3d35ea24ef70c7dc9b9c95d74c3d93f6671d 100644
--- a/chrome/android/java/src/org/chromium/chrome/browser/infobar/InfoBar.java
+++ b/chrome/android/java/src/org/chromium/chrome/browser/infobar/InfoBar.java
@@ -5,6 +5,7 @@
package org.chromium.chrome.browser.infobar;
import android.content.Context;
+import android.graphics.Bitmap;
import android.view.View;
import org.chromium.base.CalledByNative;
@@ -36,6 +37,7 @@ public abstract class InfoBar implements InfoBarView {
public static final int ACTION_TYPE_TRANSLATE_SHOW_ORIGINAL = 4;
private final int mIconDrawableId;
+ private final Bitmap mIconBitmap;
private final CharSequence mMessage;
private InfoBarListeners.Dismiss mListener;
@@ -64,10 +66,12 @@ public abstract class InfoBar implements InfoBarView {
* @param iconDrawableId ID of the resource to use for the Icon. If 0, no icon will be shown.
* @param message The message to show in the infobar.
*/
- public InfoBar(InfoBarListeners.Dismiss listener, int iconDrawableId, CharSequence message) {
+ public InfoBar(InfoBarListeners.Dismiss listener, int iconDrawableId, Bitmap iconBitmap,
+ CharSequence message) {
mListener = listener;
mId = generateId();
mIconDrawableId = iconDrawableId;
+ mIconBitmap = iconBitmap;
mMessage = message;
mExpireOnNavigation = true;
}
@@ -145,7 +149,8 @@ public abstract class InfoBar implements InfoBarView {
protected final View createView() {
assert mContext != null;
- InfoBarLayout layout = new InfoBarLayout(mContext, this, mIconDrawableId, mMessage);
+ InfoBarLayout layout =
+ new InfoBarLayout(mContext, this, mIconDrawableId, mIconBitmap, mMessage);
createContent(layout);
return layout;
}

Powered by Google App Engine
This is Rietveld 408576698