OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 30 matching lines...) Expand all Loading... |
41 | 41 |
42 #if defined(VIDEO_HOLE) | 42 #if defined(VIDEO_HOLE) |
43 void OnFrameInfoUpdated(); | 43 void OnFrameInfoUpdated(); |
44 #endif // defined(VIDEO_HOLE) | 44 #endif // defined(VIDEO_HOLE) |
45 | 45 |
46 // MediaWebContentsObserverAndroid overrides. | 46 // MediaWebContentsObserverAndroid overrides. |
47 void RenderFrameDeleted(RenderFrameHost* render_frame_host) override; | 47 void RenderFrameDeleted(RenderFrameHost* render_frame_host) override; |
48 bool OnMessageReceived(const IPC::Message& message, | 48 bool OnMessageReceived(const IPC::Message& message, |
49 RenderFrameHost* render_frame_host) override; | 49 RenderFrameHost* render_frame_host) override; |
50 | 50 |
| 51 protected: |
| 52 void CheckFocus(int render_frame_id, |
| 53 const base::Closure& on_focus_cb) override; |
| 54 |
51 private: | 55 private: |
52 // Handles messages for the media player delgate; does not modify the handled | 56 // Handles messages for the media player delgate; does not modify the handled |
53 // state since the superclass needs to handle these as well. | 57 // state since the superclass needs to handle these as well. |
54 void OnMediaPlayerDelegateMessageReceived(const IPC::Message& msg, | 58 void OnMediaPlayerDelegateMessageReceived(const IPC::Message& msg, |
55 RenderFrameHost* render_frame_host); | 59 RenderFrameHost* render_frame_host); |
56 void OnMediaDestroyedNotification(RenderFrameHost* render_frame_host, | 60 void OnMediaDestroyedNotification(RenderFrameHost* render_frame_host, |
57 int64_t player_cookie); | 61 int64_t player_cookie); |
58 void OnMediaPlayingNotification(RenderFrameHost* render_frame_host, | 62 void OnMediaPlayingNotification(RenderFrameHost* render_frame_host, |
59 int64_t player_cookie, | 63 int64_t player_cookie, |
60 bool has_video, | 64 bool has_video, |
(...skipping 24 matching lines...) Expand all Loading... |
85 using MediaSessionManagerMap = | 89 using MediaSessionManagerMap = |
86 base::ScopedPtrHashMap<RenderFrameHost*, | 90 base::ScopedPtrHashMap<RenderFrameHost*, |
87 scoped_ptr<BrowserMediaSessionManager>>; | 91 scoped_ptr<BrowserMediaSessionManager>>; |
88 MediaSessionManagerMap media_session_managers_; | 92 MediaSessionManagerMap media_session_managers_; |
89 | 93 |
90 // Map of renderer side media players to session controllers. | 94 // Map of renderer side media players to session controllers. |
91 using MediaSessionMap = | 95 using MediaSessionMap = |
92 std::map<MediaPlayerId, scoped_ptr<MediaSessionController>>; | 96 std::map<MediaPlayerId, scoped_ptr<MediaSessionController>>; |
93 MediaSessionMap media_session_map_; | 97 MediaSessionMap media_session_map_; |
94 | 98 |
| 99 // Map of deferred focus callbacks needing fulfillment. |
| 100 std::map<int, std::vector<base::Closure>> deferred_focus_cbs_; |
| 101 |
95 DISALLOW_COPY_AND_ASSIGN(MediaWebContentsObserverAndroid); | 102 DISALLOW_COPY_AND_ASSIGN(MediaWebContentsObserverAndroid); |
96 }; | 103 }; |
97 | 104 |
98 } // namespace content | 105 } // namespace content |
99 | 106 |
100 #endif // CONTENT_BROWSER_MEDIA_ANDROID_MEDIA_WEB_CONTENTS_OBSERVER_ANDROID_H_ | 107 #endif // CONTENT_BROWSER_MEDIA_ANDROID_MEDIA_WEB_CONTENTS_OBSERVER_ANDROID_H_ |
OLD | NEW |