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

Unified Diff: content/browser/web_contents/web_contents_impl.cc

Issue 1159113006: [Android] A prototype of the interactive media notification. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fixed Min's nits Created 5 years, 5 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: content/browser/web_contents/web_contents_impl.cc
diff --git a/content/browser/web_contents/web_contents_impl.cc b/content/browser/web_contents/web_contents_impl.cc
index 3df8edb12fb483d5ba4ad4ef7a8c350a20cee49d..2d351cc9e0928645ae53692fc69dda7980009a16 100644
--- a/content/browser/web_contents/web_contents_impl.cc
+++ b/content/browser/web_contents/web_contents_impl.cc
@@ -118,6 +118,7 @@
#include "content/browser/android/content_video_view.h"
#include "content/browser/android/date_time_chooser_android.h"
#include "content/browser/android/media_players_observer.h"
+#include "content/browser/media/android/media_session.h"
#include "content/browser/web_contents/web_contents_android.h"
#endif
@@ -3276,6 +3277,33 @@ void WebContentsImpl::OnMediaPausedNotification(int64 player_cookie) {
FOR_EACH_OBSERVER(WebContentsObserver, observers_, MediaPaused());
}
+void WebContentsImpl::OnMediaSessionStateChanged() {
+#if defined(OS_ANDROID)
Ted C 2015/07/06 22:18:29 shouldn't all of these be ifdef'd android if they
+ MediaSession* session = MediaSession::Get(this);
+ FOR_EACH_OBSERVER(WebContentsObserver, observers_,
+ MediaSessionStateChanged(session->IsControllable(),
+ session->IsSuspended()));
+#else
+ NOTIMPLEMENTED();
+#endif
+}
+
+void WebContentsImpl::ResumeMediaSession() {
+#if defined(OS_ANDROID)
+ MediaSession::Get(this)->Resume();
+#else
+ NOTIMPLEMENTED();
+#endif
+}
+
+void WebContentsImpl::SuspendMediaSession() {
+#if defined(OS_ANDROID)
+ MediaSession::Get(this)->Suspend();
+#else
+ NOTIMPLEMENTED();
+#endif
+}
+
void WebContentsImpl::OnFirstVisuallyNonEmptyPaint() {
FOR_EACH_OBSERVER(WebContentsObserver, observers_,
DidFirstVisuallyNonEmptyPaint());

Powered by Google App Engine
This is Rietveld 408576698