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 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
47 #include "content/browser/frame_host/render_frame_host_impl.h" | 47 #include "content/browser/frame_host/render_frame_host_impl.h" |
48 #include "content/browser/frame_host/render_frame_proxy_host.h" | 48 #include "content/browser/frame_host/render_frame_proxy_host.h" |
49 #include "content/browser/frame_host/render_widget_host_view_child_frame.h" | 49 #include "content/browser/frame_host/render_widget_host_view_child_frame.h" |
50 #include "content/browser/geolocation/geolocation_service_context.h" | 50 #include "content/browser/geolocation/geolocation_service_context.h" |
51 #include "content/browser/host_zoom_map_impl.h" | 51 #include "content/browser/host_zoom_map_impl.h" |
52 #include "content/browser/loader/resource_dispatcher_host_impl.h" | 52 #include "content/browser/loader/resource_dispatcher_host_impl.h" |
53 #include "content/browser/manifest/manifest_manager_host.h" | 53 #include "content/browser/manifest/manifest_manager_host.h" |
54 #include "content/browser/media/audio_stream_monitor.h" | 54 #include "content/browser/media/audio_stream_monitor.h" |
55 #include "content/browser/media/capture/web_contents_audio_muter.h" | 55 #include "content/browser/media/capture/web_contents_audio_muter.h" |
56 #include "content/browser/media/media_web_contents_observer.h" | 56 #include "content/browser/media/media_web_contents_observer.h" |
| 57 #include "content/browser/media/session/media_session.h" |
57 #include "content/browser/message_port_message_filter.h" | 58 #include "content/browser/message_port_message_filter.h" |
58 #include "content/browser/plugin_content_origin_whitelist.h" | 59 #include "content/browser/plugin_content_origin_whitelist.h" |
59 #include "content/browser/renderer_host/render_process_host_impl.h" | 60 #include "content/browser/renderer_host/render_process_host_impl.h" |
60 #include "content/browser/renderer_host/render_view_host_delegate_view.h" | 61 #include "content/browser/renderer_host/render_view_host_delegate_view.h" |
61 #include "content/browser/renderer_host/render_view_host_impl.h" | 62 #include "content/browser/renderer_host/render_view_host_impl.h" |
62 #include "content/browser/renderer_host/render_widget_host_impl.h" | 63 #include "content/browser/renderer_host/render_widget_host_impl.h" |
63 #include "content/browser/renderer_host/render_widget_host_input_event_router.h" | 64 #include "content/browser/renderer_host/render_widget_host_input_event_router.h" |
64 #include "content/browser/renderer_host/render_widget_host_view_base.h" | 65 #include "content/browser/renderer_host/render_widget_host_view_base.h" |
65 #include "content/browser/screen_orientation/screen_orientation_dispatcher_host_
impl.h" | 66 #include "content/browser/screen_orientation/screen_orientation_dispatcher_host_
impl.h" |
66 #include "content/browser/site_instance_impl.h" | 67 #include "content/browser/site_instance_impl.h" |
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
119 #include "third_party/WebKit/public/web/WebSandboxFlags.h" | 120 #include "third_party/WebKit/public/web/WebSandboxFlags.h" |
120 #include "third_party/skia/include/core/SkBitmap.h" | 121 #include "third_party/skia/include/core/SkBitmap.h" |
121 #include "ui/base/layout.h" | 122 #include "ui/base/layout.h" |
122 #include "ui/gfx/display.h" | 123 #include "ui/gfx/display.h" |
123 #include "ui/gfx/screen.h" | 124 #include "ui/gfx/screen.h" |
124 #include "ui/gl/gl_switches.h" | 125 #include "ui/gl/gl_switches.h" |
125 | 126 |
126 #if defined(OS_ANDROID) | 127 #if defined(OS_ANDROID) |
127 #include "content/browser/android/content_video_view.h" | 128 #include "content/browser/android/content_video_view.h" |
128 #include "content/browser/android/date_time_chooser_android.h" | 129 #include "content/browser/android/date_time_chooser_android.h" |
129 #include "content/browser/media/android/media_session.h" | |
130 #include "content/browser/media/android/media_web_contents_observer_android.h" | 130 #include "content/browser/media/android/media_web_contents_observer_android.h" |
131 #include "content/browser/web_contents/web_contents_android.h" | 131 #include "content/browser/web_contents/web_contents_android.h" |
132 #endif // OS_ANDROID | 132 #endif // OS_ANDROID |
133 | 133 |
134 #if defined(OS_MACOSX) | 134 #if defined(OS_MACOSX) |
135 #include "base/mac/foundation_util.h" | 135 #include "base/mac/foundation_util.h" |
136 #endif | 136 #endif |
137 | 137 |
138 #if defined(MOJO_SHELL_CLIENT) | 138 #if defined(MOJO_SHELL_CLIENT) |
139 #include "content/browser/web_contents/web_contents_view_mus.h" | 139 #include "content/browser/web_contents/web_contents_view_mus.h" |
(...skipping 3435 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3575 // for the new page has committed. | 3575 // for the new page has committed. |
3576 RenderViewHostImpl* rvhi = | 3576 RenderViewHostImpl* rvhi = |
3577 static_cast<RenderViewHostImpl*>(render_view_message_source_); | 3577 static_cast<RenderViewHostImpl*>(render_view_message_source_); |
3578 if (!rvhi->is_active()) | 3578 if (!rvhi->is_active()) |
3579 return; | 3579 return; |
3580 | 3580 |
3581 FOR_EACH_OBSERVER(WebContentsObserver, observers_, | 3581 FOR_EACH_OBSERVER(WebContentsObserver, observers_, |
3582 DidUpdateFaviconURL(candidates)); | 3582 DidUpdateFaviconURL(candidates)); |
3583 } | 3583 } |
3584 | 3584 |
3585 #if defined(OS_ANDROID) | |
3586 | |
3587 void WebContentsImpl::OnMediaSessionStateChanged() { | 3585 void WebContentsImpl::OnMediaSessionStateChanged() { |
3588 MediaSession* session = MediaSession::Get(this); | 3586 MediaSession* session = MediaSession::Get(this); |
3589 FOR_EACH_OBSERVER(WebContentsObserver, observers_, | 3587 FOR_EACH_OBSERVER(WebContentsObserver, observers_, |
3590 MediaSessionStateChanged(session->IsControllable(), | 3588 MediaSessionStateChanged(session->IsControllable(), |
3591 session->IsSuspended())); | 3589 session->IsSuspended())); |
3592 } | 3590 } |
3593 | 3591 |
3594 void WebContentsImpl::ResumeMediaSession() { | 3592 void WebContentsImpl::ResumeMediaSession() { |
3595 MediaSession::Get(this)->Resume(); | 3593 MediaSession::Get(this)->Resume(MediaSession::SuspendType::UI); |
3596 } | 3594 } |
3597 | 3595 |
3598 void WebContentsImpl::SuspendMediaSession() { | 3596 void WebContentsImpl::SuspendMediaSession() { |
3599 MediaSession::Get(this)->Suspend(); | 3597 MediaSession::Get(this)->Suspend(MediaSession::SuspendType::UI); |
3600 } | 3598 } |
3601 | 3599 |
3602 void WebContentsImpl::StopMediaSession() { | 3600 void WebContentsImpl::StopMediaSession() { |
3603 MediaSession::Get(this)->Stop(); | 3601 MediaSession::Get(this)->Stop(MediaSession::SuspendType::UI); |
3604 } | 3602 } |
3605 | 3603 |
3606 #endif // defined(OS_ANDROID) | |
3607 | |
3608 void WebContentsImpl::OnFirstVisuallyNonEmptyPaint() { | 3604 void WebContentsImpl::OnFirstVisuallyNonEmptyPaint() { |
3609 FOR_EACH_OBSERVER(WebContentsObserver, observers_, | 3605 FOR_EACH_OBSERVER(WebContentsObserver, observers_, |
3610 DidFirstVisuallyNonEmptyPaint()); | 3606 DidFirstVisuallyNonEmptyPaint()); |
3611 | 3607 |
3612 did_first_visually_non_empty_paint_ = true; | 3608 did_first_visually_non_empty_paint_ = true; |
3613 | 3609 |
3614 if (theme_color_ != last_sent_theme_color_) { | 3610 if (theme_color_ != last_sent_theme_color_) { |
3615 // Theme color should have updated by now if there was one. | 3611 // Theme color should have updated by now if there was one. |
3616 FOR_EACH_OBSERVER(WebContentsObserver, observers_, | 3612 FOR_EACH_OBSERVER(WebContentsObserver, observers_, |
3617 DidChangeThemeColor(theme_color_)); | 3613 DidChangeThemeColor(theme_color_)); |
(...skipping 1242 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4860 else | 4856 else |
4861 WasHidden(); | 4857 WasHidden(); |
4862 } | 4858 } |
4863 | 4859 |
4864 void WebContentsImpl::SetJavaScriptDialogManagerForTesting( | 4860 void WebContentsImpl::SetJavaScriptDialogManagerForTesting( |
4865 JavaScriptDialogManager* dialog_manager) { | 4861 JavaScriptDialogManager* dialog_manager) { |
4866 dialog_manager_ = dialog_manager; | 4862 dialog_manager_ = dialog_manager; |
4867 } | 4863 } |
4868 | 4864 |
4869 } // namespace content | 4865 } // namespace content |
OLD | NEW |