| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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_BROWSER_MEDIA_SESSION_MEDIA_SESSION_IMPL_H_ | 5 #ifndef CONTENT_BROWSER_MEDIA_SESSION_MEDIA_SESSION_IMPL_H_ |
| 6 #define CONTENT_BROWSER_MEDIA_SESSION_MEDIA_SESSION_IMPL_H_ | 6 #define CONTENT_BROWSER_MEDIA_SESSION_MEDIA_SESSION_IMPL_H_ |
| 7 | 7 |
| 8 #include <stddef.h> | 8 #include <stddef.h> |
| 9 | 9 |
| 10 #include "base/callback_list.h" | 10 #include "base/callback_list.h" |
| (...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 120 // |type| represents the origin of the request. | 120 // |type| represents the origin of the request. |
| 121 CONTENT_EXPORT void Suspend(MediaSession::SuspendType suspend_type) override; | 121 CONTENT_EXPORT void Suspend(MediaSession::SuspendType suspend_type) override; |
| 122 | 122 |
| 123 // Stop the media session. | 123 // Stop the media session. |
| 124 // |type| represents the origin of the request. | 124 // |type| represents the origin of the request. |
| 125 CONTENT_EXPORT void Stop(MediaSession::SuspendType suspend_type) override; | 125 CONTENT_EXPORT void Stop(MediaSession::SuspendType suspend_type) override; |
| 126 | 126 |
| 127 // Received a media session action and forward to blink::MediaSession. | 127 // Received a media session action and forward to blink::MediaSession. |
| 128 void DidReceiveAction(blink::mojom::MediaSessionAction action) override; | 128 void DidReceiveAction(blink::mojom::MediaSessionAction action) override; |
| 129 | 129 |
| 130 // Let the media session start ducking such that the volume multiplier is |
| 131 // reduced. |
| 132 CONTENT_EXPORT void StartDucking() override; |
| 133 |
| 134 // Let the media session stop ducking such that the volume multiplier is |
| 135 // recovered. |
| 136 CONTENT_EXPORT void StopDucking() override; |
| 137 |
| 130 // Called when an action is enabled in blink::MediaSession. This method will | 138 // Called when an action is enabled in blink::MediaSession. This method will |
| 131 // notify the observers that the action is enabled. | 139 // notify the observers that the action is enabled. |
| 132 void OnMediaSessionEnabledAction(blink::mojom::MediaSessionAction action); | 140 void OnMediaSessionEnabledAction(blink::mojom::MediaSessionAction action); |
| 133 | 141 |
| 134 // Called when an action is disabled in blink::MediaSession. This method will | 142 // Called when an action is disabled in blink::MediaSession. This method will |
| 135 // notify the observers that the action is disabled. | 143 // notify the observers that the action is disabled. |
| 136 void OnMediaSessionDisabledAction(blink::mojom::MediaSessionAction action); | 144 void OnMediaSessionDisabledAction(blink::mojom::MediaSessionAction action); |
| 137 | 145 |
| 138 // Let the media session start ducking such that the volume multiplier is | |
| 139 // reduced. | |
| 140 CONTENT_EXPORT void StartDucking(); | |
| 141 | |
| 142 // Let the media session stop ducking such that the volume multiplier is | |
| 143 // recovered. | |
| 144 CONTENT_EXPORT void StopDucking(); | |
| 145 | |
| 146 // Returns if the session can be controlled by Resume() and Suspend calls | 146 // Returns if the session can be controlled by Resume() and Suspend calls |
| 147 // above. | 147 // above. |
| 148 CONTENT_EXPORT bool IsControllable() const; | 148 CONTENT_EXPORT bool IsControllable() const; |
| 149 | 149 |
| 150 // Returns if the session is currently active. | 150 // Returns if the session is currently active. |
| 151 CONTENT_EXPORT bool IsActive() const; | 151 CONTENT_EXPORT bool IsActive() const; |
| 152 | 152 |
| 153 // Returns if the session is currently suspended. | 153 // Returns if the session is currently suspended. |
| 154 // TODO(mlamouri): IsSuspended() below checks if the state is not ACTIVE | 154 // TODO(mlamouri): IsSuspended() below checks if the state is not ACTIVE |
| 155 // instead of checking if the state is SUSPENDED. In order to not have to | 155 // instead of checking if the state is SUSPENDED. In order to not have to |
| (...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 279 // The MediaSessionService this session is associated with (the service of the | 279 // The MediaSessionService this session is associated with (the service of the |
| 280 // top-level frame). | 280 // top-level frame). |
| 281 MediaSessionServiceImpl* service_; | 281 MediaSessionServiceImpl* service_; |
| 282 | 282 |
| 283 DISALLOW_COPY_AND_ASSIGN(MediaSessionImpl); | 283 DISALLOW_COPY_AND_ASSIGN(MediaSessionImpl); |
| 284 }; | 284 }; |
| 285 | 285 |
| 286 } // namespace content | 286 } // namespace content |
| 287 | 287 |
| 288 #endif // CONTENT_BROWSER_MEDIA_SESSION_MEDIA_SESSION_IMPL_H_ | 288 #endif // CONTENT_BROWSER_MEDIA_SESSION_MEDIA_SESSION_IMPL_H_ |
| OLD | NEW |