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

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

Issue 1580493004: Plumb audio focus support for spitzer clients. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@delegate_hookup
Patch Set: Detangle. Cleanup. Created 4 years, 11 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 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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_MEDIA_WEB_CONTENTS_OBSERVER_ANDROID_H_ 5 #ifndef CONTENT_BROWSER_MEDIA_ANDROID_MEDIA_WEB_CONTENTS_OBSERVER_ANDROID_H_
6 #define CONTENT_BROWSER_MEDIA_ANDROID_MEDIA_WEB_CONTENTS_OBSERVER_ANDROID_H_ 6 #define CONTENT_BROWSER_MEDIA_ANDROID_MEDIA_WEB_CONTENTS_OBSERVER_ANDROID_H_
7 7
8 #include <stdint.h> 8 #include <stdint.h>
9 9
10 #include "base/containers/scoped_ptr_hash_map.h" 10 #include "base/containers/scoped_ptr_hash_map.h"
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after
51 51
52 #if defined(VIDEO_HOLE) 52 #if defined(VIDEO_HOLE)
53 void OnFrameInfoUpdated(); 53 void OnFrameInfoUpdated();
54 #endif // defined(VIDEO_HOLE) 54 #endif // defined(VIDEO_HOLE)
55 55
56 // MediaWebContentsObserverAndroid overrides. 56 // MediaWebContentsObserverAndroid overrides.
57 void RenderFrameDeleted(RenderFrameHost* render_frame_host) override; 57 void RenderFrameDeleted(RenderFrameHost* render_frame_host) override;
58 bool OnMessageReceived(const IPC::Message& message, 58 bool OnMessageReceived(const IPC::Message& message,
59 RenderFrameHost* render_frame_host) override; 59 RenderFrameHost* render_frame_host) override;
60 60
61 protected:
62 void CheckFocus(int render_frame_id,
63 const base::Closure& on_focus_cb) override;
64
61 private: 65 private:
62 // Handles messages for the media player delegate; does not modify the handled 66 // Handles messages for the media player delegate; does not modify the handled
63 // state since the superclass needs to handle these as well. 67 // state since the superclass needs to handle these as well.
64 void OnMediaPlayerDelegateMessageReceived(const IPC::Message& msg, 68 void OnMediaPlayerDelegateMessageReceived(const IPC::Message& msg,
65 RenderFrameHost* render_frame_host); 69 RenderFrameHost* render_frame_host);
66 void OnMediaDestroyedNotification(RenderFrameHost* render_frame_host, 70 void OnMediaDestroyedNotification(RenderFrameHost* render_frame_host,
67 int64_t player_cookie); 71 int64_t player_cookie);
68 void OnMediaPlayingNotification(RenderFrameHost* render_frame_host, 72 void OnMediaPlayingNotification(RenderFrameHost* render_frame_host,
69 int64_t player_cookie, 73 int64_t player_cookie,
70 bool has_video, 74 bool has_video,
(...skipping 24 matching lines...) Expand all
95 using MediaSessionManagerMap = 99 using MediaSessionManagerMap =
96 base::ScopedPtrHashMap<RenderFrameHost*, 100 base::ScopedPtrHashMap<RenderFrameHost*,
97 scoped_ptr<BrowserMediaSessionManager>>; 101 scoped_ptr<BrowserMediaSessionManager>>;
98 MediaSessionManagerMap media_session_managers_; 102 MediaSessionManagerMap media_session_managers_;
99 103
100 // Map of renderer side media players to session controllers. 104 // Map of renderer side media players to session controllers.
101 using MediaSessionMap = 105 using MediaSessionMap =
102 std::map<MediaPlayerId, scoped_ptr<MediaSessionController>>; 106 std::map<MediaPlayerId, scoped_ptr<MediaSessionController>>;
103 MediaSessionMap media_session_map_; 107 MediaSessionMap media_session_map_;
104 108
109 // Map of deferred focus callbacks needing fulfillment.
110 std::map<int, std::vector<base::Closure>> deferred_focus_cbs_;
111
105 DISALLOW_COPY_AND_ASSIGN(MediaWebContentsObserverAndroid); 112 DISALLOW_COPY_AND_ASSIGN(MediaWebContentsObserverAndroid);
106 }; 113 };
107 114
108 } // namespace content 115 } // namespace content
109 116
110 #endif // CONTENT_BROWSER_MEDIA_ANDROID_MEDIA_WEB_CONTENTS_OBSERVER_ANDROID_H_ 117 #endif // CONTENT_BROWSER_MEDIA_ANDROID_MEDIA_WEB_CONTENTS_OBSERVER_ANDROID_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698