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

Issue 1159113006: [Android] A prototype of the interactive media notification. (Closed)

Created:
5 years, 6 months ago by whywhat
Modified:
5 years, 5 months ago
CC:
chromium-reviews, davve, jam, philipj_slow, richt
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

[Android] A prototype of the interactive media notification. MediaSession notifies WebContentsDelegate when to show/hide the controls. ChromeTab's delegate implementation uses NotificationMediaPlaybackControls for the notification. Notification is implemented similar to the Cast one. WebContentsDelegate gets the necessary information from MediaSession via MediaControlsDelegate interface provided by WebContents. BUG=470600 TEST=Manual Committed: https://crrev.com/41634b16099cde386dc1090423f566bd4624070c Cr-Commit-Position: refs/heads/master@{#337844}

Patch Set 1 #

Patch Set 2 : Specify the right suspension type, use Cast notification layout, hide the notification when state c… #

Patch Set 3 : Only show broad domain and remove the listener #

Patch Set 4 : Updated notification style, fixed some issues. #

Patch Set 5 : Added browser tests #

Total comments: 50

Patch Set 6 : Addressed comments and nits #

Total comments: 2

Patch Set 7 : Fixed a few missed nits #

Total comments: 18

Patch Set 8 : Fixed Mounir's comments #

Total comments: 26

Patch Set 9 : Addressed the comments #

Total comments: 10

Patch Set 10 : Fixed tests and Min's nits #

Total comments: 51

Patch Set 11 : Fixed smaller comments from Ted #

Patch Set 12 : Forgot to upload a few style fixes #

Patch Set 13 : Forgot to add a file #

Patch Set 14 : Rebased the change #

Patch Set 15 : Moved the plumbing from WebContentsDelegate to WebContentsObserver #

Patch Set 16 : Fixed compile errors for chrome_public_apk #

Patch Set 17 : Updated the browser tests #

Patch Set 18 : Fixed compile on non-Android. Fixed incidental diffs. #

Patch Set 19 : Added some null checks and hiding the notification when the tab is destroyed. #

Total comments: 6

Patch Set 20 : Fixed Min's nits #

Total comments: 31

Patch Set 21 : Addressed Ted's comments #

Total comments: 7

Patch Set 22 : Removed unnecessary clear() call #

Patch Set 23 : Updated the paddings for the notification layout according to the UX feedback #

Total comments: 1

Patch Set 24 : Moved OnMediaSessionStateChanged to WebContentsImpl #

