| 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_BROWSER_MEDIA_SESSION_MEDIA_SESSION_CONTROLLER_H_ | 5 #ifndef CONTENT_BROWSER_MEDIA_SESSION_MEDIA_SESSION_CONTROLLER_H_ |
| 6 #define CONTENT_BROWSER_MEDIA_SESSION_MEDIA_SESSION_CONTROLLER_H_ | 6 #define CONTENT_BROWSER_MEDIA_SESSION_MEDIA_SESSION_CONTROLLER_H_ |
| 7 | 7 |
| 8 #include "base/compiler_specific.h" | 8 #include "base/compiler_specific.h" |
| 9 #include "base/time/time.h" | 9 #include "base/time/time.h" |
| 10 #include "content/browser/media/session/media_session_player_observer.h" | 10 #include "content/browser/media/session/media_session_player_observer.h" |
| 11 #include "content/common/content_export.h" | 11 #include "content/common/content_export.h" |
| 12 #include "content/public/browser/web_contents_observer.h" | 12 #include "content/public/browser/web_contents_observer.h" |
| 13 | 13 |
| 14 namespace media { | 14 namespace media { |
| 15 enum class MediaContentType; | 15 enum class MediaContentType; |
| 16 } // namespace media | 16 } // namespace media |
| 17 | 17 |
| 18 namespace content { | 18 namespace content { |
| 19 | 19 |
| 20 class MediaSession; | 20 class MediaSessionImpl; |
| 21 class MediaWebContentsObserver; | 21 class MediaWebContentsObserver; |
| 22 | 22 |
| 23 // Helper class for controlling a single player's MediaSession instance. Sends | 23 // Helper class for controlling a single player's MediaSession instance. Sends |
| 24 // browser side MediaSession commands back to a player hosted in the renderer | 24 // browser side MediaSession commands back to a player hosted in the renderer |
| 25 // process. | 25 // process. |
| 26 class CONTENT_EXPORT MediaSessionController | 26 class CONTENT_EXPORT MediaSessionController |
| 27 : NON_EXPORTED_BASE(public MediaSessionPlayerObserver) { | 27 : NON_EXPORTED_BASE(public MediaSessionPlayerObserver) { |
| 28 public: | 28 public: |
| 29 MediaSessionController(const WebContentsObserver::MediaPlayerId& id, | 29 MediaSessionController(const WebContentsObserver::MediaPlayerId& id, |
| 30 MediaWebContentsObserver* media_web_contents_observer); | 30 MediaWebContentsObserver* media_web_contents_observer); |
| (...skipping 23 matching lines...) Expand all Loading... |
| 54 // Test helpers. | 54 // Test helpers. |
| 55 int get_player_id_for_testing() const { return player_id_; } | 55 int get_player_id_for_testing() const { return player_id_; } |
| 56 | 56 |
| 57 private: | 57 private: |
| 58 const WebContentsObserver::MediaPlayerId id_; | 58 const WebContentsObserver::MediaPlayerId id_; |
| 59 | 59 |
| 60 // Non-owned pointer; |media_web_contents_observer_| is the owner of |this|. | 60 // Non-owned pointer; |media_web_contents_observer_| is the owner of |this|. |
| 61 MediaWebContentsObserver* const media_web_contents_observer_; | 61 MediaWebContentsObserver* const media_web_contents_observer_; |
| 62 | 62 |
| 63 // Non-owned pointer; lifetime is the same as |media_web_contents_observer_|. | 63 // Non-owned pointer; lifetime is the same as |media_web_contents_observer_|. |
| 64 MediaSession* const media_session_; | 64 MediaSessionImpl* const media_session_; |
| 65 | 65 |
| 66 int player_id_ = 0; | 66 int player_id_ = 0; |
| 67 bool has_session_ = false; | 67 bool has_session_ = false; |
| 68 | 68 |
| 69 DISALLOW_COPY_AND_ASSIGN(MediaSessionController); | 69 DISALLOW_COPY_AND_ASSIGN(MediaSessionController); |
| 70 }; | 70 }; |
| 71 | 71 |
| 72 } // namespace content | 72 } // namespace content |
| 73 | 73 |
| 74 #endif // CONTENT_BROWSER_MEDIA_SESSION_MEDIA_SESSION_CONTROLLER_H_ | 74 #endif // CONTENT_BROWSER_MEDIA_SESSION_MEDIA_SESSION_CONTROLLER_H_ |
| OLD | NEW |