OLD | NEW |
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef CONTENT_PUBLIC_BROWSER_MEDIA_SESSION_H_ | 5 #ifndef CONTENT_PUBLIC_BROWSER_MEDIA_SESSION_H_ |
6 #define CONTENT_PUBLIC_BROWSER_MEDIA_SESSION_H_ | 6 #define CONTENT_PUBLIC_BROWSER_MEDIA_SESSION_H_ |
7 | 7 |
8 #include "base/macros.h" | 8 #include "base/macros.h" |
9 #include "content/common/content_export.h" | 9 #include "content/common/content_export.h" |
10 | 10 |
11 namespace blink { | |
12 namespace mojom { | |
13 enum class MediaSessionAction; | |
14 } // namespace mojom | |
15 } // namespace blink | |
16 | |
17 namespace content { | 11 namespace content { |
18 | 12 |
19 class WebContents; | 13 class WebContents; |
20 | 14 |
21 // MediaSession manages the media session and audio focus for a given | 15 // MediaSession manages the media session and audio focus for a given |
22 // WebContents. There is only one MediaSession per WebContents. | 16 // WebContents. There is only one MediaSession per WebContents. |
23 // | 17 // |
24 // MediaSession allows clients to observe its changes via MediaSessionObserver, | 18 // MediaSession allows clients to observe its changes via MediaSessionObserver, |
25 // and allows clients to resume/suspend/stop the managed players. | 19 // and allows clients to resume/suspend/stop the managed players. |
26 class MediaSession { | 20 class MediaSession { |
(...skipping 18 matching lines...) Expand all Loading... |
45 virtual void Resume(SuspendType suspend_type) = 0; | 39 virtual void Resume(SuspendType suspend_type) = 0; |
46 | 40 |
47 // Resume the media session. | 41 // Resume the media session. |
48 // |type| represents the origin of the request. | 42 // |type| represents the origin of the request. |
49 virtual void Suspend(SuspendType suspend_type) = 0; | 43 virtual void Suspend(SuspendType suspend_type) = 0; |
50 | 44 |
51 // Resume the media session. | 45 // Resume the media session. |
52 // |type| represents the origin of the request. | 46 // |type| represents the origin of the request. |
53 virtual void Stop(SuspendType suspend_type) = 0; | 47 virtual void Stop(SuspendType suspend_type) = 0; |
54 | 48 |
55 // Tell the media session a user action has performed. | |
56 virtual void DidReceiveAction(blink::mojom::MediaSessionAction action) = 0; | |
57 | |
58 protected: | 49 protected: |
59 MediaSession() = default; | 50 MediaSession() = default; |
60 }; | 51 }; |
61 | 52 |
62 } // namespace content | 53 } // namespace content |
63 | 54 |
64 #endif // CONTENT_PUBLIC_BROWSER_MEDIA_SESSION_H_ | 55 #endif // CONTENT_PUBLIC_BROWSER_MEDIA_SESSION_H_ |
OLD | NEW |