Unified diffs Side-by-side diffs Delta from patch set Stats (+1213 lines, -311 lines) Patch
M chrome/android/java/AndroidManifest.xml View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 1 chunk +2 lines, -0 lines 0 comments Download
A + chrome/android/java/res/layout/playback_notification_bar.xml View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 4 chunks +16 lines, -39 lines 0 comments Download
M chrome/android/java/res/values-v17/styles.xml View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 1 chunk +7 lines, -1 line 0 comments Download
M chrome/android/java/res/values-v21/styles.xml View 1 2 3 4 5 1 chunk +6 lines, -1 line 0 comments Download
M chrome/android/java/res/values/values.xml View 1 2 3 4 5 1 chunk +3 lines, -0 lines 0 comments Download
A chrome/android/java/src/org/chromium/chrome/browser/media/ui/MediaInfo.java View 1 2 3 4 5 6 7 8 9 10 1 chunk +89 lines, -0 lines 0 comments Download
A chrome/android/java/src/org/chromium/chrome/browser/media/ui/MediaPlaybackListener.java View 1 2 3 4 5 6 7 8 9 10 11 12 1 chunk +20 lines, -0 lines 0 comments Download
A chrome/android/java/src/org/chromium/chrome/browser/media/ui/MediaSessionTabHelper.java View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 1 chunk +129 lines, -0 lines 0 comments Download
A chrome/android/java/src/org/chromium/chrome/browser/media/ui/NotificationMediaPlaybackControls.java View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 1 chunk +269 lines, -0 lines 0 comments Download
M chrome/android/java/src/org/chromium/chrome/browser/tab/ChromeTab.java View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 3 chunks +3 lines, -1 line 0 comments Download
M chrome/android/java/strings/android_chrome_strings.grd View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 2 chunks +14 lines, -0 lines 0 comments Download
M chrome/android/shell/java/AndroidManifest.xml.jinja2 View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 1 chunk +4 lines, -0 lines 0 comments Download
M content/browser/android/web_contents_observer_proxy.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 1 chunk +2 lines, -0 lines 0 comments Download
M content/browser/android/web_contents_observer_proxy.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 1 chunk +10 lines, -0 lines 0 comments Download
M content/browser/media/android/browser_media_player_manager.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 1 chunk +2 lines, -1 line 0 comments Download
M content/browser/media/android/media_session.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 5 chunks +29 lines, -12 lines 0 comments Download
M content/browser/media/android/media_session.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 7 chunks +44 lines, -6 lines 0 comments Download
M content/browser/media/android/media_session_browsertest.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 4 chunks +481 lines, -249 lines 0 comments Download
M content/browser/web_contents/web_contents_android.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 1 chunk +4 lines, -0 lines 0 comments Download
M content/browser/web_contents/web_contents_android.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 1 chunk +8 lines, -0 lines 0 comments Download
M content/browser/web_contents/web_contents_impl.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 1 chunk +4 lines, -0 lines 0 comments Download
M content/browser/web_contents/web_contents_impl.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 2 chunks +20 lines, -0 lines 0 comments Download
M content/public/android/java/src/org/chromium/content/browser/webcontents/WebContentsImpl.java View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 2 chunks +12 lines, -0 lines 0 comments Download
M content/public/android/java/src/org/chromium/content/browser/webcontents/WebContentsObserverProxy.java View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 1 chunk +8 lines, -0 lines 0 comments Download
M content/public/android/java/src/org/chromium/content_public/browser/WebContents.java View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 1 chunk +10 lines, -0 lines 0 comments Download
M content/public/android/java/src/org/chromium/content_public/browser/WebContentsObserver.java View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 1 chunk +7 lines, -0 lines 0 comments Download
M content/public/browser/web_contents.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 2 chunks +6 lines, -1 line 0 comments Download
M content/public/browser/web_contents_observer.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 1 chunk +4 lines, -0 lines 0 comments Download

Dependent Patchsets:

Messages

