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_BROWSER_MEDIA_ANDROID_BROWSER_MEDIA_PLAYER_MANAGER_H_ | 5 #ifndef CONTENT_BROWSER_MEDIA_ANDROID_BROWSER_MEDIA_PLAYER_MANAGER_H_ |
6 #define CONTENT_BROWSER_MEDIA_ANDROID_BROWSER_MEDIA_PLAYER_MANAGER_H_ | 6 #define CONTENT_BROWSER_MEDIA_ANDROID_BROWSER_MEDIA_PLAYER_MANAGER_H_ |
7 | 7 |
8 #include <map> | 8 #include <map> |
9 #include <set> | 9 #include <set> |
10 #include <string> | 10 #include <string> |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
42 : public WebContentsObserver, | 42 : public WebContentsObserver, |
43 public media::MediaPlayerManager { | 43 public media::MediaPlayerManager { |
44 public: | 44 public: |
45 // Permits embedders to provide an extended version of the class. | 45 // Permits embedders to provide an extended version of the class. |
46 typedef BrowserMediaPlayerManager* (*Factory)(RenderViewHost*); | 46 typedef BrowserMediaPlayerManager* (*Factory)(RenderViewHost*); |
47 static void RegisterFactory(Factory factory); | 47 static void RegisterFactory(Factory factory); |
48 | 48 |
49 // Returns a new instance using the registered factory if available. | 49 // Returns a new instance using the registered factory if available. |
50 static BrowserMediaPlayerManager* Create(RenderViewHost* rvh); | 50 static BrowserMediaPlayerManager* Create(RenderViewHost* rvh); |
51 | 51 |
52 ContentViewCoreImpl* GetContentViewCore() const; | 52 ContentViewCoreImpl* GetContentViewCore() const; |
bulach
2014/02/13 12:02:44
nit: ditto..
| |
53 | 53 |
54 virtual ~BrowserMediaPlayerManager(); | 54 virtual ~BrowserMediaPlayerManager(); |
55 | 55 |
56 // WebContentsObserver overrides. | 56 // WebContentsObserver overrides. |
57 virtual bool OnMessageReceived(const IPC::Message& message) OVERRIDE; | 57 virtual bool OnMessageReceived(const IPC::Message& message) OVERRIDE; |
58 | 58 |
59 // Fullscreen video playback controls. | 59 // Fullscreen video playback controls. |
60 virtual void FullscreenPlayerPlay(); | 60 virtual void FullscreenPlayerPlay(); |
61 virtual void FullscreenPlayerPause(); | 61 virtual void FullscreenPlayerPause(); |
62 virtual void FullscreenPlayerSeek(int msec); | 62 virtual void FullscreenPlayerSeek(int msec); |
63 virtual void ExitFullscreen(bool release_media_player); | 63 virtual void ExitFullscreen(bool release_media_player); |
64 virtual void SetVideoSurface(gfx::ScopedJavaSurface surface); | 64 virtual void SetVideoSurface(gfx::ScopedJavaSurface surface); |
65 virtual void SuspendFullscreen(); | |
66 virtual void ResumeFullscreen(gfx::ScopedJavaSurface surface); | |
67 | 65 |
68 // Called when browser player wants the renderer media element to seek. | 66 // Called when browser player wants the renderer media element to seek. |
69 // Any actual seek started by renderer will be handled by browser in OnSeek(). | 67 // Any actual seek started by renderer will be handled by browser in OnSeek(). |
70 void OnSeekRequest(int player_id, const base::TimeDelta& time_to_seek); | 68 void OnSeekRequest(int player_id, const base::TimeDelta& time_to_seek); |
71 | 69 |
72 // media::MediaPlayerManager overrides. | 70 // media::MediaPlayerManager overrides. |
73 virtual void OnTimeUpdate( | 71 virtual void OnTimeUpdate( |
74 int player_id, base::TimeDelta current_time) OVERRIDE; | 72 int player_id, base::TimeDelta current_time) OVERRIDE; |
75 virtual void OnMediaMetadataChanged( | 73 virtual void OnMediaMetadataChanged( |
76 int player_id, | 74 int player_id, |
(...skipping 147 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
224 // The fullscreen video view object or NULL if video is not played in | 222 // The fullscreen video view object or NULL if video is not played in |
225 // fullscreen. | 223 // fullscreen. |
226 scoped_ptr<ContentVideoView> video_view_; | 224 scoped_ptr<ContentVideoView> video_view_; |
227 | 225 |
228 // Player ID of the fullscreen media player. | 226 // Player ID of the fullscreen media player. |
229 int fullscreen_player_id_; | 227 int fullscreen_player_id_; |
230 | 228 |
231 // The player ID pending to enter fullscreen. | 229 // The player ID pending to enter fullscreen. |
232 int pending_fullscreen_player_id_; | 230 int pending_fullscreen_player_id_; |
233 | 231 |
232 // Whether the fullscreen player has been Release()-d. | |
233 bool fullscreen_player_is_released_; | |
234 | |
234 WebContents* web_contents_; | 235 WebContents* web_contents_; |
235 | 236 |
236 // Object for retrieving resources media players. | 237 // Object for retrieving resources media players. |
237 scoped_ptr<media::MediaResourceGetter> media_resource_getter_; | 238 scoped_ptr<media::MediaResourceGetter> media_resource_getter_; |
238 | 239 |
239 base::WeakPtrFactory<BrowserMediaPlayerManager> weak_ptr_factory_; | 240 base::WeakPtrFactory<BrowserMediaPlayerManager> weak_ptr_factory_; |
240 | 241 |
241 DISALLOW_COPY_AND_ASSIGN(BrowserMediaPlayerManager); | 242 DISALLOW_COPY_AND_ASSIGN(BrowserMediaPlayerManager); |
242 }; | 243 }; |
243 | 244 |
244 } // namespace content | 245 } // namespace content |
245 | 246 |
246 #endif // CONTENT_BROWSER_MEDIA_ANDROID_BROWSER_MEDIA_PLAYER_MANAGER_H_ | 247 #endif // CONTENT_BROWSER_MEDIA_ANDROID_BROWSER_MEDIA_PLAYER_MANAGER_H_ |
OLD | NEW |