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

Unified Diff: content/browser/media/session/media_session_impl.h

Issue 2442303002: Adding new media controls to MediaNotification (Closed)
Patch Set: rebased onto MediaSession refactoring Created 4 years, 2 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/media/session/media_session_impl.h
diff --git a/content/browser/media/session/media_session_impl.h b/content/browser/media/session/media_session_impl.h
index 1123f9ee42b717e6c8693f7e6d0cebab93af50b3..e9684a7553549f3f78910722513d5cb4504fbc3e 100644
--- a/content/browser/media/session/media_session_impl.h
+++ b/content/browser/media/session/media_session_impl.h
@@ -39,6 +39,7 @@ class MediaSessionImplStateObserver;
class MediaSessionImplVisibilityBrowserTest;
class MediaSessionObserver;
class MediaSessionPlayerObserver;
+class MediaSessionServiceImpl;
#if defined(OS_ANDROID)
class MediaSessionAndroid;
@@ -123,6 +124,17 @@ class MediaSessionImpl : public MediaSession,
// |type| represents the origin of the request.
CONTENT_EXPORT void Stop(MediaSession::SuspendType suspend_type) override;
+ // Received a media session action and forward to blink::MediaSession.
+ void DidReceiveAction(blink::mojom::MediaSessionAction action) override;
+
+ // Called when an action is enabled in blink::MediaSession. This method will
+ // notify the observers that the action is enabled.
+ void OnMediaSessionEnabledAction(blink::mojom::MediaSessionAction action);
+
+ // Called when an action is disabled in blink::MediaSession. This method will
+ // notify the observers that the action is disabled.
+ void OnMediaSessionDisabledAction(blink::mojom::MediaSessionAction action);
+
// Let the media session start ducking such that the volume multiplier is
// reduced.
CONTENT_EXPORT void StartDucking();
@@ -160,6 +172,10 @@ class MediaSessionImpl : public MediaSession,
// WebContentsObserver implementation
void WebContentsDestroyed() override;
+ // Sets the associated MediaSessionService for communicating with
+ // blink::MediaSession.
+ void SetMediaSessionService(MediaSessionServiceImpl* service);
+
private:
friend class content::WebContentsUserData<MediaSessionImpl>;
friend class ::MediaSessionImplBrowserTest;
@@ -255,6 +271,10 @@ class MediaSessionImpl : public MediaSession,
std::unique_ptr<MediaSessionAndroid> session_android_;
#endif // defined(OS_ANDROID)
+ // The MediaSessionService this session is associated with (the service of the
+ // top-level frame).
+ MediaSessionServiceImpl* service_;
+
DISALLOW_COPY_AND_ASSIGN(MediaSessionImpl);
};

Powered by Google App Engine
This is Rietveld 408576698