Total messages: 41 (7 generated)
whywhat
PTAL
5 years, 6 months ago (2015-06-16 20:26:23 UTC) #2
whywhat
5 years, 6 months ago (2015-06-17 12:11:21 UTC) #4
mlamouri (slow - plz ping)
A few comments from a first pass. I haven't looked at everything very closely. https://codereview.chromium.org/1159113006/diff/80001/chrome/android/java/res/layout/remote_notification_bar.xml ...
5 years, 6 months ago (2015-06-18 16:43:23 UTC) #5
whywhat
git cl upload is still doing something so I will update the CL when it ...
5 years, 6 months ago (2015-06-19 16:00:35 UTC) #6
mlamouri (slow - plz ping)
https://codereview.chromium.org/1159113006/diff/80001/chrome/android/java/src/org/chromium/chrome/browser/media/ui/MediaInfo.java File chrome/android/java/src/org/chromium/chrome/browser/media/ui/MediaInfo.java (right): https://codereview.chromium.org/1159113006/diff/80001/chrome/android/java/src/org/chromium/chrome/browser/media/ui/MediaInfo.java#newcode29 chrome/android/java/src/org/chromium/chrome/browser/media/ui/MediaInfo.java:29: * The eTLD+1 of the media On 2015/06/19 at ...
5 years, 6 months ago (2015-06-22 14:34:17 UTC) #7
mlamouri (slow - plz ping)
Some more comments on the Java code. https://codereview.chromium.org/1159113006/diff/120001/chrome/android/java/src/org/chromium/chrome/browser/media/ui/MediaPlaybackControls.java File chrome/android/java/src/org/chromium/chrome/browser/media/ui/MediaPlaybackControls.java (right): https://codereview.chromium.org/1159113006/diff/120001/chrome/android/java/src/org/chromium/chrome/browser/media/ui/MediaPlaybackControls.java#newcode18 chrome/android/java/src/org/chromium/chrome/browser/media/ui/MediaPlaybackControls.java:18: public abstract ...
5 years, 6 months ago (2015-06-23 14:58:57 UTC) #8
whywhat
https://codereview.chromium.org/1159113006/diff/80001/chrome/android/java/src/org/chromium/chrome/browser/media/ui/MediaInfo.java File chrome/android/java/src/org/chromium/chrome/browser/media/ui/MediaInfo.java (right): https://codereview.chromium.org/1159113006/diff/80001/chrome/android/java/src/org/chromium/chrome/browser/media/ui/MediaInfo.java#newcode29 chrome/android/java/src/org/chromium/chrome/browser/media/ui/MediaInfo.java:29: * The eTLD+1 of the media On 2015/06/22 at ...
5 years, 6 months ago (2015-06-23 19:39:11 UTC) #10
whywhat
Min, Ted, could you have a look please?
5 years, 6 months ago (2015-06-23 22:45:05 UTC) #11
mlamouri (slow - plz ping)
lgtm with the comments applied. Thanks! :) https://codereview.chromium.org/1159113006/diff/140001/chrome/android/java/src/org/chromium/chrome/browser/media/ui/MediaInfo.java File chrome/android/java/src/org/chromium/chrome/browser/media/ui/MediaInfo.java (right): https://codereview.chromium.org/1159113006/diff/140001/chrome/android/java/src/org/chromium/chrome/browser/media/ui/MediaInfo.java#newcode53 chrome/android/java/src/org/chromium/chrome/browser/media/ui/MediaInfo.java:53: * @param ...
5 years, 6 months ago (2015-06-24 16:15:03 UTC) #12
whywhat
https://codereview.chromium.org/1159113006/diff/140001/chrome/android/java/src/org/chromium/chrome/browser/media/ui/MediaInfo.java File chrome/android/java/src/org/chromium/chrome/browser/media/ui/MediaInfo.java (right): https://codereview.chromium.org/1159113006/diff/140001/chrome/android/java/src/org/chromium/chrome/browser/media/ui/MediaInfo.java#newcode53 chrome/android/java/src/org/chromium/chrome/browser/media/ui/MediaInfo.java:53: * @param other the source. On 2015/06/24 at 16:15:02, ...
5 years, 6 months ago (2015-06-24 18:36:16 UTC) #13
qinmin
https://codereview.chromium.org/1159113006/diff/160001/chrome/android/java/src/org/chromium/chrome/browser/media/ui/MediaInfo.java File chrome/android/java/src/org/chromium/chrome/browser/media/ui/MediaInfo.java (right): https://codereview.chromium.org/1159113006/diff/160001/chrome/android/java/src/org/chromium/chrome/browser/media/ui/MediaInfo.java#newcode16 chrome/android/java/src/org/chromium/chrome/browser/media/ui/MediaInfo.java:16: public String title; final, and same for variables below ...
5 years, 6 months ago (2015-06-24 19:10:20 UTC) #14
whywhat
PTAL https://codereview.chromium.org/1159113006/diff/160001/chrome/android/java/src/org/chromium/chrome/browser/media/ui/MediaInfo.java File chrome/android/java/src/org/chromium/chrome/browser/media/ui/MediaInfo.java (right): https://codereview.chromium.org/1159113006/diff/160001/chrome/android/java/src/org/chromium/chrome/browser/media/ui/MediaInfo.java#newcode16 chrome/android/java/src/org/chromium/chrome/browser/media/ui/MediaInfo.java:16: public String title; On 2015/06/24 at 19:10:20, qinmin ...
5 years, 6 months ago (2015-06-25 10:10:52 UTC) #15
qinmin
https://codereview.chromium.org/1159113006/diff/160001/chrome/android/java/src/org/chromium/chrome/browser/media/ui/NotificationMediaPlaybackControls.java File chrome/android/java/src/org/chromium/chrome/browser/media/ui/NotificationMediaPlaybackControls.java (right): https://codereview.chromium.org/1159113006/diff/160001/chrome/android/java/src/org/chromium/chrome/browser/media/ui/NotificationMediaPlaybackControls.java#newcode359 chrome/android/java/src/org/chromium/chrome/browser/media/ui/NotificationMediaPlaybackControls.java:359: private static boolean equal(Object a, Object b) { On ...
5 years, 5 months ago (2015-06-25 15:08:43 UTC) #16
whywhat
https://codereview.chromium.org/1159113006/diff/160001/chrome/android/java/src/org/chromium/chrome/browser/media/ui/NotificationMediaPlaybackControls.java File chrome/android/java/src/org/chromium/chrome/browser/media/ui/NotificationMediaPlaybackControls.java (right): https://codereview.chromium.org/1159113006/diff/160001/chrome/android/java/src/org/chromium/chrome/browser/media/ui/NotificationMediaPlaybackControls.java#newcode359 chrome/android/java/src/org/chromium/chrome/browser/media/ui/NotificationMediaPlaybackControls.java:359: private static boolean equal(Object a, Object b) { On ...
5 years, 5 months ago (2015-06-25 16:25:07 UTC) #17
Ted C
https://codereview.chromium.org/1159113006/diff/180001/chrome/android/java/src/org/chromium/chrome/browser/media/ui/MediaInfo.java File chrome/android/java/src/org/chromium/chrome/browser/media/ui/MediaInfo.java (right): https://codereview.chromium.org/1159113006/diff/180001/chrome/android/java/src/org/chromium/chrome/browser/media/ui/MediaInfo.java#newcode42 chrome/android/java/src/org/chromium/chrome/browser/media/ui/MediaInfo.java:42: boolean isPaused, these won't all fit on a single ...
5 years, 5 months ago (2015-06-26 00:43:55 UTC) #18
whywhat
Fixed the minor comments and replied with a suggestion and question about moving the logic ...
5 years, 5 months ago (2015-06-26 19:29:32 UTC) #19
Ted C
@jam -- I'm looking for your thoughts on how best we should be adding this ...
5 years, 5 months ago (2015-06-30 04:56:13 UTC) #21
whywhat
I moved the logic out to MediaSessionTabHelper and changed the plumbing to WebContentsObserver instead of ...
5 years, 5 months ago (2015-06-30 21:06:34 UTC) #22
whywhat
I updated the browser tests to check that WebContentsObserver is called when needed. PTAL.
5 years, 5 months ago (2015-07-02 19:30:28 UTC) #23
qinmin
lgtm lgtm % nits I will leave the WebContentsObserver/WebContentsDelegate issue to jam https://codereview.chromium.org/1159113006/diff/360001/chrome/android/java/src/org/chromium/chrome/browser/media/ui/NotificationMediaPlaybackControls.java File chrome/android/java/src/org/chromium/chrome/browser/media/ui/NotificationMediaPlaybackControls.java ...
5 years, 5 months ago (2015-07-04 19:30:46 UTC) #24
whywhat
PTAL https://codereview.chromium.org/1159113006/diff/360001/chrome/android/java/src/org/chromium/chrome/browser/media/ui/NotificationMediaPlaybackControls.java File chrome/android/java/src/org/chromium/chrome/browser/media/ui/NotificationMediaPlaybackControls.java (right): https://codereview.chromium.org/1159113006/diff/360001/chrome/android/java/src/org/chromium/chrome/browser/media/ui/NotificationMediaPlaybackControls.java#newcode206 chrome/android/java/src/org/chromium/chrome/browser/media/ui/NotificationMediaPlaybackControls.java:206: // destroyNotification(). This is done to avoid the ...
5 years, 5 months ago (2015-07-06 17:38:24 UTC) #25
Ted C
https://codereview.chromium.org/1159113006/diff/380001/chrome/android/java/src/org/chromium/chrome/browser/media/ui/MediaSessionTabHelper.java File chrome/android/java/src/org/chromium/chrome/browser/media/ui/MediaSessionTabHelper.java (right): https://codereview.chromium.org/1159113006/diff/380001/chrome/android/java/src/org/chromium/chrome/browser/media/ui/MediaSessionTabHelper.java#newcode48 chrome/android/java/src/org/chromium/chrome/browser/media/ui/MediaSessionTabHelper.java:48: int tabId = mTab == null ? Tab.INVALID_TAB_ID : ...
5 years, 5 months ago (2015-07-06 22:18:29 UTC) #26
whywhat
PTAL! https://codereview.chromium.org/1159113006/diff/380001/chrome/android/java/src/org/chromium/chrome/browser/media/ui/MediaSessionTabHelper.java File chrome/android/java/src/org/chromium/chrome/browser/media/ui/MediaSessionTabHelper.java (right): https://codereview.chromium.org/1159113006/diff/380001/chrome/android/java/src/org/chromium/chrome/browser/media/ui/MediaSessionTabHelper.java#newcode48 chrome/android/java/src/org/chromium/chrome/browser/media/ui/MediaSessionTabHelper.java:48: int tabId = mTab == null ? Tab.INVALID_TAB_ID ...
5 years, 5 months ago (2015-07-07 15:44:58 UTC) #27
whywhat
+jochen, cc:jam (OOO) Jochen, could you take a look at this cl instead of John? ...
5 years, 5 months ago (2015-07-07 15:59:31 UTC) #29
Ted C
Overall looks good...one question about the need for clear, but otherwise seems ready to go. ...
5 years, 5 months ago (2015-07-07 17:11:19 UTC) #30
whywhat
https://codereview.chromium.org/1159113006/diff/380001/chrome/android/java/src/org/chromium/chrome/browser/media/ui/MediaSessionTabHelper.java File chrome/android/java/src/org/chromium/chrome/browser/media/ui/MediaSessionTabHelper.java (right): https://codereview.chromium.org/1159113006/diff/380001/chrome/android/java/src/org/chromium/chrome/browser/media/ui/MediaSessionTabHelper.java#newcode91 chrome/android/java/src/org/chromium/chrome/browser/media/ui/MediaSessionTabHelper.java:91: // Usually means that tab's web contents changed. On ...
5 years, 5 months ago (2015-07-07 19:19:04 UTC) #31
whywhat
5 years, 5 months ago (2015-07-07 19:19:06 UTC) #32
Ted C
lgtm https://codereview.chromium.org/1159113006/diff/380001/chrome/android/java/src/org/chromium/chrome/browser/media/ui/MediaSessionTabHelper.java File chrome/android/java/src/org/chromium/chrome/browser/media/ui/MediaSessionTabHelper.java (right): https://codereview.chromium.org/1159113006/diff/380001/chrome/android/java/src/org/chromium/chrome/browser/media/ui/MediaSessionTabHelper.java#newcode91 chrome/android/java/src/org/chromium/chrome/browser/media/ui/MediaSessionTabHelper.java:91: // Usually means that tab's web contents changed. ...
5 years, 5 months ago (2015-07-07 20:04:12 UTC) #33
jochen (gone - plz use gerrit)
why not put the methods on the MediaObserver interface?
5 years, 5 months ago (2015-07-08 13:37:26 UTC) #34
whywhat
On 2015/07/08 at 13:37:26, jochen wrote: > why not put the methods on the MediaObserver ...
5 years, 5 months ago (2015-07-08 13:48:04 UTC) #35
jochen (gone - plz use gerrit)
lgtm with comment addressed https://codereview.chromium.org/1159113006/diff/430001/content/public/browser/web_contents.h File content/public/browser/web_contents.h (right): https://codereview.chromium.org/1159113006/diff/430001/content/public/browser/web_contents.h#newcode665 content/public/browser/web_contents.h:665: virtual void OnMediaSessionStateChanged() = 0; ...
5 years, 5 months ago (2015-07-08 15:35:57 UTC) #36
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1159113006/450001
5 years, 5 months ago (2015-07-08 16:09:09 UTC) #39
commit-bot: I haz the power
Committed patchset #24 (id:450001)
5 years, 5 months ago (2015-07-08 17:07:16 UTC) #40
commit-bot: I haz the power
5 years, 5 months ago (2015-07-08 17:08:25 UTC) #41
Message was sent while issue was closed.
Patchset 24 (id:??) landed as
https://crrev.com/41634b16099cde386dc1090423f566bd4624070c
Cr-Commit-Position: refs/heads/master@{#337844}

Powered by Google App Engine
This is Rietveld 408576698