| 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 |
| 11 namespace content { | 17 namespace content { |
| 12 | 18 |
| 13 class WebContents; | 19 class WebContents; |
| 14 | 20 |
| 15 // MediaSession manages the media session and audio focus for a given | 21 // MediaSession manages the media session and audio focus for a given |
| 16 // WebContents. There is only one MediaSession per WebContents. | 22 // WebContents. There is only one MediaSession per WebContents. |
| 17 // | 23 // |
| 18 // MediaSession allows clients to observe its changes via MediaSessionObserver, | 24 // MediaSession allows clients to observe its changes via MediaSessionObserver, |
| 19 // and allows clients to resume/suspend/stop the managed players. | 25 // and allows clients to resume/suspend/stop the managed players. |
| 20 class MediaSession { | 26 class MediaSession { |
| (...skipping 18 matching lines...) Expand all Loading... |
| 39 virtual void Resume(SuspendType suspend_type) = 0; | 45 virtual void Resume(SuspendType suspend_type) = 0; |
| 40 | 46 |
| 41 // Resume the media session. | 47 // Resume the media session. |
| 42 // |type| represents the origin of the request. | 48 // |type| represents the origin of the request. |
| 43 virtual void Suspend(SuspendType suspend_type) = 0; | 49 virtual void Suspend(SuspendType suspend_type) = 0; |
| 44 | 50 |
| 45 // Resume the media session. | 51 // Resume the media session. |
| 46 // |type| represents the origin of the request. | 52 // |type| represents the origin of the request. |
| 47 virtual void Stop(SuspendType suspend_type) = 0; | 53 virtual void Stop(SuspendType suspend_type) = 0; |
| 48 | 54 |
| 55 // Tell the media session a user action has performed. |
| 56 virtual void DidReceiveAction(blink::mojom::MediaSessionAction action) = 0; |
| 57 |
| 49 protected: | 58 protected: |
| 50 MediaSession() = default; | 59 MediaSession() = default; |
| 51 }; | 60 }; |
| 52 | 61 |
| 53 } // namespace content | 62 } // namespace content |
| 54 | 63 |
| 55 #endif // CONTENT_PUBLIC_BROWSER_MEDIA_SESSION_H_ | 64 #endif // CONTENT_PUBLIC_BROWSER_MEDIA_SESSION_H_ |
| OLD | NEW |