| 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 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 140 base::TimeTicks current_time_ticks); | 141 base::TimeTicks current_time_ticks); |
| 141 void OnMediaPlayerReleased(int player_id); | 142 void OnMediaPlayerReleased(int player_id); |
| 142 void OnConnectedToRemoteDevice(int player_id, | 143 void OnConnectedToRemoteDevice(int player_id, |
| 143 const std::string& remote_playback_message); | 144 const std::string& remote_playback_message); |
| 144 void OnDisconnectedFromRemoteDevice(int player_id); | 145 void OnDisconnectedFromRemoteDevice(int player_id); |
| 145 void OnDidExitFullscreen(int player_id); | 146 void OnDidExitFullscreen(int player_id); |
| 146 void OnDidEnterFullscreen(int player_id); | 147 void OnDidEnterFullscreen(int player_id); |
| 147 void OnPlayerPlay(int player_id); | 148 void OnPlayerPlay(int player_id); |
| 148 void OnPlayerPause(int player_id); | 149 void OnPlayerPause(int player_id); |
| 149 void OnRequestFullscreen(int player_id); | 150 void OnRequestFullscreen(int player_id); |
| 150 void OnPauseVideo(); | |
| 151 | 151 |
| 152 // Release all video player resources. | 152 // Release all video player resources. |
| 153 // If something is in progress the resource will not be freed. It will | 153 // If something is in progress the resource will not be freed. It will |
| 154 // only be freed once the tab is destroyed or if the user navigates away | 154 // only be freed once the tab is destroyed or if the user navigates away |
| 155 // via WebMediaPlayerAndroid::Destroy. | 155 // via WebMediaPlayerAndroid::Destroy. |
| 156 void ReleaseVideoResources(); | 156 void ReleaseVideoResources(); |
| 157 | 157 |
| 158 // Info for all available WebMediaPlayerAndroid on a page; kept so that | 158 // Info for all available WebMediaPlayerAndroid on a page; kept so that |
| 159 // we can enumerate them to send updates about tab focus and visibility. | 159 // we can enumerate them to send updates about tab focus and visibility. |
| 160 std::map<int, WebMediaPlayerAndroid*> media_players_; | 160 std::map<int, WebMediaPlayerAndroid*> media_players_; |
| 161 | 161 |
| 162 int next_media_player_id_; | 162 int next_media_player_id_; |
| 163 | 163 |
| 164 // WebFrame of the fullscreen video. | 164 // WebFrame of the fullscreen video. |
| 165 blink::WebFrame* fullscreen_frame_; | 165 blink::WebFrame* fullscreen_frame_; |
| 166 | 166 |
| 167 // WebFrame of pending fullscreen request. | 167 // WebFrame of pending fullscreen request. |
| 168 blink::WebFrame* pending_fullscreen_frame_; | 168 blink::WebFrame* pending_fullscreen_frame_; |
| 169 | 169 |
| 170 DISALLOW_COPY_AND_ASSIGN(RendererMediaPlayerManager); | 170 DISALLOW_COPY_AND_ASSIGN(RendererMediaPlayerManager); |
| 171 }; | 171 }; |
| 172 | 172 |
| 173 } // namespace content | 173 } // namespace content |
| 174 | 174 |
| 175 #endif // CONTENT_RENDERER_MEDIA_ANDROID_RENDERER_MEDIA_PLAYER_MANAGER_H_ | 175 #endif // CONTENT_RENDERER_MEDIA_ANDROID_RENDERER_MEDIA_PLAYER_MANAGER_H_ |
| OLD | NEW |