Index: chrome/android/java/src/org/chromium/chrome/browser/snackbar/Snackbar.java |
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/snackbar/Snackbar.java b/chrome/android/java/src/org/chromium/chrome/browser/snackbar/Snackbar.java |
index f4055dc59b2620e140843d156d996ae2a16e6661..69f0285f9070c367ec7b25cbf017fb600211c9f7 100644 |
--- a/chrome/android/java/src/org/chromium/chrome/browser/snackbar/Snackbar.java |
+++ b/chrome/android/java/src/org/chromium/chrome/browser/snackbar/Snackbar.java |
@@ -4,6 +4,8 @@ |
package org.chromium.chrome.browser.snackbar; |
+import android.graphics.Bitmap; |
+ |
import org.chromium.chrome.browser.snackbar.SnackbarManager.SnackbarController; |
/** |
@@ -26,6 +28,7 @@ public class Snackbar { |
private int mBackgroundColor; |
private boolean mSingleLine = true; |
private int mDurationMs; |
+ private Bitmap mProfileImage; |
// Prevent instantiation. |
private Snackbar() {} |
@@ -65,6 +68,16 @@ public class Snackbar { |
} |
/** |
+ * Sets the identity profileImage (profile image) which should be displayed in the snackbar. |
+ * If null, snackbar will have no profileImage. Ability to have an icon is specific to the |
+ * identity snackbars and should be used only there. |
+ */ |
+ public Snackbar setProfileImage(Bitmap profileImage) { |
+ mProfileImage = profileImage; |
+ return this; |
+ } |
+ |
+ /** |
* Sets whether the snackbar text should be limited to a single line and ellipsized if needed. |
*/ |
public Snackbar setSingleLine(boolean singleLine) { |
@@ -123,4 +136,11 @@ public class Snackbar { |
int getBackgroundColor() { |
return mBackgroundColor; |
} |
+ |
+ /** |
+ * If method returns null, then no profileImage will be shown in snackbar. |
+ */ |
+ Bitmap getProfileImage() { |
+ return mProfileImage; |
+ } |
} |