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

Unified Diff: chrome/android/java/src/org/chromium/chrome/browser/media/ui/MediaNotificationInfo.java

Issue 1847063005: [Media, UI] Change MediaNotification style to MediaStyle (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fixed nits Created 4 years, 8 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/media/ui/MediaNotificationInfo.java
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/media/ui/MediaNotificationInfo.java b/chrome/android/java/src/org/chromium/chrome/browser/media/ui/MediaNotificationInfo.java
index 750cd593dc7f1748f44e0c3998b4a54dd6814a59..32cc7bd0ec5d26b43fc368894fc84f8b862cbd3a 100644
--- a/chrome/android/java/src/org/chromium/chrome/browser/media/ui/MediaNotificationInfo.java
+++ b/chrome/android/java/src/org/chromium/chrome/browser/media/ui/MediaNotificationInfo.java
@@ -49,10 +49,10 @@ public class MediaNotificationInfo {
private int mTabId = Tab.INVALID_TAB_ID;
private boolean mIsPrivate = true;
private int mIcon = -1;
+ private Bitmap mLargeIcon = null;
private int mActions = ACTION_PLAY_PAUSE | ACTION_SWIPEAWAY;
private int mId = INVALID_ID;
private Intent mContentIntent = null;
- private Bitmap mImage = null;
private MediaNotificationListener mListener = null;
/**
@@ -73,9 +73,9 @@ public class MediaNotificationInfo {
mTabId,
mIsPrivate,
mIcon,
+ mLargeIcon,
mActions,
mId,
- mImage,
mContentIntent,
mListener);
}
@@ -110,6 +110,11 @@ public class MediaNotificationInfo {
return this;
}
+ public Builder setLargeIcon(Bitmap icon) {
+ mLargeIcon = icon;
+ return this;
+ }
+
public Builder setActions(int actions) {
mActions = actions;
return this;
@@ -120,11 +125,6 @@ public class MediaNotificationInfo {
return this;
}
- public Builder setImage(Bitmap image) {
- mImage = image;
- return this;
- }
-
public Builder setContentIntent(Intent intent) {
mContentIntent = intent;
return this;
@@ -172,14 +172,14 @@ public class MediaNotificationInfo {
public final int icon;
/**
- * The id to use for the notification itself.
+ * The Bitmap resource used for a large icon.
*/
- public final int id;
+ public final Bitmap largeIcon;
/**
- * The bitmap of the image, if any.
+ * The id to use for the notification itself.
*/
- public final Bitmap image;
+ public final int id;
/**
* The intent to send when the notification is selected.
@@ -219,7 +219,6 @@ public class MediaNotificationInfo {
* @param origin The origin of the tab containing the media.
* @param tabId The id of the tab containing the media.
* @param isPrivate Whether the media notification should be considered as private.
- * @param image An image associated with the media, displayed in icons etc..
* @param contentIntent the intent to send when the notification is selected.
* @param listener The listener for the control events.
*/
@@ -230,9 +229,9 @@ public class MediaNotificationInfo {
int tabId,
boolean isPrivate,
int icon,
+ Bitmap largeIcon,
int actions,
int id,
- Bitmap image,
Intent contentIntent,
MediaNotificationListener listener) {
this.metadata = metadata;
@@ -241,10 +240,10 @@ public class MediaNotificationInfo {
this.tabId = tabId;
this.isPrivate = isPrivate;
this.icon = icon;
+ this.largeIcon = largeIcon;
this.mActions = actions;
this.id = id;
this.contentIntent = contentIntent;
- this.image = image;
this.listener = listener;
}
@@ -258,12 +257,13 @@ public class MediaNotificationInfo {
&& isPrivate == other.isPrivate
&& tabId == other.tabId
&& icon == other.icon
+ && (largeIcon == other.largeIcon
+ || (largeIcon != null && largeIcon.sameAs(other.largeIcon)))
&& mActions == other.mActions
&& id == other.id
&& (metadata == other.metadata
|| (metadata != null && metadata.equals(other.metadata)))
&& TextUtils.equals(origin, other.origin)
- && (image == other.image || (image != null && image.sameAs(other.image)))
&& (contentIntent == other.contentIntent
|| (contentIntent != null && contentIntent.equals(other.contentIntent)))
&& (listener == other.listener
@@ -276,10 +276,10 @@ public class MediaNotificationInfo {
result = 31 * result + (isPrivate ? 1 : 0);
result = 31 * result + (metadata == null ? 0 : metadata.hashCode());
result = 31 * result + (origin == null ? 0 : origin.hashCode());
- result = 31 * result + (image == null ? 0 : image.hashCode());
result = 31 * result + (contentIntent == null ? 0 : contentIntent.hashCode());
result = 31 * result + tabId;
result = 31 * result + icon;
+ result = 31 * result + (largeIcon == null ? 0 : largeIcon.hashCode());
result = 31 * result + mActions;
result = 31 * result + id;
result = 31 * result + listener.hashCode();

Powered by Google App Engine
This is Rietveld 408576698