OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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_RENDERER_MEDIA_ANDROID_RENDERER_MEDIA_PLAYER_MANAGER_H_ | 5 #ifndef CONTENT_RENDERER_MEDIA_ANDROID_RENDERER_MEDIA_PLAYER_MANAGER_H_ |
6 #define CONTENT_RENDERER_MEDIA_ANDROID_RENDERER_MEDIA_PLAYER_MANAGER_H_ | 6 #define CONTENT_RENDERER_MEDIA_ANDROID_RENDERER_MEDIA_PLAYER_MANAGER_H_ |
7 | 7 |
8 #include <map> | 8 #include <map> |
9 #include <string> | 9 #include <string> |
10 | 10 |
(...skipping 20 matching lines...) Expand all Loading... |
31 // Class for managing all the WebMediaPlayerAndroid objects in the same | 31 // Class for managing all the WebMediaPlayerAndroid objects in the same |
32 // RenderFrame. | 32 // RenderFrame. |
33 class RendererMediaPlayerManager : public RenderFrameObserver { | 33 class RendererMediaPlayerManager : public RenderFrameObserver { |
34 public: | 34 public: |
35 // Constructs a RendererMediaPlayerManager object for the |render_frame|. | 35 // Constructs a RendererMediaPlayerManager object for the |render_frame|. |
36 explicit RendererMediaPlayerManager(RenderFrame* render_frame); | 36 explicit RendererMediaPlayerManager(RenderFrame* render_frame); |
37 virtual ~RendererMediaPlayerManager(); | 37 virtual ~RendererMediaPlayerManager(); |
38 | 38 |
39 // RenderFrameObserver overrides. | 39 // RenderFrameObserver overrides. |
40 virtual bool OnMessageReceived(const IPC::Message& msg) OVERRIDE; | 40 virtual bool OnMessageReceived(const IPC::Message& msg) OVERRIDE; |
| 41 virtual void WasHidden() OVERRIDE; |
41 | 42 |
42 // Initializes a MediaPlayerAndroid object in browser process. | 43 // Initializes a MediaPlayerAndroid object in browser process. |
43 void Initialize(MediaPlayerHostMsg_Initialize_Type type, | 44 void Initialize(MediaPlayerHostMsg_Initialize_Type type, |
44 int player_id, | 45 int player_id, |
45 const GURL& url, | 46 const GURL& url, |
46 const GURL& first_party_for_cookies, | 47 const GURL& first_party_for_cookies, |
47 int demuxer_client_id, | 48 int demuxer_client_id, |
48 const GURL& frame_url, | 49 const GURL& frame_url, |
49 bool allow_credentials); | 50 bool allow_credentials); |
50 | 51 |
(...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
147 void OnMediaPlayerReleased(int player_id); | 148 void OnMediaPlayerReleased(int player_id); |
148 void OnConnectedToRemoteDevice(int player_id, | 149 void OnConnectedToRemoteDevice(int player_id, |
149 const std::string& remote_playback_message); | 150 const std::string& remote_playback_message); |
150 void OnDisconnectedFromRemoteDevice(int player_id); | 151 void OnDisconnectedFromRemoteDevice(int player_id); |
151 void OnDidExitFullscreen(int player_id); | 152 void OnDidExitFullscreen(int player_id); |
152 void OnDidEnterFullscreen(int player_id); | 153 void OnDidEnterFullscreen(int player_id); |
153 void OnPlayerPlay(int player_id); | 154 void OnPlayerPlay(int player_id); |
154 void OnPlayerPause(int player_id); | 155 void OnPlayerPause(int player_id); |
155 void OnRequestFullscreen(int player_id); | 156 void OnRequestFullscreen(int player_id); |
156 void OnRemoteRouteAvailabilityChanged(int player_id, bool routes_available); | 157 void OnRemoteRouteAvailabilityChanged(int player_id, bool routes_available); |
157 void OnPauseVideo(); | |
158 | 158 |
159 // Release all video player resources. | 159 // Release all video player resources. |
160 // If something is in progress the resource will not be freed. It will | 160 // If something is in progress the resource will not be freed. It will |
161 // only be freed once the tab is destroyed or if the user navigates away | 161 // only be freed once the tab is destroyed or if the user navigates away |
162 // via WebMediaPlayerAndroid::Destroy. | 162 // via WebMediaPlayerAndroid::Destroy. |
163 void ReleaseVideoResources(); | 163 void ReleaseVideoResources(); |
164 | 164 |
165 // Info for all available WebMediaPlayerAndroid on a page; kept so that | 165 // Info for all available WebMediaPlayerAndroid on a page; kept so that |
166 // we can enumerate them to send updates about tab focus and visibility. | 166 // we can enumerate them to send updates about tab focus and visibility. |
167 std::map<int, WebMediaPlayerAndroid*> media_players_; | 167 std::map<int, WebMediaPlayerAndroid*> media_players_; |
168 | 168 |
169 int next_media_player_id_; | 169 int next_media_player_id_; |
170 | 170 |
171 // WebFrame of the fullscreen video. | 171 // WebFrame of the fullscreen video. |
172 blink::WebFrame* fullscreen_frame_; | 172 blink::WebFrame* fullscreen_frame_; |
173 | 173 |
174 // WebFrame of pending fullscreen request. | 174 // WebFrame of pending fullscreen request. |
175 blink::WebFrame* pending_fullscreen_frame_; | 175 blink::WebFrame* pending_fullscreen_frame_; |
176 | 176 |
177 DISALLOW_COPY_AND_ASSIGN(RendererMediaPlayerManager); | 177 DISALLOW_COPY_AND_ASSIGN(RendererMediaPlayerManager); |
178 }; | 178 }; |
179 | 179 |
180 } // namespace content | 180 } // namespace content |
181 | 181 |
182 #endif // CONTENT_RENDERER_MEDIA_ANDROID_RENDERER_MEDIA_PLAYER_MANAGER_H_ | 182 #endif // CONTENT_RENDERER_MEDIA_ANDROID_RENDERER_MEDIA_PLAYER_MANAGER_H_ |
OLD | NEW |