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" |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
43 media::MediaContentType media_content_type); | 43 media::MediaContentType media_content_type); |
44 | 44 |
45 // Must be called when a pause occurs on the renderer side media player; keeps | 45 // Must be called when a pause occurs on the renderer side media player; keeps |
46 // the MediaSession instance in sync with renderer side behavior. | 46 // the MediaSession instance in sync with renderer side behavior. |
47 void OnPlaybackPaused(); | 47 void OnPlaybackPaused(); |
48 | 48 |
49 // MediaSessionObserver implementation. | 49 // MediaSessionObserver implementation. |
50 void OnSuspend(int player_id) override; | 50 void OnSuspend(int player_id) override; |
51 void OnResume(int player_id) override; | 51 void OnResume(int player_id) override; |
52 void OnSetVolumeMultiplier(int player_id, double volume_multiplier) override; | 52 void OnSetVolumeMultiplier(int player_id, double volume_multiplier) override; |
53 RenderFrameHost* GetRenderFrameHost() const override; | 53 RenderFrameHost* render_frame_host() const override; |
54 | 54 |
55 // Test helpers. | 55 // Test helpers. |
56 int get_player_id_for_testing() const { return player_id_; } | 56 int get_player_id_for_testing() const { return player_id_; } |
57 | 57 |
58 private: | 58 private: |
59 const WebContentsObserver::MediaPlayerId id_; | 59 const WebContentsObserver::MediaPlayerId id_; |
60 | 60 |
61 // Non-owned pointer; |media_web_contents_observer_| is the owner of |this|. | 61 // Non-owned pointer; |media_web_contents_observer_| is the owner of |this|. |
62 MediaWebContentsObserver* const media_web_contents_observer_; | 62 MediaWebContentsObserver* const media_web_contents_observer_; |
63 | 63 |
64 // Non-owned pointer; lifetime is the same as |media_web_contents_observer_|. | 64 // Non-owned pointer; lifetime is the same as |media_web_contents_observer_|. |
65 MediaSessionImpl* const media_session_; | 65 MediaSessionImpl* const media_session_; |
66 | 66 |
67 int player_id_ = 0; | 67 int player_id_ = 0; |
68 bool has_session_ = false; | 68 bool has_session_ = false; |
69 | 69 |
70 DISALLOW_COPY_AND_ASSIGN(MediaSessionController); | 70 DISALLOW_COPY_AND_ASSIGN(MediaSessionController); |
71 }; | 71 }; |
72 | 72 |
73 } // namespace content | 73 } // namespace content |
74 | 74 |
75 #endif // CONTENT_BROWSER_MEDIA_SESSION_MEDIA_SESSION_CONTROLLER_H_ | 75 #endif // CONTENT_BROWSER_MEDIA_SESSION_MEDIA_SESSION_CONTROLLER_H_ |
OLD | NEW |