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 | 10 |
11 #include "base/basictypes.h" | 11 #include "base/basictypes.h" |
12 #include "base/time/time.h" | 12 #include "base/time/time.h" |
13 #include "content/common/media/media_player_messages_enums_android.h" | 13 #include "content/common/media/media_player_messages_enums_android.h" |
14 #include "content/public/renderer/render_frame_observer.h" | 14 #include "content/public/renderer/render_frame_observer.h" |
15 #include "media/base/android/media_player_android.h" | 15 #include "media/base/android/media_player_android.h" |
16 #include "url/gurl.h" | 16 #include "url/gurl.h" |
17 | 17 |
18 namespace blink { | 18 namespace blink { |
19 class WebFrame; | 19 class WebFrame; |
20 } | 20 } |
21 | 21 |
22 namespace gfx { | 22 namespace gfx { |
23 class RectF; | 23 class RectF; |
24 } | 24 } |
25 | 25 |
| 26 struct MediaPlayerHostMsg_Initialize_Params; |
| 27 |
26 namespace content { | 28 namespace content { |
27 | |
28 class WebMediaPlayerAndroid; | 29 class WebMediaPlayerAndroid; |
29 | 30 |
30 // Class for managing all the WebMediaPlayerAndroid objects in the same | 31 // Class for managing all the WebMediaPlayerAndroid objects in the same |
31 // RenderFrame. | 32 // RenderFrame. |
32 class RendererMediaPlayerManager : public RenderFrameObserver { | 33 class RendererMediaPlayerManager : public RenderFrameObserver { |
33 public: | 34 public: |
34 // Constructs a RendererMediaPlayerManager object for the |render_frame|. | 35 // Constructs a RendererMediaPlayerManager object for the |render_frame|. |
35 explicit RendererMediaPlayerManager(RenderFrame* render_frame); | 36 explicit RendererMediaPlayerManager(RenderFrame* render_frame); |
36 virtual ~RendererMediaPlayerManager(); | 37 virtual ~RendererMediaPlayerManager(); |
37 | 38 |
38 // RenderFrameObserver overrides. | 39 // RenderFrameObserver overrides. |
39 virtual bool OnMessageReceived(const IPC::Message& msg) OVERRIDE; | 40 virtual bool OnMessageReceived(const IPC::Message& msg) OVERRIDE; |
40 | 41 |
41 // Initializes a MediaPlayerAndroid object in browser process. | 42 // Initializes a MediaPlayerAndroid object in browser process. |
42 void Initialize(MediaPlayerHostMsg_Initialize_Type type, | 43 void Initialize(MediaPlayerHostMsg_Initialize_Type type, |
43 int player_id, | 44 int player_id, |
44 const GURL& url, | 45 const GURL& url, |
45 const GURL& first_party_for_cookies, | 46 const GURL& first_party_for_cookies, |
46 int demuxer_client_id); | 47 int demuxer_client_id, |
| 48 const GURL& frame_url); |
47 | 49 |
48 // Starts the player. | 50 // Starts the player. |
49 void Start(int player_id); | 51 void Start(int player_id); |
50 | 52 |
51 // Pauses the player. | 53 // Pauses the player. |
52 // is_media_related_action should be true if this pause is coming from an | 54 // is_media_related_action should be true if this pause is coming from an |
53 // an action that explicitly pauses the video (user pressing pause, JS, etc.) | 55 // an action that explicitly pauses the video (user pressing pause, JS, etc.) |
54 // Otherwise it should be false if Pause is being called due to other reasons | 56 // Otherwise it should be false if Pause is being called due to other reasons |
55 // (cleanup, freeing resources, etc.) | 57 // (cleanup, freeing resources, etc.) |
56 void Pause(int player_id, bool is_media_related_action); | 58 void Pause(int player_id, bool is_media_related_action); |
(...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
160 | 162 |
161 // WebFrame of pending fullscreen request. | 163 // WebFrame of pending fullscreen request. |
162 blink::WebFrame* pending_fullscreen_frame_; | 164 blink::WebFrame* pending_fullscreen_frame_; |
163 | 165 |
164 DISALLOW_COPY_AND_ASSIGN(RendererMediaPlayerManager); | 166 DISALLOW_COPY_AND_ASSIGN(RendererMediaPlayerManager); |
165 }; | 167 }; |
166 | 168 |
167 } // namespace content | 169 } // namespace content |
168 | 170 |
169 #endif // CONTENT_RENDERER_MEDIA_ANDROID_RENDERER_MEDIA_PLAYER_MANAGER_H_ | 171 #endif // CONTENT_RENDERER_MEDIA_ANDROID_RENDERER_MEDIA_PLAYER_MANAGER_H_ |
OLD | NEW |