OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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_frame_impl.h" | 5 #include "content/renderer/render_frame_impl.h" |
6 | 6 |
7 #include <map> | 7 #include <map> |
8 #include <string> | 8 #include <string> |
9 #include <utility> | 9 #include <utility> |
10 #include <vector> | 10 #include <vector> |
(...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
133 #include "content/renderer/renderer_webapplicationcachehost_impl.h" | 133 #include "content/renderer/renderer_webapplicationcachehost_impl.h" |
134 #include "content/renderer/renderer_webcolorchooser_impl.h" | 134 #include "content/renderer/renderer_webcolorchooser_impl.h" |
135 #include "content/renderer/savable_resources.h" | 135 #include "content/renderer/savable_resources.h" |
136 #include "content/renderer/screen_orientation/screen_orientation_dispatcher.h" | 136 #include "content/renderer/screen_orientation/screen_orientation_dispatcher.h" |
137 #include "content/renderer/shared_worker/shared_worker_repository.h" | 137 #include "content/renderer/shared_worker/shared_worker_repository.h" |
138 #include "content/renderer/shared_worker/websharedworker_proxy.h" | 138 #include "content/renderer/shared_worker/websharedworker_proxy.h" |
139 #include "content/renderer/skia_benchmarking_extension.h" | 139 #include "content/renderer/skia_benchmarking_extension.h" |
140 #include "content/renderer/stats_collection_controller.h" | 140 #include "content/renderer/stats_collection_controller.h" |
141 #include "content/renderer/web_frame_utils.h" | 141 #include "content/renderer/web_frame_utils.h" |
142 #include "content/renderer/web_ui_extension.h" | 142 #include "content/renderer/web_ui_extension.h" |
| 143 #include "content/renderer/web_ui_extension_data.h" |
143 #include "crypto/sha2.h" | 144 #include "crypto/sha2.h" |
144 #include "gin/modules/console.h" | 145 #include "gin/modules/console.h" |
145 #include "gin/modules/module_registry.h" | 146 #include "gin/modules/module_registry.h" |
146 #include "media/audio/audio_output_device.h" | 147 #include "media/audio/audio_output_device.h" |
147 #include "media/base/audio_renderer_mixer_input.h" | 148 #include "media/base/audio_renderer_mixer_input.h" |
148 #include "media/base/cdm_factory.h" | 149 #include "media/base/cdm_factory.h" |
149 #include "media/base/decoder_factory.h" | 150 #include "media/base/decoder_factory.h" |
150 #include "media/base/media.h" | 151 #include "media/base/media.h" |
151 #include "media/base/media_log.h" | 152 #include "media/base/media_log.h" |
152 #include "media/base/media_switches.h" | 153 #include "media/base/media_switches.h" |
(...skipping 969 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1122 is_pasting_(false), | 1123 is_pasting_(false), |
1123 suppress_further_dialogs_(false), | 1124 suppress_further_dialogs_(false), |
1124 blame_context_(nullptr), | 1125 blame_context_(nullptr), |
1125 #if BUILDFLAG(ENABLE_PLUGINS) | 1126 #if BUILDFLAG(ENABLE_PLUGINS) |
1126 focused_pepper_plugin_(nullptr), | 1127 focused_pepper_plugin_(nullptr), |
1127 pepper_last_mouse_event_target_(nullptr), | 1128 pepper_last_mouse_event_target_(nullptr), |
1128 #endif | 1129 #endif |
1129 engagement_binding_(this), | 1130 engagement_binding_(this), |
1130 frame_binding_(this), | 1131 frame_binding_(this), |
1131 host_zoom_binding_(this), | 1132 host_zoom_binding_(this), |
| 1133 frame_bindings_control_binding_(this), |
1132 has_accessed_initial_document_(false), | 1134 has_accessed_initial_document_(false), |
1133 weak_factory_(this) { | 1135 weak_factory_(this) { |
1134 // We don't have a service_manager::Connection at this point, so use empty | 1136 // We don't have a service_manager::Connection at this point, so use empty |
1135 // identity/specs. | 1137 // identity/specs. |
1136 // TODO(beng): We should fix this, so we can apply policy about which | 1138 // TODO(beng): We should fix this, so we can apply policy about which |
1137 // interfaces get exposed. | 1139 // interfaces get exposed. |
1138 interface_registry_ = base::MakeUnique<service_manager::InterfaceRegistry>( | 1140 interface_registry_ = base::MakeUnique<service_manager::InterfaceRegistry>( |
1139 mojom::kNavigation_FrameSpec); | 1141 mojom::kNavigation_FrameSpec); |
1140 service_manager::mojom::InterfaceProviderPtr remote_interfaces; | 1142 service_manager::mojom::InterfaceProviderPtr remote_interfaces; |
1141 pending_remote_interface_provider_request_ = MakeRequest(&remote_interfaces); | 1143 pending_remote_interface_provider_request_ = MakeRequest(&remote_interfaces); |
(...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1242 bool is_tracing_navigation = false; | 1244 bool is_tracing_navigation = false; |
1243 TRACE_EVENT_CATEGORY_GROUP_ENABLED("navigation", &is_tracing_navigation); | 1245 TRACE_EVENT_CATEGORY_GROUP_ENABLED("navigation", &is_tracing_navigation); |
1244 TRACE_EVENT_CATEGORY_GROUP_ENABLED("rail", &is_tracing_rail); | 1246 TRACE_EVENT_CATEGORY_GROUP_ENABLED("rail", &is_tracing_rail); |
1245 if (is_tracing_rail || is_tracing_navigation) { | 1247 if (is_tracing_rail || is_tracing_navigation) { |
1246 int parent_id = GetRoutingIdForFrameOrProxy(frame_->parent()); | 1248 int parent_id = GetRoutingIdForFrameOrProxy(frame_->parent()); |
1247 TRACE_EVENT2("navigation,rail", "RenderFrameImpl::Initialize", | 1249 TRACE_EVENT2("navigation,rail", "RenderFrameImpl::Initialize", |
1248 "id", routing_id_, | 1250 "id", routing_id_, |
1249 "parent", parent_id); | 1251 "parent", parent_id); |
1250 } | 1252 } |
1251 | 1253 |
1252 MaybeEnableMojoBindings(); | |
1253 | |
1254 #if BUILDFLAG(ENABLE_PLUGINS) | 1254 #if BUILDFLAG(ENABLE_PLUGINS) |
1255 new PepperBrowserConnection(this); | 1255 new PepperBrowserConnection(this); |
1256 #endif | 1256 #endif |
1257 shared_worker_repository_ = base::MakeUnique<SharedWorkerRepository>(this); | 1257 shared_worker_repository_ = base::MakeUnique<SharedWorkerRepository>(this); |
1258 GetWebFrame()->setSharedWorkerRepositoryClient( | 1258 GetWebFrame()->setSharedWorkerRepositoryClient( |
1259 shared_worker_repository_.get()); | 1259 shared_worker_repository_.get()); |
1260 | 1260 |
1261 if (IsLocalRoot()) { | 1261 if (IsLocalRoot()) { |
1262 // DevToolsAgent is a RenderFrameObserver, and will destruct itself | 1262 // DevToolsAgent is a RenderFrameObserver, and will destruct itself |
1263 // when |this| is deleted. | 1263 // when |this| is deleted. |
(...skipping 11 matching lines...) Expand all Loading... |
1275 #endif | 1275 #endif |
1276 | 1276 |
1277 RenderThreadImpl* render_thread = RenderThreadImpl::current(); | 1277 RenderThreadImpl* render_thread = RenderThreadImpl::current(); |
1278 // render_thread may be NULL in tests. | 1278 // render_thread may be NULL in tests. |
1279 InputHandlerManager* input_handler_manager = | 1279 InputHandlerManager* input_handler_manager = |
1280 render_thread ? render_thread->input_handler_manager() : nullptr; | 1280 render_thread ? render_thread->input_handler_manager() : nullptr; |
1281 if (input_handler_manager) { | 1281 if (input_handler_manager) { |
1282 DCHECK(render_view_->HasAddedInputHandler()); | 1282 DCHECK(render_view_->HasAddedInputHandler()); |
1283 input_handler_manager->RegisterRoutingID(GetRoutingID()); | 1283 input_handler_manager->RegisterRoutingID(GetRoutingID()); |
1284 } | 1284 } |
| 1285 |
| 1286 const base::CommandLine& command_line = |
| 1287 *base::CommandLine::ForCurrentProcess(); |
| 1288 if (command_line.HasSwitch(switches::kDomAutomationController)) |
| 1289 enabled_bindings_ |= BINDINGS_POLICY_DOM_AUTOMATION; |
| 1290 if (command_line.HasSwitch(switches::kStatsCollectionController)) |
| 1291 enabled_bindings_ |= BINDINGS_POLICY_STATS_COLLECTION; |
1285 } | 1292 } |
1286 | 1293 |
1287 void RenderFrameImpl::InitializeBlameContext(RenderFrameImpl* parent_frame) { | 1294 void RenderFrameImpl::InitializeBlameContext(RenderFrameImpl* parent_frame) { |
1288 DCHECK(!blame_context_); | 1295 DCHECK(!blame_context_); |
1289 blame_context_ = base::MakeUnique<FrameBlameContext>(this, parent_frame); | 1296 blame_context_ = base::MakeUnique<FrameBlameContext>(this, parent_frame); |
1290 blame_context_->Initialize(); | 1297 blame_context_->Initialize(); |
1291 } | 1298 } |
1292 | 1299 |
1293 RenderWidget* RenderFrameImpl::GetRenderWidget() { | 1300 RenderWidget* RenderFrameImpl::GetRenderWidget() { |
1294 return GetLocalRoot()->render_widget_.get(); | 1301 return GetLocalRoot()->render_widget_.get(); |
(...skipping 347 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1642 } | 1649 } |
1643 | 1650 |
1644 void RenderFrameImpl::BindFrame(mojom::FrameRequest request, | 1651 void RenderFrameImpl::BindFrame(mojom::FrameRequest request, |
1645 mojom::FrameHostPtr host) { | 1652 mojom::FrameHostPtr host) { |
1646 frame_binding_.Bind(std::move(request)); | 1653 frame_binding_.Bind(std::move(request)); |
1647 frame_host_ = std::move(host); | 1654 frame_host_ = std::move(host); |
1648 frame_host_->GetInterfaceProvider( | 1655 frame_host_->GetInterfaceProvider( |
1649 std::move(pending_remote_interface_provider_request_)); | 1656 std::move(pending_remote_interface_provider_request_)); |
1650 } | 1657 } |
1651 | 1658 |
| 1659 void RenderFrameImpl::BindFrameBindingsControl( |
| 1660 mojom::FrameBindingsControlAssociatedRequest request) { |
| 1661 frame_bindings_control_binding_.Bind(std::move(request)); |
| 1662 } |
| 1663 |
1652 ManifestManager* RenderFrameImpl::manifest_manager() { | 1664 ManifestManager* RenderFrameImpl::manifest_manager() { |
1653 return manifest_manager_; | 1665 return manifest_manager_; |
1654 } | 1666 } |
1655 | 1667 |
1656 void RenderFrameImpl::SetPendingNavigationParams( | 1668 void RenderFrameImpl::SetPendingNavigationParams( |
1657 std::unique_ptr<NavigationParams> navigation_params) { | 1669 std::unique_ptr<NavigationParams> navigation_params) { |
1658 pending_navigation_params_ = std::move(navigation_params); | 1670 pending_navigation_params_ = std::move(navigation_params); |
1659 } | 1671 } |
1660 | 1672 |
1661 void RenderFrameImpl::OnBeforeUnload(bool is_reload) { | 1673 void RenderFrameImpl::OnBeforeUnload(bool is_reload) { |
(...skipping 1038 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2700 service_manager::GetInterfaceProviderSpec( | 2712 service_manager::GetInterfaceProviderSpec( |
2701 mojom::kNavigation_FrameSpec, child_info.interface_provider_specs, | 2713 mojom::kNavigation_FrameSpec, child_info.interface_provider_specs, |
2702 &child_spec); | 2714 &child_spec); |
2703 service_manager::GetInterfaceProviderSpec( | 2715 service_manager::GetInterfaceProviderSpec( |
2704 mojom::kNavigation_FrameSpec, browser_info.interface_provider_specs, | 2716 mojom::kNavigation_FrameSpec, browser_info.interface_provider_specs, |
2705 &browser_spec); | 2717 &browser_spec); |
2706 interface_registry_->Bind(std::move(request), child_info.identity, child_spec, | 2718 interface_registry_->Bind(std::move(request), child_info.identity, child_spec, |
2707 browser_info.identity, browser_spec); | 2719 browser_info.identity, browser_spec); |
2708 } | 2720 } |
2709 | 2721 |
| 2722 void RenderFrameImpl::AllowBindings(int32_t enabled_bindings_flags) { |
| 2723 if (IsMainFrame() && (enabled_bindings_flags & BINDINGS_POLICY_WEB_UI) && |
| 2724 !(enabled_bindings_ & BINDINGS_POLICY_WEB_UI)) { |
| 2725 // TODO(sammc): Move WebUIExtensionData to be a RenderFrameObserver. |
| 2726 // WebUIExtensionData deletes itself when |render_view_| is destroyed. |
| 2727 new WebUIExtensionData(render_view_); |
| 2728 } |
| 2729 |
| 2730 enabled_bindings_ |= enabled_bindings_flags; |
| 2731 |
| 2732 // Keep track of the total bindings accumulated in this process. |
| 2733 RenderProcess::current()->AddBindings(enabled_bindings_flags); |
| 2734 |
| 2735 MaybeEnableMojoBindings(); |
| 2736 } |
| 2737 |
2710 // mojom::HostZoom implementation ---------------------------------------------- | 2738 // mojom::HostZoom implementation ---------------------------------------------- |
2711 | 2739 |
2712 void RenderFrameImpl::SetHostZoomLevel(const GURL& url, double zoom_level) { | 2740 void RenderFrameImpl::SetHostZoomLevel(const GURL& url, double zoom_level) { |
2713 // TODO(wjmaclean): We should see if this restriction is really necessary, | 2741 // TODO(wjmaclean): We should see if this restriction is really necessary, |
2714 // since it isn't enforced in other parts of the page zoom system (e.g. | 2742 // since it isn't enforced in other parts of the page zoom system (e.g. |
2715 // when a users changes the zoom of a currently displayed page). Android | 2743 // when a users changes the zoom of a currently displayed page). Android |
2716 // has no UI for this, so in theory the following code would normally just use | 2744 // has no UI for this, so in theory the following code would normally just use |
2717 // the default zoom anyways. | 2745 // the default zoom anyways. |
2718 #if !defined(OS_ANDROID) | 2746 #if !defined(OS_ANDROID) |
2719 // On Android, page zoom isn't used, and in case of WebView, text zoom is used | 2747 // On Android, page zoom isn't used, and in case of WebView, text zoom is used |
(...skipping 964 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3684 | 3712 |
3685 for (auto& observer : observers_) | 3713 for (auto& observer : observers_) |
3686 observer.DidCreateNewDocument(); | 3714 observer.DidCreateNewDocument(); |
3687 for (auto& observer : render_view_->observers()) | 3715 for (auto& observer : render_view_->observers()) |
3688 observer.DidCreateNewDocument(frame); | 3716 observer.DidCreateNewDocument(frame); |
3689 } | 3717 } |
3690 | 3718 |
3691 void RenderFrameImpl::didClearWindowObject(blink::WebLocalFrame* frame) { | 3719 void RenderFrameImpl::didClearWindowObject(blink::WebLocalFrame* frame) { |
3692 DCHECK_EQ(frame_, frame); | 3720 DCHECK_EQ(frame_, frame); |
3693 | 3721 |
3694 int enabled_bindings = render_view_->GetEnabledBindings(); | 3722 if (enabled_bindings_ & BINDINGS_POLICY_WEB_UI) |
3695 | |
3696 if (enabled_bindings & BINDINGS_POLICY_WEB_UI) | |
3697 WebUIExtension::Install(frame); | 3723 WebUIExtension::Install(frame); |
3698 | 3724 |
3699 if (enabled_bindings & BINDINGS_POLICY_DOM_AUTOMATION) | 3725 if (enabled_bindings_ & BINDINGS_POLICY_DOM_AUTOMATION) |
3700 DomAutomationController::Install(this, frame); | 3726 DomAutomationController::Install(this, frame); |
3701 | 3727 |
3702 if (enabled_bindings & BINDINGS_POLICY_STATS_COLLECTION) | 3728 if (enabled_bindings_ & BINDINGS_POLICY_STATS_COLLECTION) |
3703 StatsCollectionController::Install(frame); | 3729 StatsCollectionController::Install(frame); |
3704 | 3730 |
3705 const base::CommandLine& command_line = | 3731 const base::CommandLine& command_line = |
3706 *base::CommandLine::ForCurrentProcess(); | 3732 *base::CommandLine::ForCurrentProcess(); |
3707 | 3733 |
3708 if (command_line.HasSwitch(cc::switches::kEnableGpuBenchmarking)) | 3734 if (command_line.HasSwitch(cc::switches::kEnableGpuBenchmarking)) |
3709 GpuBenchmarking::Install(frame); | 3735 GpuBenchmarking::Install(frame); |
3710 | 3736 |
3711 if (command_line.HasSwitch(switches::kEnableSkiaBenchmarking)) | 3737 if (command_line.HasSwitch(switches::kEnableSkiaBenchmarking)) |
3712 SkiaBenchmarking::Install(frame); | 3738 SkiaBenchmarking::Install(frame); |
(...skipping 2573 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6286 | 6312 |
6287 void RenderFrameImpl::SendUpdateState() { | 6313 void RenderFrameImpl::SendUpdateState() { |
6288 if (current_history_item_.isNull()) | 6314 if (current_history_item_.isNull()) |
6289 return; | 6315 return; |
6290 | 6316 |
6291 Send(new FrameHostMsg_UpdateState( | 6317 Send(new FrameHostMsg_UpdateState( |
6292 routing_id_, SingleHistoryItemToPageState(current_history_item_))); | 6318 routing_id_, SingleHistoryItemToPageState(current_history_item_))); |
6293 } | 6319 } |
6294 | 6320 |
6295 void RenderFrameImpl::MaybeEnableMojoBindings() { | 6321 void RenderFrameImpl::MaybeEnableMojoBindings() { |
6296 int enabled_bindings = RenderProcess::current()->GetEnabledBindings(); | |
6297 // BINDINGS_POLICY_WEB_UI, BINDINGS_POLICY_MOJO and BINDINGS_POLICY_HEADLESS | 6322 // BINDINGS_POLICY_WEB_UI, BINDINGS_POLICY_MOJO and BINDINGS_POLICY_HEADLESS |
6298 // are mutually exclusive. They provide access to Mojo bindings, but do so in | 6323 // are mutually exclusive. They provide access to Mojo bindings, but do so in |
6299 // incompatible ways. | 6324 // incompatible ways. |
6300 const int kAllBindingsTypes = | 6325 const int kAllBindingsTypes = |
6301 BINDINGS_POLICY_WEB_UI | BINDINGS_POLICY_MOJO | BINDINGS_POLICY_HEADLESS; | 6326 BINDINGS_POLICY_WEB_UI | BINDINGS_POLICY_MOJO | BINDINGS_POLICY_HEADLESS; |
6302 | 6327 |
6303 // Make sure that at most one of BINDINGS_POLICY_WEB_UI, BINDINGS_POLICY_MOJO | 6328 // Make sure that at most one of BINDINGS_POLICY_WEB_UI, BINDINGS_POLICY_MOJO |
6304 // and BINDINGS_POLICY_HEADLESS have been set. | 6329 // and BINDINGS_POLICY_HEADLESS have been set. |
6305 // NOTE x & (x - 1) == 0 is true iff x is zero or a power of two. | 6330 // NOTE x & (x - 1) == 0 is true iff x is zero or a power of two. |
6306 DCHECK_EQ((enabled_bindings & kAllBindingsTypes) & | 6331 DCHECK_EQ((enabled_bindings_ & kAllBindingsTypes) & |
6307 ((enabled_bindings & kAllBindingsTypes) - 1), | 6332 ((enabled_bindings_ & kAllBindingsTypes) - 1), |
6308 0); | 6333 0); |
6309 | 6334 |
| 6335 DCHECK_EQ(RenderProcess::current()->GetEnabledBindings(), enabled_bindings_); |
| 6336 |
6310 // If an MojoBindingsController already exists for this RenderFrameImpl, avoid | 6337 // If an MojoBindingsController already exists for this RenderFrameImpl, avoid |
6311 // creating another one. It is not kept as a member, as it deletes itself when | 6338 // creating another one. It is not kept as a member, as it deletes itself when |
6312 // the frame is destroyed. | 6339 // the frame is destroyed. |
6313 if (RenderFrameObserverTracker<MojoBindingsController>::Get(this)) | 6340 if (RenderFrameObserverTracker<MojoBindingsController>::Get(this)) |
6314 return; | 6341 return; |
6315 | 6342 |
6316 if (IsMainFrame() && | 6343 if (IsMainFrame() && enabled_bindings_ & BINDINGS_POLICY_WEB_UI) { |
6317 enabled_bindings & BINDINGS_POLICY_WEB_UI) { | |
6318 new MojoBindingsController(this, MojoBindingsType::FOR_WEB_UI); | 6344 new MojoBindingsController(this, MojoBindingsType::FOR_WEB_UI); |
6319 } else if (enabled_bindings & BINDINGS_POLICY_MOJO) { | 6345 } else if (enabled_bindings_ & BINDINGS_POLICY_MOJO) { |
6320 new MojoBindingsController(this, MojoBindingsType::FOR_LAYOUT_TESTS); | 6346 new MojoBindingsController(this, MojoBindingsType::FOR_LAYOUT_TESTS); |
6321 } else if (enabled_bindings & BINDINGS_POLICY_HEADLESS) { | 6347 } else if (enabled_bindings_ & BINDINGS_POLICY_HEADLESS) { |
6322 new MojoBindingsController(this, MojoBindingsType::FOR_HEADLESS); | 6348 new MojoBindingsController(this, MojoBindingsType::FOR_HEADLESS); |
6323 } | 6349 } |
6324 } | 6350 } |
6325 | 6351 |
6326 void RenderFrameImpl::SendFailedProvisionalLoad( | 6352 void RenderFrameImpl::SendFailedProvisionalLoad( |
6327 const blink::WebURLRequest& request, | 6353 const blink::WebURLRequest& request, |
6328 const blink::WebURLError& error, | 6354 const blink::WebURLError& error, |
6329 blink::WebLocalFrame* frame) { | 6355 blink::WebLocalFrame* frame) { |
6330 bool show_repost_interstitial = | 6356 bool show_repost_interstitial = |
6331 (error.reason == net::ERR_CACHE_MISS && | 6357 (error.reason == net::ERR_CACHE_MISS && |
(...skipping 254 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6586 focused_pepper_plugin_->HandleTextInput(text); | 6612 focused_pepper_plugin_->HandleTextInput(text); |
6587 } | 6613 } |
6588 pepper_composition_text_.clear(); | 6614 pepper_composition_text_.clear(); |
6589 } | 6615 } |
6590 #endif // ENABLE_PLUGINS | 6616 #endif // ENABLE_PLUGINS |
6591 | 6617 |
6592 void RenderFrameImpl::RegisterMojoInterfaces() { | 6618 void RenderFrameImpl::RegisterMojoInterfaces() { |
6593 GetAssociatedInterfaceRegistry()->AddInterface( | 6619 GetAssociatedInterfaceRegistry()->AddInterface( |
6594 base::Bind(&RenderFrameImpl::BindEngagement, weak_factory_.GetWeakPtr())); | 6620 base::Bind(&RenderFrameImpl::BindEngagement, weak_factory_.GetWeakPtr())); |
6595 | 6621 |
| 6622 GetAssociatedInterfaceRegistry()->AddInterface(base::Bind( |
| 6623 &RenderFrameImpl::BindFrameBindingsControl, weak_factory_.GetWeakPtr())); |
| 6624 |
6596 if (!frame_->parent()) { | 6625 if (!frame_->parent()) { |
6597 // Only main frame have ImageDownloader service. | 6626 // Only main frame have ImageDownloader service. |
6598 GetInterfaceRegistry()->AddInterface(base::Bind( | 6627 GetInterfaceRegistry()->AddInterface(base::Bind( |
6599 &ImageDownloaderImpl::CreateMojoService, base::Unretained(this))); | 6628 &ImageDownloaderImpl::CreateMojoService, base::Unretained(this))); |
6600 | 6629 |
6601 // Host zoom is per-page, so only added on the main frame. | 6630 // Host zoom is per-page, so only added on the main frame. |
6602 GetAssociatedInterfaceRegistry()->AddInterface(base::Bind( | 6631 GetAssociatedInterfaceRegistry()->AddInterface(base::Bind( |
6603 &RenderFrameImpl::OnHostZoomClientRequest, weak_factory_.GetWeakPtr())); | 6632 &RenderFrameImpl::OnHostZoomClientRequest, weak_factory_.GetWeakPtr())); |
6604 } | 6633 } |
6605 } | 6634 } |
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6659 } | 6688 } |
6660 | 6689 |
6661 base::SingleThreadTaskRunner* RenderFrameImpl::GetLoadingTaskRunner() { | 6690 base::SingleThreadTaskRunner* RenderFrameImpl::GetLoadingTaskRunner() { |
6662 return GetWebFrame()->loadingTaskRunner(); | 6691 return GetWebFrame()->loadingTaskRunner(); |
6663 } | 6692 } |
6664 | 6693 |
6665 base::SingleThreadTaskRunner* RenderFrameImpl::GetUnthrottledTaskRunner() { | 6694 base::SingleThreadTaskRunner* RenderFrameImpl::GetUnthrottledTaskRunner() { |
6666 return GetWebFrame()->unthrottledTaskRunner(); | 6695 return GetWebFrame()->unthrottledTaskRunner(); |
6667 } | 6696 } |
6668 | 6697 |
| 6698 int RenderFrameImpl::GetEnabledBindings() const { |
| 6699 return enabled_bindings_; |
| 6700 } |
| 6701 |
6669 blink::WebPlugin* RenderFrameImpl::GetWebPluginForFind() { | 6702 blink::WebPlugin* RenderFrameImpl::GetWebPluginForFind() { |
6670 if (frame_->document().isPluginDocument()) | 6703 if (frame_->document().isPluginDocument()) |
6671 return frame_->document().to<WebPluginDocument>().plugin(); | 6704 return frame_->document().to<WebPluginDocument>().plugin(); |
6672 | 6705 |
6673 #if BUILDFLAG(ENABLE_PLUGINS) | 6706 #if BUILDFLAG(ENABLE_PLUGINS) |
6674 if (plugin_find_handler_) | 6707 if (plugin_find_handler_) |
6675 return plugin_find_handler_->container()->plugin(); | 6708 return plugin_find_handler_->container()->plugin(); |
6676 #endif | 6709 #endif |
6677 | 6710 |
6678 return nullptr; | 6711 return nullptr; |
(...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6796 // event target. Potentially a Pepper plugin will receive the event. | 6829 // event target. Potentially a Pepper plugin will receive the event. |
6797 // In order to tell whether a plugin gets the last mouse event and which it | 6830 // In order to tell whether a plugin gets the last mouse event and which it |
6798 // is, we set |pepper_last_mouse_event_target_| to null here. If a plugin gets | 6831 // is, we set |pepper_last_mouse_event_target_| to null here. If a plugin gets |
6799 // the event, it will notify us via DidReceiveMouseEvent() and set itself as | 6832 // the event, it will notify us via DidReceiveMouseEvent() and set itself as |
6800 // |pepper_last_mouse_event_target_|. | 6833 // |pepper_last_mouse_event_target_|. |
6801 pepper_last_mouse_event_target_ = nullptr; | 6834 pepper_last_mouse_event_target_ = nullptr; |
6802 #endif | 6835 #endif |
6803 } | 6836 } |
6804 | 6837 |
6805 } // namespace content | 6838 } // namespace content |
OLD | NEW |