Chromium Code Reviews| 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 ad1a7b24aea3328ae64475b679f116ed96849f6b..7d19ac6aaa8b59998757a935f6f677b56892fb11 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 |
| @@ -9,6 +9,7 @@ import android.graphics.Bitmap; |
| import android.text.TextUtils; |
| import org.chromium.chrome.browser.tab.Tab; |
| +import org.chromium.content_public.common.MediaMetadata; |
| /** |
| * Exposes information about the current media notification to the external clients. |
| @@ -42,7 +43,7 @@ public class MediaNotificationInfo { |
| */ |
| public static final class Builder { |
| - private String mTitle = ""; |
| + private MediaMetadata mMetadata = null; |
|
Ted C
2016/03/01 17:18:11
null is the default for objects, false for boolean
mlamouri (slow - plz ping)
2016/03/16 15:47:15
Done. Though, for the record, I don't like implici
Ted C
2016/03/16 16:55:58
I never accept the behavior of C++ as a reason to
|
| private boolean mIsPaused = false; |
| private String mOrigin = ""; |
| private int mTabId = Tab.INVALID_TAB_ID; |
| @@ -61,13 +62,13 @@ public class MediaNotificationInfo { |
| } |
| public MediaNotificationInfo build() { |
| - assert mTitle != null; |
| + assert mMetadata != null; |
| assert mOrigin != null; |
| assert mListener != null; |
| assert mContentIntent != null; |
| return new MediaNotificationInfo( |
| - mTitle, |
| + mMetadata, |
| mIsPaused, |
| mOrigin, |
| mTabId, |
| @@ -80,8 +81,8 @@ public class MediaNotificationInfo { |
| mListener); |
| } |
| - public Builder setTitle(String title) { |
| - mTitle = title; |
| + public Builder setMetadata(MediaMetadata metadata) { |
| + mMetadata = metadata; |
| return this; |
| } |
| @@ -142,9 +143,9 @@ public class MediaNotificationInfo { |
| private final int mActions; |
| /** |
| - * The title of the media. |
| + * The metadata associated with the media. |
| */ |
| - public final String title; |
| + public final MediaMetadata metadata; |
| /** |
| * The current state of the media, paused or not. |
| @@ -214,7 +215,7 @@ public class MediaNotificationInfo { |
| /** |
| * Create a new MediaNotificationInfo. |
| - * @param title The title of the media. |
| + * @param metadata The metadata associated with the media. |
| * @param isPaused The current state of the media, paused or not. |
| * @param origin The origin of the tab containing the media. |
| * @param tabId The id of the tab containing the media. |
| @@ -224,7 +225,7 @@ public class MediaNotificationInfo { |
| * @param listener The listener for the control events. |
| */ |
| private MediaNotificationInfo( |
| - String title, |
| + MediaMetadata metadata, |
| boolean isPaused, |
| String origin, |
| int tabId, |
| @@ -235,7 +236,7 @@ public class MediaNotificationInfo { |
| Bitmap image, |
| Intent contentIntent, |
| MediaNotificationListener listener) { |
| - this.title = title; |
| + this.metadata = metadata; |
| this.isPaused = isPaused; |
| this.origin = origin; |
| this.tabId = tabId; |
| @@ -260,7 +261,7 @@ public class MediaNotificationInfo { |
| && icon == other.icon |
| && mActions == other.mActions |
| && id == other.id |
| - && TextUtils.equals(title, other.title) |
| + && metadata.equals(other.metadata) |
| && TextUtils.equals(origin, other.origin) |
| && image == other.image || (image != null && image.sameAs(other.image)) |
| && contentIntent.equals(other.contentIntent) |
| @@ -271,7 +272,7 @@ public class MediaNotificationInfo { |
| public int hashCode() { |
| int result = isPaused ? 1 : 0; |
| result = 31 * result + (isPrivate ? 1 : 0); |
| - result = 31 * result + (title == null ? 0 : title.hashCode()); |
| + 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()); |