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 #include <vector> | 10 #include <vector> |
11 | 11 |
12 #include "base/basictypes.h" | 12 #include "base/basictypes.h" |
13 #include "base/time/time.h" | 13 #include "base/time/time.h" |
14 #include "content/common/media/cdm_messages_enums.h" | 14 #include "content/common/media/cdm_messages_enums.h" |
15 #include "content/common/media/media_player_messages_enums_android.h" | 15 #include "content/common/media/media_player_messages_enums_android.h" |
16 #include "content/public/renderer/render_view_observer.h" | 16 #include "content/public/renderer/render_view_observer.h" |
17 #include "media/base/android/media_player_android.h" | 17 #include "media/base/android/media_player_android.h" |
18 #include "media/base/media_keys.h" | 18 #include "media/base/media_keys.h" |
19 #include "url/gurl.h" | 19 #include "url/gurl.h" |
20 | 20 |
21 namespace blink { | 21 namespace blink { |
22 class WebFrame; | 22 class WebFrame; |
23 } | 23 } |
24 | 24 |
25 namespace gfx { | 25 namespace gfx { |
26 class RectF; | 26 class RectF; |
27 } | 27 } |
28 | 28 |
| 29 struct MediaPlayerHostMsg_Initialize_Params; |
| 30 |
29 namespace content { | 31 namespace content { |
30 | |
31 class ProxyMediaKeys; | 32 class ProxyMediaKeys; |
32 class WebMediaPlayerAndroid; | 33 class WebMediaPlayerAndroid; |
33 | 34 |
34 // Class for managing all the WebMediaPlayerAndroid objects in the same | 35 // Class for managing all the WebMediaPlayerAndroid objects in the same |
35 // RenderView. | 36 // RenderView. |
36 class RendererMediaPlayerManager : public RenderViewObserver { | 37 class RendererMediaPlayerManager : public RenderViewObserver { |
37 public: | 38 public: |
38 static const int kInvalidCdmId = 0; | 39 static const int kInvalidCdmId = 0; |
39 | 40 |
40 // Constructs a RendererMediaPlayerManager object for the |render_view|. | 41 // Constructs a RendererMediaPlayerManager object for the |render_view|. |
41 RendererMediaPlayerManager(RenderView* render_view); | 42 RendererMediaPlayerManager(RenderView* render_view); |
42 virtual ~RendererMediaPlayerManager(); | 43 virtual ~RendererMediaPlayerManager(); |
43 | 44 |
44 // RenderViewObserver overrides. | 45 // RenderViewObserver overrides. |
45 virtual bool OnMessageReceived(const IPC::Message& msg) OVERRIDE; | 46 virtual bool OnMessageReceived(const IPC::Message& msg) OVERRIDE; |
46 | 47 |
47 // Initializes a MediaPlayerAndroid object in browser process. | 48 // Initializes a MediaPlayerAndroid object in browser process. |
48 void Initialize(MediaPlayerHostMsg_Initialize_Type type, | 49 void Initialize(MediaPlayerHostMsg_Initialize_Type type, |
49 int player_id, | 50 int player_id, |
50 const GURL& url, | 51 const GURL& url, |
51 const GURL& first_party_for_cookies, | 52 const GURL& first_party_for_cookies, |
52 int demuxer_client_id); | 53 int demuxer_client_id, |
| 54 const GURL& frame_url); |
53 | 55 |
54 // Starts the player. | 56 // Starts the player. |
55 void Start(int player_id); | 57 void Start(int player_id); |
56 | 58 |
57 // Pauses the player. | 59 // Pauses the player. |
58 // is_media_related_action should be true if this pause is coming from an | 60 // is_media_related_action should be true if this pause is coming from an |
59 // an action that explicitly pauses the video (user pressing pause, JS, etc.) | 61 // an action that explicitly pauses the video (user pressing pause, JS, etc.) |
60 // Otherwise it should be false if Pause is being called due to other reasons | 62 // Otherwise it should be false if Pause is being called due to other reasons |
61 // (cleanup, freeing resources, etc.) | 63 // (cleanup, freeing resources, etc.) |
62 void Pause(int player_id, bool is_media_related_action); | 64 void Pause(int player_id, bool is_media_related_action); |
(...skipping 141 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
204 | 206 |
205 // WebFrame of pending fullscreen request. | 207 // WebFrame of pending fullscreen request. |
206 blink::WebFrame* pending_fullscreen_frame_; | 208 blink::WebFrame* pending_fullscreen_frame_; |
207 | 209 |
208 DISALLOW_COPY_AND_ASSIGN(RendererMediaPlayerManager); | 210 DISALLOW_COPY_AND_ASSIGN(RendererMediaPlayerManager); |
209 }; | 211 }; |
210 | 212 |
211 } // namespace content | 213 } // namespace content |
212 | 214 |
213 #endif // CONTENT_RENDERER_MEDIA_ANDROID_RENDERER_MEDIA_PLAYER_MANAGER_H_ | 215 #endif // CONTENT_RENDERER_MEDIA_ANDROID_RENDERER_MEDIA_PLAYER_MANAGER_H_ |
OLD | NEW |