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 CONTENT_BROWSER_ANDROID_MEDIA_PLAYER_MANAGER_ANDROID_H_ | 5 #ifndef CONTENT_BROWSER_ANDROID_MEDIA_PLAYER_MANAGER_ANDROID_H_ |
6 #define CONTENT_BROWSER_ANDROID_MEDIA_PLAYER_MANAGER_ANDROID_H_ | 6 #define CONTENT_BROWSER_ANDROID_MEDIA_PLAYER_MANAGER_ANDROID_H_ |
7 | 7 |
8 #include <map> | 8 #include <map> |
9 | 9 |
10 #include "base/callback.h" | 10 #include "base/callback.h" |
11 #include "base/memory/scoped_ptr.h" | 11 #include "base/memory/scoped_ptr.h" |
12 #include "base/memory/scoped_vector.h" | 12 #include "base/memory/scoped_vector.h" |
13 #include "base/time.h" | 13 #include "base/time.h" |
14 #include "content/browser/android/content_video_view.h" | 14 #include "content/browser/android/content_video_view.h" |
15 #include "content/public/browser/render_view_host_observer.h" | 15 #include "content/public/browser/render_view_host_observer.h" |
| 16 #include "googleurl/src/gurl.h" |
16 #include "media/base/android/media_player_bridge.h" | 17 #include "media/base/android/media_player_bridge.h" |
17 #include "media/base/android/media_player_bridge_manager.h" | 18 #include "media/base/android/media_player_bridge_manager.h" |
18 | 19 |
19 namespace content { | 20 namespace content { |
20 | 21 |
21 // This class manages all the MediaPlayerBridge objects. It receives | 22 // This class manages all the MediaPlayerBridge objects. It receives |
22 // control operations from the the render process, and forwards | 23 // control operations from the the render process, and forwards |
23 // them to corresponding MediaPlayerBridge object. Callbacks from | 24 // them to corresponding MediaPlayerBridge object. Callbacks from |
24 // MediaPlayerBridge objects are converted to IPCs and then sent to the | 25 // MediaPlayerBridge objects are converted to IPCs and then sent to the |
25 // render process. | 26 // render process. |
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
61 // Release all the players managed by this object. | 62 // Release all the players managed by this object. |
62 void DestroyAllMediaPlayers(); | 63 void DestroyAllMediaPlayers(); |
63 | 64 |
64 media::MediaPlayerBridge* GetFullscreenPlayer(); | 65 media::MediaPlayerBridge* GetFullscreenPlayer(); |
65 media::MediaPlayerBridge* GetPlayer(int player_id); | 66 media::MediaPlayerBridge* GetPlayer(int player_id); |
66 | 67 |
67 private: | 68 private: |
68 // Message handlers. | 69 // Message handlers. |
69 void OnEnterFullscreen(int player_id); | 70 void OnEnterFullscreen(int player_id); |
70 void OnExitFullscreen(int player_id); | 71 void OnExitFullscreen(int player_id); |
71 void OnInitialize(int player_id, const std::string& url, | 72 void OnInitialize(int player_id, const GURL& url, |
72 const std::string& first_party_for_cookies); | 73 const GURL& first_party_for_cookies); |
73 void OnStart(int player_id); | 74 void OnStart(int player_id); |
74 void OnSeek(int player_id, base::TimeDelta time); | 75 void OnSeek(int player_id, base::TimeDelta time); |
75 void OnPause(int player_id); | 76 void OnPause(int player_id); |
76 void OnReleaseResources(int player_id); | 77 void OnReleaseResources(int player_id); |
77 void OnDestroyPlayer(int player_id); | 78 void OnDestroyPlayer(int player_id); |
78 | 79 |
79 // An array of managed players. | 80 // An array of managed players. |
80 ScopedVector<media::MediaPlayerBridge> players_; | 81 ScopedVector<media::MediaPlayerBridge> players_; |
81 | 82 |
82 // The fullscreen video view object. | 83 // The fullscreen video view object. |
83 ContentVideoView video_view_; | 84 ContentVideoView video_view_; |
84 | 85 |
85 // Player ID of the fullscreen media player. | 86 // Player ID of the fullscreen media player. |
86 int fullscreen_player_id_; | 87 int fullscreen_player_id_; |
87 | 88 |
88 DISALLOW_COPY_AND_ASSIGN(MediaPlayerManagerAndroid); | 89 DISALLOW_COPY_AND_ASSIGN(MediaPlayerManagerAndroid); |
89 }; | 90 }; |
90 | 91 |
91 } // namespace content | 92 } // namespace content |
92 | 93 |
93 #endif // CONTENT_BROWSER_ANDROID_MEDIA_PLAYER_MANAGER_ANDROID_H_ | 94 #endif // CONTENT_BROWSER_ANDROID_MEDIA_PLAYER_MANAGER_ANDROID_H_ |
OLD | NEW |