OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 #include "content/browser/web_contents/web_contents_impl.h" | 5 #include "content/browser/web_contents/web_contents_impl.h" |
6 | 6 |
7 #include <stddef.h> | 7 #include <stddef.h> |
8 | 8 |
9 #include <cmath> | 9 #include <cmath> |
10 #include <utility> | 10 #include <utility> |
(...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
125 #include "third_party/WebKit/public/web/WebSandboxFlags.h" | 125 #include "third_party/WebKit/public/web/WebSandboxFlags.h" |
126 #include "third_party/skia/include/core/SkBitmap.h" | 126 #include "third_party/skia/include/core/SkBitmap.h" |
127 #include "ui/accessibility/ax_tree_combiner.h" | 127 #include "ui/accessibility/ax_tree_combiner.h" |
128 #include "ui/base/layout.h" | 128 #include "ui/base/layout.h" |
129 #include "ui/events/blink/web_input_event_traits.h" | 129 #include "ui/events/blink/web_input_event_traits.h" |
130 #include "ui/gl/gl_switches.h" | 130 #include "ui/gl/gl_switches.h" |
131 | 131 |
132 #if defined(OS_ANDROID) | 132 #if defined(OS_ANDROID) |
133 #include "content/browser/android/content_video_view.h" | 133 #include "content/browser/android/content_video_view.h" |
134 #include "content/browser/android/date_time_chooser_android.h" | 134 #include "content/browser/android/date_time_chooser_android.h" |
| 135 #include "content/browser/media/android/browser_media_session_manager.h" |
135 #include "content/browser/media/android/media_web_contents_observer_android.h" | 136 #include "content/browser/media/android/media_web_contents_observer_android.h" |
136 #include "content/browser/web_contents/web_contents_android.h" | 137 #include "content/browser/web_contents/web_contents_android.h" |
137 #endif // OS_ANDROID | 138 #endif // OS_ANDROID |
138 | 139 |
139 #if defined(OS_MACOSX) | 140 #if defined(OS_MACOSX) |
140 #include "base/mac/foundation_util.h" | 141 #include "base/mac/foundation_util.h" |
141 #endif | 142 #endif |
142 | 143 |
143 #if defined(USE_AURA) | 144 #if defined(USE_AURA) |
144 #include "content/browser/web_contents/web_contents_view_mus.h" | 145 #include "content/browser/web_contents/web_contents_view_mus.h" |
(...skipping 3662 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3807 static_cast<RenderViewHostImpl*>(render_view_message_source_); | 3808 static_cast<RenderViewHostImpl*>(render_view_message_source_); |
3808 if (!rvhi->is_active()) | 3809 if (!rvhi->is_active()) |
3809 return; | 3810 return; |
3810 | 3811 |
3811 FOR_EACH_OBSERVER(WebContentsObserver, observers_, | 3812 FOR_EACH_OBSERVER(WebContentsObserver, observers_, |
3812 DidUpdateFaviconURL(candidates)); | 3813 DidUpdateFaviconURL(candidates)); |
3813 } | 3814 } |
3814 | 3815 |
3815 void WebContentsImpl::OnMediaSessionStateChanged() { | 3816 void WebContentsImpl::OnMediaSessionStateChanged() { |
3816 MediaSession* session = MediaSession::Get(this); | 3817 MediaSession* session = MediaSession::Get(this); |
| 3818 base::Optional<MediaMetadata> metadata; |
| 3819 #if defined(OS_ANDROID) |
| 3820 BrowserMediaSessionManager* session_manager = |
| 3821 static_cast<MediaWebContentsObserverAndroid*>( |
| 3822 media_web_contents_observer()) |
| 3823 ->GetMediaSessionManager(GetMainFrame()); |
| 3824 if (session_manager->media_metadata()) { |
| 3825 metadata = *session_manager->media_metadata(); |
| 3826 } |
| 3827 #endif // defined(OS_ANDROID) |
3817 FOR_EACH_OBSERVER(WebContentsObserver, observers_, | 3828 FOR_EACH_OBSERVER(WebContentsObserver, observers_, |
3818 MediaSessionStateChanged(session->IsControllable(), | 3829 MediaSessionStateChanged(session->IsControllable(), |
3819 session->IsSuspended(), | 3830 session->IsSuspended(), |
3820 session->metadata())); | 3831 metadata)); |
3821 } | 3832 } |
3822 | 3833 |
3823 void WebContentsImpl::ResumeMediaSession() { | 3834 void WebContentsImpl::ResumeMediaSession() { |
3824 MediaSession::Get(this)->Resume(MediaSession::SuspendType::UI); | 3835 MediaSession::Get(this)->Resume(MediaSession::SuspendType::UI); |
3825 } | 3836 } |
3826 | 3837 |
3827 void WebContentsImpl::SuspendMediaSession() { | 3838 void WebContentsImpl::SuspendMediaSession() { |
3828 MediaSession::Get(this)->Suspend(MediaSession::SuspendType::UI); | 3839 MediaSession::Get(this)->Suspend(MediaSession::SuspendType::UI); |
3829 } | 3840 } |
3830 | 3841 |
(...skipping 1372 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5203 for (RenderViewHost* render_view_host : render_view_host_set) | 5214 for (RenderViewHost* render_view_host : render_view_host_set) |
5204 render_view_host->OnWebkitPreferencesChanged(); | 5215 render_view_host->OnWebkitPreferencesChanged(); |
5205 } | 5216 } |
5206 | 5217 |
5207 void WebContentsImpl::SetJavaScriptDialogManagerForTesting( | 5218 void WebContentsImpl::SetJavaScriptDialogManagerForTesting( |
5208 JavaScriptDialogManager* dialog_manager) { | 5219 JavaScriptDialogManager* dialog_manager) { |
5209 dialog_manager_ = dialog_manager; | 5220 dialog_manager_ = dialog_manager; |
5210 } | 5221 } |
5211 | 5222 |
5212 } // namespace content | 5223 } // namespace content |
OLD | NEW |