| 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 <map> | 10 #include <map> |
| (...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 78 ~MediaSessionImpl() override; | 78 ~MediaSessionImpl() override; |
| 79 | 79 |
| 80 #if defined(OS_ANDROID) | 80 #if defined(OS_ANDROID) |
| 81 static MediaSession* FromJavaMediaSession( | 81 static MediaSession* FromJavaMediaSession( |
| 82 const base::android::JavaRef<jobject>& j_media_session); | 82 const base::android::JavaRef<jobject>& j_media_session); |
| 83 MediaSessionAndroid* session_android() const { | 83 MediaSessionAndroid* session_android() const { |
| 84 return session_android_.get(); | 84 return session_android_.get(); |
| 85 } | 85 } |
| 86 #endif // defined(OS_ANDROID) | 86 #endif // defined(OS_ANDROID) |
| 87 | 87 |
| 88 void AddObserver(MediaSessionObserver* observer); | |
| 89 void RemoveObserver(MediaSessionObserver* observer); | |
| 90 | |
| 91 void NotifyMediaSessionMetadataChange( | 88 void NotifyMediaSessionMetadataChange( |
| 92 const base::Optional<MediaMetadata>& metadata); | 89 const base::Optional<MediaMetadata>& metadata); |
| 93 void NotifyMediaSessionActionsChange( | 90 void NotifyMediaSessionActionsChange( |
| 94 const std::set<blink::mojom::MediaSessionAction>& actions); | 91 const std::set<blink::mojom::MediaSessionAction>& actions); |
| 95 | 92 |
| 96 // Adds the given player to the current media session. Returns whether the | 93 // Adds the given player to the current media session. Returns whether the |
| 97 // player was successfully added. If it returns false, AddPlayer() should be | 94 // player was successfully added. If it returns false, AddPlayer() should be |
| 98 // called again later. | 95 // called again later. |
| 99 CONTENT_EXPORT bool AddPlayer(MediaSessionPlayerObserver* observer, | 96 CONTENT_EXPORT bool AddPlayer(MediaSessionPlayerObserver* observer, |
| 100 int player_id, | 97 int player_id, |
| (...skipping 30 matching lines...) Expand all Loading... |
| 131 CONTENT_EXPORT void Stop(MediaSession::SuspendType suspend_type) override; | 128 CONTENT_EXPORT void Stop(MediaSession::SuspendType suspend_type) override; |
| 132 | 129 |
| 133 // Let the media session start ducking such that the volume multiplier is | 130 // Let the media session start ducking such that the volume multiplier is |
| 134 // reduced. | 131 // reduced. |
| 135 CONTENT_EXPORT void StartDucking() override; | 132 CONTENT_EXPORT void StartDucking() override; |
| 136 | 133 |
| 137 // Let the media session stop ducking such that the volume multiplier is | 134 // Let the media session stop ducking such that the volume multiplier is |
| 138 // recovered. | 135 // recovered. |
| 139 CONTENT_EXPORT void StopDucking() override; | 136 CONTENT_EXPORT void StopDucking() override; |
| 140 | 137 |
| 138 void AddObserver(MediaSessionObserver* observer) override; |
| 139 void RemoveObserver(MediaSessionObserver* observer) override; |
| 140 |
| 141 // Returns if the session can be controlled by Resume() and Suspend calls | 141 // Returns if the session can be controlled by Resume() and Suspend calls |
| 142 // above. | 142 // above. |
| 143 CONTENT_EXPORT bool IsControllable() const; | 143 CONTENT_EXPORT bool IsControllable() const; |
| 144 | 144 |
| 145 // Returns if the session is currently active. | 145 // Returns if the session is currently active. |
| 146 CONTENT_EXPORT bool IsActive() const; | 146 CONTENT_EXPORT bool IsActive() const; |
| 147 | 147 |
| 148 // Returns if the session is currently suspended. | 148 // Returns if the session is currently suspended. |
| 149 // TODO(mlamouri): IsSuspended() below checks if the state is not ACTIVE | 149 // TODO(mlamouri): IsSuspended() below checks if the state is not ACTIVE |
| 150 // instead of checking if the state is SUSPENDED. In order to not have to | 150 // instead of checking if the state is SUSPENDED. In order to not have to |
| (...skipping 160 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 311 ServicesMap services_; | 311 ServicesMap services_; |
| 312 // The currently routed service (non-owned pointer). | 312 // The currently routed service (non-owned pointer). |
| 313 MediaSessionServiceImpl* routed_service_; | 313 MediaSessionServiceImpl* routed_service_; |
| 314 | 314 |
| 315 DISALLOW_COPY_AND_ASSIGN(MediaSessionImpl); | 315 DISALLOW_COPY_AND_ASSIGN(MediaSessionImpl); |
| 316 }; | 316 }; |
| 317 | 317 |
| 318 } // namespace content | 318 } // namespace content |
| 319 | 319 |
| 320 #endif // CONTENT_BROWSER_MEDIA_SESSION_MEDIA_SESSION_IMPL_H_ | 320 #endif // CONTENT_BROWSER_MEDIA_SESSION_MEDIA_SESSION_IMPL_H_ |
| OLD | NEW |