| OLD | NEW |
| (Empty) |
| 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 | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 #ifndef WEBKIT_RENDERER_MEDIA_ANDROID_WEBMEDIAPLAYER_MANAGER_ANDROID_H_ | |
| 6 #define WEBKIT_RENDERER_MEDIA_ANDROID_WEBMEDIAPLAYER_MANAGER_ANDROID_H_ | |
| 7 | |
| 8 #include <map> | |
| 9 | |
| 10 #include "base/basictypes.h" | |
| 11 | |
| 12 namespace WebKit { | |
| 13 class WebFrame; | |
| 14 } | |
| 15 | |
| 16 namespace gfx { | |
| 17 class RectF; | |
| 18 } | |
| 19 | |
| 20 namespace webkit_media { | |
| 21 | |
| 22 class WebMediaPlayerAndroid; | |
| 23 | |
| 24 // Class for managing all the WebMediaPlayerAndroid objects in the same | |
| 25 // RenderView. | |
| 26 class WebMediaPlayerManagerAndroid { | |
| 27 public: | |
| 28 WebMediaPlayerManagerAndroid(); | |
| 29 virtual ~WebMediaPlayerManagerAndroid(); | |
| 30 | |
| 31 // Register and unregister a WebMediaPlayerAndroid object. | |
| 32 int RegisterMediaPlayer(WebMediaPlayerAndroid* player); | |
| 33 void UnregisterMediaPlayer(int player_id); | |
| 34 | |
| 35 // Release all the media resources managed by this object unless | |
| 36 // an audio play is in progress, or the app wants to retain video playback. | |
| 37 void ReleaseMediaResources(bool retain_video_playback); | |
| 38 | |
| 39 // Check whether a player can enter fullscreen. | |
| 40 bool CanEnterFullscreen(WebKit::WebFrame* frame); | |
| 41 | |
| 42 // Called when a player entered or exited fullscreen. | |
| 43 void DidEnterFullscreen(WebKit::WebFrame* frame); | |
| 44 void DidExitFullscreen(); | |
| 45 | |
| 46 // Check whether the Webframe is in fullscreen. | |
| 47 bool IsInFullscreen(WebKit::WebFrame* frame); | |
| 48 | |
| 49 // Get the pointer to WebMediaPlayerAndroid given the |player_id|. | |
| 50 WebMediaPlayerAndroid* GetMediaPlayer(int player_id); | |
| 51 | |
| 52 #if defined(GOOGLE_TV) | |
| 53 // Get the list of media players with video geometry changes. | |
| 54 void RetrieveGeometryChanges(std::map<int, gfx::RectF>* changes); | |
| 55 #endif | |
| 56 | |
| 57 private: | |
| 58 // Info for all available WebMediaPlayerAndroid on a page; kept so that | |
| 59 // we can enumerate them to send updates about tab focus and visibily. | |
| 60 std::map<int, WebMediaPlayerAndroid*> media_players_; | |
| 61 | |
| 62 int next_media_player_id_; | |
| 63 | |
| 64 // WebFrame of the fullscreen video. | |
| 65 WebKit::WebFrame* fullscreen_frame_; | |
| 66 | |
| 67 DISALLOW_COPY_AND_ASSIGN(WebMediaPlayerManagerAndroid); | |
| 68 }; | |
| 69 | |
| 70 } // namespace webkit_media | |
| 71 | |
| 72 #endif // WEBKIT_RENDERER_MEDIA_ANDROID_WEBMEDIAPLAYER_MANAGER_ANDROID_H_ | |
| OLD | NEW |