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/renderer/render_view_impl.h" | 5 #include "content/renderer/render_view_impl.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <cmath> | 8 #include <cmath> |
9 #include <memory> | 9 #include <memory> |
10 | 10 |
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
92 #include "content/renderer/render_thread_impl.h" | 92 #include "content/renderer/render_thread_impl.h" |
93 #include "content/renderer/render_widget_fullscreen_pepper.h" | 93 #include "content/renderer/render_widget_fullscreen_pepper.h" |
94 #include "content/renderer/renderer_webapplicationcachehost_impl.h" | 94 #include "content/renderer/renderer_webapplicationcachehost_impl.h" |
95 #include "content/renderer/resizing_mode_selector.h" | 95 #include "content/renderer/resizing_mode_selector.h" |
96 #include "content/renderer/savable_resources.h" | 96 #include "content/renderer/savable_resources.h" |
97 #include "content/renderer/speech_recognition_dispatcher.h" | 97 #include "content/renderer/speech_recognition_dispatcher.h" |
98 #include "content/renderer/web_ui_extension_data.h" | 98 #include "content/renderer/web_ui_extension_data.h" |
99 #include "content/renderer/websharedworker_proxy.h" | 99 #include "content/renderer/websharedworker_proxy.h" |
100 #include "media/audio/audio_output_device.h" | 100 #include "media/audio/audio_output_device.h" |
101 #include "media/base/media_switches.h" | 101 #include "media/base/media_switches.h" |
| 102 #include "media/media_features.h" |
102 #include "media/renderers/audio_renderer_impl.h" | 103 #include "media/renderers/audio_renderer_impl.h" |
103 #include "media/renderers/gpu_video_accelerator_factories.h" | 104 #include "media/renderers/gpu_video_accelerator_factories.h" |
104 #include "net/base/data_url.h" | 105 #include "net/base/data_url.h" |
105 #include "net/base/escape.h" | 106 #include "net/base/escape.h" |
106 #include "net/base/net_errors.h" | 107 #include "net/base/net_errors.h" |
107 #include "net/base/registry_controlled_domains/registry_controlled_domain.h" | 108 #include "net/base/registry_controlled_domains/registry_controlled_domain.h" |
108 #include "net/http/http_util.h" | 109 #include "net/http/http_util.h" |
109 #include "ppapi/features/features.h" | 110 #include "ppapi/features/features.h" |
110 #include "skia/ext/platform_canvas.h" | 111 #include "skia/ext/platform_canvas.h" |
111 #include "third_party/WebKit/public/platform/FilePathConversion.h" | 112 #include "third_party/WebKit/public/platform/FilePathConversion.h" |
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
186 | 187 |
187 #elif defined(OS_MACOSX) | 188 #elif defined(OS_MACOSX) |
188 #include "skia/ext/skia_utils_mac.h" | 189 #include "skia/ext/skia_utils_mac.h" |
189 #endif | 190 #endif |
190 | 191 |
191 #if BUILDFLAG(ENABLE_PLUGINS) | 192 #if BUILDFLAG(ENABLE_PLUGINS) |
192 #include "content/renderer/pepper/pepper_plugin_instance_impl.h" | 193 #include "content/renderer/pepper/pepper_plugin_instance_impl.h" |
193 #include "content/renderer/pepper/pepper_plugin_registry.h" | 194 #include "content/renderer/pepper/pepper_plugin_registry.h" |
194 #endif | 195 #endif |
195 | 196 |
196 #if defined(ENABLE_WEBRTC) | 197 #if BUILDFLAG(ENABLE_WEBRTC) |
197 #include "content/renderer/media/rtc_peer_connection_handler.h" | 198 #include "content/renderer/media/rtc_peer_connection_handler.h" |
198 #include "content/renderer/media/webrtc/peer_connection_dependency_factory.h" | 199 #include "content/renderer/media/webrtc/peer_connection_dependency_factory.h" |
199 #endif | 200 #endif |
200 | 201 |
201 using blink::WebAXObject; | 202 using blink::WebAXObject; |
202 using blink::WebApplicationCacheHost; | 203 using blink::WebApplicationCacheHost; |
203 using blink::WebApplicationCacheHostClient; | 204 using blink::WebApplicationCacheHostClient; |
204 using blink::WebColor; | 205 using blink::WebColor; |
205 using blink::WebConsoleMessage; | 206 using blink::WebConsoleMessage; |
206 using blink::WebData; | 207 using blink::WebData; |
(...skipping 2128 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2335 // We need to grab a pointer to the doomed WebView before we destroy it. | 2336 // We need to grab a pointer to the doomed WebView before we destroy it. |
2336 WebView* doomed = webview_; | 2337 WebView* doomed = webview_; |
2337 RenderWidget::Close(); | 2338 RenderWidget::Close(); |
2338 webview_ = nullptr; | 2339 webview_ = nullptr; |
2339 g_view_map.Get().erase(doomed); | 2340 g_view_map.Get().erase(doomed); |
2340 g_routing_id_view_map.Get().erase(GetRoutingID()); | 2341 g_routing_id_view_map.Get().erase(GetRoutingID()); |
2341 RenderThread::Get()->Send(new ViewHostMsg_Close_ACK(GetRoutingID())); | 2342 RenderThread::Get()->Send(new ViewHostMsg_Close_ACK(GetRoutingID())); |
2342 } | 2343 } |
2343 | 2344 |
2344 void RenderViewImpl::OnPageWasHidden() { | 2345 void RenderViewImpl::OnPageWasHidden() { |
2345 #if defined(OS_ANDROID) && defined(ENABLE_WEBRTC) | 2346 #if defined(OS_ANDROID) && BUILDFLAG(ENABLE_WEBRTC) |
2346 RenderThreadImpl::current()->video_capture_impl_manager()-> | 2347 RenderThreadImpl::current()->video_capture_impl_manager()-> |
2347 SuspendDevices(true); | 2348 SuspendDevices(true); |
2348 if (speech_recognition_dispatcher_) | 2349 if (speech_recognition_dispatcher_) |
2349 speech_recognition_dispatcher_->AbortAllRecognitions(); | 2350 speech_recognition_dispatcher_->AbortAllRecognitions(); |
2350 #endif | 2351 #endif |
2351 | 2352 |
2352 if (webview()) { | 2353 if (webview()) { |
2353 // TODO(lfg): It's not correct to defer the page visibility to the main | 2354 // TODO(lfg): It's not correct to defer the page visibility to the main |
2354 // frame. Currently, this is done because the main frame may override the | 2355 // frame. Currently, this is done because the main frame may override the |
2355 // visibility of the page when prerendering. In order to fix this, | 2356 // visibility of the page when prerendering. In order to fix this, |
2356 // prerendering must be made aware of OOPIFs. https://crbug.com/440544 | 2357 // prerendering must be made aware of OOPIFs. https://crbug.com/440544 |
2357 blink::WebPageVisibilityState visibilityState = | 2358 blink::WebPageVisibilityState visibilityState = |
2358 GetMainRenderFrame() ? GetMainRenderFrame()->visibilityState() | 2359 GetMainRenderFrame() ? GetMainRenderFrame()->visibilityState() |
2359 : blink::WebPageVisibilityStateHidden; | 2360 : blink::WebPageVisibilityStateHidden; |
2360 webview()->setVisibilityState(visibilityState, false); | 2361 webview()->setVisibilityState(visibilityState, false); |
2361 } | 2362 } |
2362 } | 2363 } |
2363 | 2364 |
2364 void RenderViewImpl::OnPageWasShown() { | 2365 void RenderViewImpl::OnPageWasShown() { |
2365 #if defined(OS_ANDROID) && defined(ENABLE_WEBRTC) | 2366 #if defined(OS_ANDROID) && BUILDFLAG(ENABLE_WEBRTC) |
2366 RenderThreadImpl::current()->video_capture_impl_manager()-> | 2367 RenderThreadImpl::current()->video_capture_impl_manager()-> |
2367 SuspendDevices(false); | 2368 SuspendDevices(false); |
2368 #endif | 2369 #endif |
2369 | 2370 |
2370 if (webview()) { | 2371 if (webview()) { |
2371 blink::WebPageVisibilityState visibilityState = | 2372 blink::WebPageVisibilityState visibilityState = |
2372 GetMainRenderFrame() ? GetMainRenderFrame()->visibilityState() | 2373 GetMainRenderFrame() ? GetMainRenderFrame()->visibilityState() |
2373 : blink::WebPageVisibilityStateVisible; | 2374 : blink::WebPageVisibilityStateVisible; |
2374 webview()->setVisibilityState(visibilityState, false); | 2375 webview()->setVisibilityState(visibilityState, false); |
2375 } | 2376 } |
(...skipping 406 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2782 INPUT_EVENT_ACK_STATE_NOT_CONSUMED); | 2783 INPUT_EVENT_ACK_STATE_NOT_CONSUMED); |
2783 } | 2784 } |
2784 | 2785 |
2785 std::unique_ptr<InputEventAck> ack( | 2786 std::unique_ptr<InputEventAck> ack( |
2786 new InputEventAck(InputEventAckSource::MAIN_THREAD, input_event->type, | 2787 new InputEventAck(InputEventAckSource::MAIN_THREAD, input_event->type, |
2787 INPUT_EVENT_ACK_STATE_NOT_CONSUMED)); | 2788 INPUT_EVENT_ACK_STATE_NOT_CONSUMED)); |
2788 OnInputEventAck(std::move(ack)); | 2789 OnInputEventAck(std::move(ack)); |
2789 } | 2790 } |
2790 | 2791 |
2791 } // namespace content | 2792 } // namespace content |
OLD | NEW |