Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(36)

Side by Side Diff: content/browser/media/android/browser_media_player_manager.h

Issue 1110833004: Move audio focus control from media/ to content/ and make it per WebContents. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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_BROWSER_MEDIA_ANDROID_BROWSER_MEDIA_PLAYER_MANAGER_H_ 5 #ifndef CONTENT_BROWSER_MEDIA_ANDROID_BROWSER_MEDIA_PLAYER_MANAGER_H_
6 #define CONTENT_BROWSER_MEDIA_ANDROID_BROWSER_MEDIA_PLAYER_MANAGER_H_ 6 #define CONTENT_BROWSER_MEDIA_ANDROID_BROWSER_MEDIA_PLAYER_MANAGER_H_
7 7
8 #include "base/basictypes.h" 8 #include "base/basictypes.h"
9 #include "base/callback.h" 9 #include "base/callback.h"
10 #include "base/memory/scoped_ptr.h" 10 #include "base/memory/scoped_ptr.h"
11 #include "base/memory/scoped_vector.h" 11 #include "base/memory/scoped_vector.h"
12 #include "base/time/time.h" 12 #include "base/time/time.h"
13 #include "content/browser/android/content_video_view.h" 13 #include "content/browser/android/content_video_view.h"
14 #include "content/browser/media/android/media_session_observer.h"
14 #include "content/common/content_export.h" 15 #include "content/common/content_export.h"
15 #include "content/common/media/media_player_messages_enums_android.h" 16 #include "content/common/media/media_player_messages_enums_android.h"
16 #include "content/public/browser/android/content_view_core.h" 17 #include "content/public/browser/android/content_view_core.h"
17 #include "ipc/ipc_message.h" 18 #include "ipc/ipc_message.h"
18 #include "media/base/android/media_player_android.h" 19 #include "media/base/android/media_player_android.h"
19 #include "media/base/android/media_player_manager.h" 20 #include "media/base/android/media_player_manager.h"
20 #include "media/base/android/media_url_interceptor.h" 21 #include "media/base/android/media_url_interceptor.h"
21 #include "ui/gfx/geometry/rect_f.h" 22 #include "ui/gfx/geometry/rect_f.h"
22 #include "url/gurl.h" 23 #include "url/gurl.h"
23 24
(...skipping 10 matching lines...) Expand all
34 class MediaPlayersObserver; 35 class MediaPlayersObserver;
35 class RenderFrameHost; 36 class RenderFrameHost;
36 class WebContents; 37 class WebContents;
37 38
38 // This class manages all the MediaPlayerAndroid objects. 39 // This class manages all the MediaPlayerAndroid objects.
39 // It receives control operations from the the render process, and forwards 40 // It receives control operations from the the render process, and forwards
40 // them to corresponding MediaPlayerAndroid object. Callbacks from 41 // them to corresponding MediaPlayerAndroid object. Callbacks from
41 // MediaPlayerAndroid objects are converted to IPCs and then sent to the render 42 // MediaPlayerAndroid objects are converted to IPCs and then sent to the render
42 // process. 43 // process.
43 class CONTENT_EXPORT BrowserMediaPlayerManager 44 class CONTENT_EXPORT BrowserMediaPlayerManager
44 : public media::MediaPlayerManager { 45 : public media::MediaPlayerManager,
46 public MediaSessionObserver {
45 public: 47 public:
46 // Permits embedders to provide an extended version of the class. 48 // Permits embedders to provide an extended version of the class.
47 typedef BrowserMediaPlayerManager* (*Factory)(RenderFrameHost*, 49 typedef BrowserMediaPlayerManager* (*Factory)(RenderFrameHost*,
48 MediaPlayersObserver*); 50 MediaPlayersObserver*);
49 static void RegisterFactory(Factory factory); 51 static void RegisterFactory(Factory factory);
50 52
51 // Permits embedders to handle custom urls. 53 // Permits embedders to handle custom urls.
52 static void RegisterMediaUrlInterceptor( 54 static void RegisterMediaUrlInterceptor(
53 media::MediaUrlInterceptor* media_url_interceptor); 55 media::MediaUrlInterceptor* media_url_interceptor);
54 56
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
90 void OnVideoSizeChanged(int player_id, int width, int height) override; 92 void OnVideoSizeChanged(int player_id, int width, int height) override;
91 void OnAudibleStateChanged( 93 void OnAudibleStateChanged(
92 int player_id, bool is_audible_now) override; 94 int player_id, bool is_audible_now) override;
93 void OnWaitingForDecryptionKey(int player_id) override; 95 void OnWaitingForDecryptionKey(int player_id) override;
94 96
95 media::MediaResourceGetter* GetMediaResourceGetter() override; 97 media::MediaResourceGetter* GetMediaResourceGetter() override;
96 media::MediaUrlInterceptor* GetMediaUrlInterceptor() override; 98 media::MediaUrlInterceptor* GetMediaUrlInterceptor() override;
97 media::MediaPlayerAndroid* GetFullscreenPlayer() override; 99 media::MediaPlayerAndroid* GetFullscreenPlayer() override;
98 media::MediaPlayerAndroid* GetPlayer(int player_id) override; 100 media::MediaPlayerAndroid* GetPlayer(int player_id) override;
99 void RequestFullScreen(int player_id) override; 101 void RequestFullScreen(int player_id) override;
102 bool RequestPlay(int player_id) override;
100 #if defined(VIDEO_HOLE) 103 #if defined(VIDEO_HOLE)
101 void AttachExternalVideoSurface(int player_id, jobject surface); 104 void AttachExternalVideoSurface(int player_id, jobject surface);
102 void DetachExternalVideoSurface(int player_id); 105 void DetachExternalVideoSurface(int player_id);
103 void OnFrameInfoUpdated(); 106 void OnFrameInfoUpdated();
104 #endif // defined(VIDEO_HOLE) 107 #endif // defined(VIDEO_HOLE)
105 108
109 // MediaSessionObserver overrides.
110 void OnSuspend(int player_id) override;
111 void OnResume(int player_id) override;
112
106 // Message handlers. 113 // Message handlers.
107 virtual void OnEnterFullscreen(int player_id); 114 virtual void OnEnterFullscreen(int player_id);
108 virtual void OnExitFullscreen(int player_id); 115 virtual void OnExitFullscreen(int player_id);
109 virtual void OnInitialize( 116 virtual void OnInitialize(
110 const MediaPlayerHostMsg_Initialize_Params& media_player_params); 117 const MediaPlayerHostMsg_Initialize_Params& media_player_params);
111 virtual void OnStart(int player_id); 118 virtual void OnStart(int player_id);
112 virtual void OnSeek(int player_id, const base::TimeDelta& time); 119 virtual void OnSeek(int player_id, const base::TimeDelta& time);
113 virtual void OnPause(int player_id, bool is_media_related_action); 120 virtual void OnPause(int player_id, bool is_media_related_action);
114 virtual void OnSetVolume(int player_id, double volume); 121 virtual void OnSetVolume(int player_id, double volume);
115 virtual void OnSetPoster(int player_id, const GURL& poster); 122 virtual void OnSetPoster(int player_id, const GURL& poster);
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after
202 209
203 // NOTE: Weak pointers must be invalidated before all other member variables. 210 // NOTE: Weak pointers must be invalidated before all other member variables.
204 base::WeakPtrFactory<BrowserMediaPlayerManager> weak_ptr_factory_; 211 base::WeakPtrFactory<BrowserMediaPlayerManager> weak_ptr_factory_;
205 212
206 DISALLOW_COPY_AND_ASSIGN(BrowserMediaPlayerManager); 213 DISALLOW_COPY_AND_ASSIGN(BrowserMediaPlayerManager);
207 }; 214 };
208 215
209 } // namespace content 216 } // namespace content
210 217
211 #endif // CONTENT_BROWSER_MEDIA_ANDROID_BROWSER_MEDIA_PLAYER_MANAGER_H_ 218 #endif // CONTENT_BROWSER_MEDIA_ANDROID_BROWSER_MEDIA_PLAYER_MANAGER_H_
OLDNEW
« no previous file with comments | « content/browser/android/browser_jni_registrar.cc ('k') | content/browser/media/android/browser_media_player_manager.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698