OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 WEBKIT_MEDIA_ANDROID_WEBMEDIAPLAYER_MANAGER_ANDROID_H_ | 5 #ifndef WEBKIT_MEDIA_ANDROID_WEBMEDIAPLAYER_MANAGER_ANDROID_H_ |
6 #define WEBKIT_MEDIA_ANDROID_WEBMEDIAPLAYER_MANAGER_ANDROID_H_ | 6 #define WEBKIT_MEDIA_ANDROID_WEBMEDIAPLAYER_MANAGER_ANDROID_H_ |
7 | 7 |
8 #include <map> | 8 #include <map> |
9 | 9 |
10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
11 | 11 |
| 12 namespace WebKit { |
| 13 class WebFrame; |
| 14 } |
| 15 |
12 namespace webkit_media { | 16 namespace webkit_media { |
13 | 17 |
14 class WebMediaPlayerAndroid; | 18 class WebMediaPlayerAndroid; |
15 | 19 |
16 // Class for managing all the WebMediaPlayerAndroid objects in the same | 20 // Class for managing all the WebMediaPlayerAndroid objects in the same |
17 // RenderView. | 21 // RenderView. |
18 class WebMediaPlayerManagerAndroid { | 22 class WebMediaPlayerManagerAndroid { |
19 public: | 23 public: |
20 WebMediaPlayerManagerAndroid(); | 24 WebMediaPlayerManagerAndroid(); |
21 virtual ~WebMediaPlayerManagerAndroid(); | 25 virtual ~WebMediaPlayerManagerAndroid(); |
22 | 26 |
23 // Register and unregister a WebMediaPlayerAndroid object. | 27 // Register and unregister a WebMediaPlayerAndroid object. |
24 int RegisterMediaPlayer(WebMediaPlayerAndroid* player); | 28 int RegisterMediaPlayer(WebMediaPlayerAndroid* player); |
25 void UnregisterMediaPlayer(int player_id); | 29 void UnregisterMediaPlayer(int player_id); |
26 | 30 |
27 // Release all the media resources managed by this object. | 31 // Release all the media resources managed by this object. |
28 void ReleaseMediaResources(); | 32 void ReleaseMediaResources(); |
29 | 33 |
| 34 // Check whether a player can enter fullscreen. |
| 35 bool CanEnterFullscreen(WebKit::WebFrame* frame); |
| 36 |
| 37 // Called when a player entered or exited fullscreen. |
| 38 void DidEnterFullscreen(WebKit::WebFrame* frame); |
| 39 void DidExitFullscreen(); |
| 40 |
| 41 // Check whether the Webframe is in fullscreen. |
| 42 bool IsInFullscreen(WebKit::WebFrame* frame); |
| 43 |
30 // Get the pointer to WebMediaPlayerAndroid given the |player_id|. | 44 // Get the pointer to WebMediaPlayerAndroid given the |player_id|. |
31 WebMediaPlayerAndroid* GetMediaPlayer(int player_id); | 45 WebMediaPlayerAndroid* GetMediaPlayer(int player_id); |
32 | 46 |
33 private: | 47 private: |
34 // Info for all available WebMediaPlayerAndroid on a page; kept so that | 48 // Info for all available WebMediaPlayerAndroid on a page; kept so that |
35 // we can enumerate them to send updates about tab focus and visibily. | 49 // we can enumerate them to send updates about tab focus and visibily. |
36 std::map<int32, WebMediaPlayerAndroid*> media_players_; | 50 std::map<int32, WebMediaPlayerAndroid*> media_players_; |
37 | 51 |
38 int32 next_media_player_id_; | 52 int32 next_media_player_id_; |
39 | 53 |
| 54 // WebFrame of the fullscreen video. |
| 55 WebKit::WebFrame* fullscreen_frame_; |
| 56 |
40 DISALLOW_COPY_AND_ASSIGN(WebMediaPlayerManagerAndroid); | 57 DISALLOW_COPY_AND_ASSIGN(WebMediaPlayerManagerAndroid); |
41 }; | 58 }; |
42 | 59 |
43 } // namespace webkit_media | 60 } // namespace webkit_media |
44 | 61 |
45 #endif // WEBKIT_MEDIA_ANDROID_WEBMEDIAPLAYER_MANAGER_ANDROID_H_ | 62 #endif // WEBKIT_MEDIA_ANDROID_WEBMEDIAPLAYER_MANAGER_ANDROID_H_ |
OLD | NEW |