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_ANDROID_BROWSER_MEDIA_SESSION_MANAGER_H_ | 5 #ifndef CONTENT_BROWSER_MEDIA_ANDROID_BROWSER_MEDIA_SESSION_MANAGER_H_ |
6 #define CONTENT_BROWSER_MEDIA_ANDROID_BROWSER_MEDIA_SESSION_MANAGER_H_ | 6 #define CONTENT_BROWSER_MEDIA_ANDROID_BROWSER_MEDIA_SESSION_MANAGER_H_ |
7 | 7 |
8 #include "base/macros.h" | 8 #include "base/macros.h" |
| 9 #include "base/memory/scoped_vector.h" |
| 10 #include "content/browser/media/android/media_session.h" |
9 | 11 |
10 namespace IPC { | 12 namespace IPC { |
11 class Message; | 13 class Message; |
12 } | 14 } |
13 | 15 |
14 namespace content { | 16 namespace content { |
15 | 17 |
16 class RenderFrameHost; | 18 class RenderFrameHost; |
17 | 19 |
18 class BrowserMediaSessionManager { | 20 class BrowserMediaSessionManager { |
19 public: | 21 public: |
20 BrowserMediaSessionManager(RenderFrameHost* render_frame_host); | 22 BrowserMediaSessionManager(RenderFrameHost* render_frame_host); |
21 | 23 |
22 // Message handlers. | 24 // Message handlers. |
23 void OnActivate(int session_id, int request_id); | 25 void OnActivate(int session_id, int request_id); |
24 void OnDeactivate(int session_id, int request_id); | 26 void OnDeactivate(int session_id, int request_id); |
25 | 27 |
26 int GetRoutingID() const; | 28 int GetRoutingID() const; |
27 | 29 |
| 30 MediaSession* GetSession(int session_id); |
| 31 |
| 32 void RemovePlayers(MediaSessionObserver* observer); |
| 33 void RemovePlayer(MediaSessionObserver* observer, int player_id); |
| 34 void OnPlayerPaused(MediaSessionObserver* observer, int player_id); |
| 35 |
28 bool Send(IPC::Message* msg); | 36 bool Send(IPC::Message* msg); |
29 | 37 |
30 private: | 38 private: |
31 RenderFrameHost* const render_frame_host_; | 39 RenderFrameHost* const render_frame_host_; |
| 40 ScopedVector<MediaSession> sessions_; |
32 | 41 |
33 DISALLOW_COPY_AND_ASSIGN(BrowserMediaSessionManager); | 42 DISALLOW_COPY_AND_ASSIGN(BrowserMediaSessionManager); |
34 }; | 43 }; |
35 | 44 |
36 } // namespace content | 45 } // namespace content |
37 | 46 |
38 #endif // CONTENT_BROWSER_MEDIA_ANDROID_BROWSER_MEDIA_SESSION_MANAGER_H_ | 47 #endif // CONTENT_BROWSER_MEDIA_ANDROID_BROWSER_MEDIA_SESSION_MANAGER_H_ |
OLD | NEW |