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/module_registry.h" | 145 #include "gin/modules/module_registry.h" |
145 #include "media/audio/audio_output_device.h" | 146 #include "media/audio/audio_output_device.h" |
146 #include "media/base/audio_renderer_mixer_input.h" | 147 #include "media/base/audio_renderer_mixer_input.h" |
147 #include "media/base/cdm_factory.h" | 148 #include "media/base/cdm_factory.h" |
148 #include "media/base/decoder_factory.h" | 149 #include "media/base/decoder_factory.h" |
149 #include "media/base/media.h" | 150 #include "media/base/media.h" |
150 #include "media/base/media_log.h" | 151 #include "media/base/media_log.h" |
151 #include "media/base/media_switches.h" | 152 #include "media/base/media_switches.h" |
152 #include "media/blink/url_index.h" | 153 #include "media/blink/url_index.h" |
(...skipping 955 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1108 is_pasting_(false), | 1109 is_pasting_(false), |
1109 suppress_further_dialogs_(false), | 1110 suppress_further_dialogs_(false), |
1110 blame_context_(nullptr), | 1111 blame_context_(nullptr), |
1111 #if BUILDFLAG(ENABLE_PLUGINS) | 1112 #if BUILDFLAG(ENABLE_PLUGINS) |
1112 focused_pepper_plugin_(nullptr), | 1113 focused_pepper_plugin_(nullptr), |
1113 pepper_last_mouse_event_target_(nullptr), | 1114 pepper_last_mouse_event_target_(nullptr), |
1114 #endif | 1115 #endif |
1115 engagement_binding_(this), | 1116 engagement_binding_(this), |
1116 frame_binding_(this), | 1117 frame_binding_(this), |
1117 host_zoom_binding_(this), | 1118 host_zoom_binding_(this), |
| 1119 frame_bindings_control_binding_(this), |
1118 has_accessed_initial_document_(false), | 1120 has_accessed_initial_document_(false), |
1119 weak_factory_(this) { | 1121 weak_factory_(this) { |
1120 // We don't have a service_manager::Connection at this point, so use empty | 1122 // We don't have a service_manager::Connection at this point, so use empty |
1121 // identity/specs. | 1123 // identity/specs. |
1122 // TODO(beng): We should fix this, so we can apply policy about which | 1124 // TODO(beng): We should fix this, so we can apply policy about which |
1123 // interfaces get exposed. | 1125 // interfaces get exposed. |
1124 interface_registry_ = base::MakeUnique<service_manager::InterfaceRegistry>( | 1126 interface_registry_ = base::MakeUnique<service_manager::InterfaceRegistry>( |
1125 mojom::kNavigation_FrameSpec); | 1127 mojom::kNavigation_FrameSpec); |
1126 service_manager::mojom::InterfaceProviderPtr remote_interfaces; | 1128 service_manager::mojom::InterfaceProviderPtr remote_interfaces; |
1127 pending_remote_interface_provider_request_ = MakeRequest(&remote_interfaces); | 1129 pending_remote_interface_provider_request_ = MakeRequest(&remote_interfaces); |
(...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1226 bool is_tracing_navigation = false; | 1228 bool is_tracing_navigation = false; |
1227 TRACE_EVENT_CATEGORY_GROUP_ENABLED("navigation", &is_tracing_navigation); | 1229 TRACE_EVENT_CATEGORY_GROUP_ENABLED("navigation", &is_tracing_navigation); |
1228 TRACE_EVENT_CATEGORY_GROUP_ENABLED("rail", &is_tracing_rail); | 1230 TRACE_EVENT_CATEGORY_GROUP_ENABLED("rail", &is_tracing_rail); |
1229 if (is_tracing_rail || is_tracing_navigation) { | 1231 if (is_tracing_rail || is_tracing_navigation) { |
1230 int parent_id = GetRoutingIdForFrameOrProxy(frame_->parent()); | 1232 int parent_id = GetRoutingIdForFrameOrProxy(frame_->parent()); |
1231 TRACE_EVENT2("navigation,rail", "RenderFrameImpl::Initialize", | 1233 TRACE_EVENT2("navigation,rail", "RenderFrameImpl::Initialize", |
1232 "id", routing_id_, | 1234 "id", routing_id_, |
1233 "parent", parent_id); | 1235 "parent", parent_id); |
1234 } | 1236 } |
1235 | 1237 |
1236 MaybeEnableMojoBindings(); | |
1237 | |
1238 #if BUILDFLAG(ENABLE_PLUGINS) | 1238 #if BUILDFLAG(ENABLE_PLUGINS) |
1239 new PepperBrowserConnection(this); | 1239 new PepperBrowserConnection(this); |
1240 #endif | 1240 #endif |
1241 shared_worker_repository_ = base::MakeUnique<SharedWorkerRepository>(this); | 1241 shared_worker_repository_ = base::MakeUnique<SharedWorkerRepository>(this); |
1242 GetWebFrame()->setSharedWorkerRepositoryClient( | 1242 GetWebFrame()->setSharedWorkerRepositoryClient( |
1243 shared_worker_repository_.get()); | 1243 shared_worker_repository_.get()); |
1244 | 1244 |
1245 if (IsLocalRoot()) { | 1245 if (IsLocalRoot()) { |
1246 // DevToolsAgent is a RenderFrameObserver, and will destruct itself | 1246 // DevToolsAgent is a RenderFrameObserver, and will destruct itself |
1247 // when |this| is deleted. | 1247 // when |this| is deleted. |
(...skipping 11 matching lines...) Expand all Loading... |
1259 #endif | 1259 #endif |
1260 | 1260 |
1261 RenderThreadImpl* render_thread = RenderThreadImpl::current(); | 1261 RenderThreadImpl* render_thread = RenderThreadImpl::current(); |
1262 // render_thread may be NULL in tests. | 1262 // render_thread may be NULL in tests. |
1263 InputHandlerManager* input_handler_manager = | 1263 InputHandlerManager* input_handler_manager = |
1264 render_thread ? render_thread->input_handler_manager() : nullptr; | 1264 render_thread ? render_thread->input_handler_manager() : nullptr; |
1265 if (input_handler_manager) { | 1265 if (input_handler_manager) { |
1266 DCHECK(render_view_->HasAddedInputHandler()); | 1266 DCHECK(render_view_->HasAddedInputHandler()); |
1267 input_handler_manager->RegisterRoutingID(GetRoutingID()); | 1267 input_handler_manager->RegisterRoutingID(GetRoutingID()); |
1268 } | 1268 } |
| 1269 |
| 1270 const base::CommandLine& command_line = |
| 1271 *base::CommandLine::ForCurrentProcess(); |
| 1272 if (command_line.HasSwitch(switches::kDomAutomationController)) |
| 1273 enabled_bindings_ |= BINDINGS_POLICY_DOM_AUTOMATION; |
| 1274 if (command_line.HasSwitch(switches::kStatsCollectionController)) |
| 1275 enabled_bindings_ |= BINDINGS_POLICY_STATS_COLLECTION; |
1269 } | 1276 } |
1270 | 1277 |
1271 void RenderFrameImpl::InitializeBlameContext(RenderFrameImpl* parent_frame) { | 1278 void RenderFrameImpl::InitializeBlameContext(RenderFrameImpl* parent_frame) { |
1272 DCHECK(!blame_context_); | 1279 DCHECK(!blame_context_); |
1273 blame_context_ = base::MakeUnique<FrameBlameContext>(this, parent_frame); | 1280 blame_context_ = base::MakeUnique<FrameBlameContext>(this, parent_frame); |
1274 blame_context_->Initialize(); | 1281 blame_context_->Initialize(); |
1275 } | 1282 } |
1276 | 1283 |
1277 RenderWidget* RenderFrameImpl::GetRenderWidget() { | 1284 RenderWidget* RenderFrameImpl::GetRenderWidget() { |
1278 return GetLocalRoot()->render_widget_.get(); | 1285 return GetLocalRoot()->render_widget_.get(); |
(...skipping 360 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1639 } | 1646 } |
1640 | 1647 |
1641 void RenderFrameImpl::BindFrame(mojom::FrameRequest request, | 1648 void RenderFrameImpl::BindFrame(mojom::FrameRequest request, |
1642 mojom::FrameHostPtr host) { | 1649 mojom::FrameHostPtr host) { |
1643 frame_binding_.Bind(std::move(request)); | 1650 frame_binding_.Bind(std::move(request)); |
1644 frame_host_ = std::move(host); | 1651 frame_host_ = std::move(host); |
1645 frame_host_->GetInterfaceProvider( | 1652 frame_host_->GetInterfaceProvider( |
1646 std::move(pending_remote_interface_provider_request_)); | 1653 std::move(pending_remote_interface_provider_request_)); |
1647 } | 1654 } |
1648 | 1655 |
| 1656 void RenderFrameImpl::BindFrameBindingsControl( |
| 1657 mojom::FrameBindingsControlAssociatedRequest request) { |
| 1658 frame_bindings_control_binding_.Bind(std::move(request)); |
| 1659 } |
| 1660 |
1649 ManifestManager* RenderFrameImpl::manifest_manager() { | 1661 ManifestManager* RenderFrameImpl::manifest_manager() { |
1650 return manifest_manager_; | 1662 return manifest_manager_; |
1651 } | 1663 } |
1652 | 1664 |
1653 void RenderFrameImpl::SetPendingNavigationParams( | 1665 void RenderFrameImpl::SetPendingNavigationParams( |
1654 std::unique_ptr<NavigationParams> navigation_params) { | 1666 std::unique_ptr<NavigationParams> navigation_params) { |
1655 pending_navigation_params_ = std::move(navigation_params); | 1667 pending_navigation_params_ = std::move(navigation_params); |
1656 } | 1668 } |
1657 | 1669 |
1658 void RenderFrameImpl::OnBeforeUnload(bool is_reload) { | 1670 void RenderFrameImpl::OnBeforeUnload(bool is_reload) { |
(...skipping 1035 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2694 service_manager::GetInterfaceProviderSpec( | 2706 service_manager::GetInterfaceProviderSpec( |
2695 mojom::kNavigation_FrameSpec, child_info.interface_provider_specs, | 2707 mojom::kNavigation_FrameSpec, child_info.interface_provider_specs, |
2696 &child_spec); | 2708 &child_spec); |
2697 service_manager::GetInterfaceProviderSpec( | 2709 service_manager::GetInterfaceProviderSpec( |
2698 mojom::kNavigation_FrameSpec, browser_info.interface_provider_specs, | 2710 mojom::kNavigation_FrameSpec, browser_info.interface_provider_specs, |
2699 &browser_spec); | 2711 &browser_spec); |
2700 interface_registry_->Bind(std::move(request), child_info.identity, child_spec, | 2712 interface_registry_->Bind(std::move(request), child_info.identity, child_spec, |
2701 browser_info.identity, browser_spec); | 2713 browser_info.identity, browser_spec); |
2702 } | 2714 } |
2703 | 2715 |
| 2716 void RenderFrameImpl::AllowBindings(int32_t enabled_bindings_flags) { |
| 2717 if (IsMainFrame() && (enabled_bindings_flags & BINDINGS_POLICY_WEB_UI) && |
| 2718 !(enabled_bindings_ & BINDINGS_POLICY_WEB_UI)) { |
| 2719 // TODO(sammc): Move WebUIExtensionData to be a RenderFrameObserver. |
| 2720 // WebUIExtensionData deletes itself when |render_view_| is destroyed. |
| 2721 new WebUIExtensionData(render_view_); |
| 2722 } |
| 2723 |
| 2724 enabled_bindings_ |= enabled_bindings_flags; |
| 2725 |
| 2726 // Keep track of the total bindings accumulated in this process. |
| 2727 RenderProcess::current()->AddBindings(enabled_bindings_flags); |
| 2728 |
| 2729 MaybeEnableMojoBindings(); |
| 2730 } |
| 2731 |
2704 // mojom::HostZoom implementation ---------------------------------------------- | 2732 // mojom::HostZoom implementation ---------------------------------------------- |
2705 | 2733 |
2706 void RenderFrameImpl::SetHostZoomLevel(const GURL& url, double zoom_level) { | 2734 void RenderFrameImpl::SetHostZoomLevel(const GURL& url, double zoom_level) { |
2707 // TODO(wjmaclean): We should see if this restriction is really necessary, | 2735 // TODO(wjmaclean): We should see if this restriction is really necessary, |
2708 // since it isn't enforced in other parts of the page zoom system (e.g. | 2736 // since it isn't enforced in other parts of the page zoom system (e.g. |
2709 // when a users changes the zoom of a currently displayed page). Android | 2737 // when a users changes the zoom of a currently displayed page). Android |
2710 // has no UI for this, so in theory the following code would normally just use | 2738 // has no UI for this, so in theory the following code would normally just use |
2711 // the default zoom anyways. | 2739 // the default zoom anyways. |
2712 #if !defined(OS_ANDROID) | 2740 #if !defined(OS_ANDROID) |
2713 // On Android, page zoom isn't used, and in case of WebView, text zoom is used | 2741 // On Android, page zoom isn't used, and in case of WebView, text zoom is used |
(...skipping 1014 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3728 | 3756 |
3729 for (auto& observer : observers_) | 3757 for (auto& observer : observers_) |
3730 observer.DidCreateNewDocument(); | 3758 observer.DidCreateNewDocument(); |
3731 for (auto& observer : render_view_->observers()) | 3759 for (auto& observer : render_view_->observers()) |
3732 observer.DidCreateNewDocument(frame); | 3760 observer.DidCreateNewDocument(frame); |
3733 } | 3761 } |
3734 | 3762 |
3735 void RenderFrameImpl::didClearWindowObject(blink::WebLocalFrame* frame) { | 3763 void RenderFrameImpl::didClearWindowObject(blink::WebLocalFrame* frame) { |
3736 DCHECK_EQ(frame_, frame); | 3764 DCHECK_EQ(frame_, frame); |
3737 | 3765 |
3738 int enabled_bindings = render_view_->GetEnabledBindings(); | 3766 if (enabled_bindings_ & BINDINGS_POLICY_WEB_UI) |
3739 | |
3740 if (enabled_bindings & BINDINGS_POLICY_WEB_UI) | |
3741 WebUIExtension::Install(frame); | 3767 WebUIExtension::Install(frame); |
3742 | 3768 |
3743 if (enabled_bindings & BINDINGS_POLICY_DOM_AUTOMATION) | 3769 if (enabled_bindings_ & BINDINGS_POLICY_DOM_AUTOMATION) |
3744 DomAutomationController::Install(this, frame); | 3770 DomAutomationController::Install(this, frame); |
3745 | 3771 |
3746 if (enabled_bindings & BINDINGS_POLICY_STATS_COLLECTION) | 3772 if (enabled_bindings_ & BINDINGS_POLICY_STATS_COLLECTION) |
3747 StatsCollectionController::Install(frame); | 3773 StatsCollectionController::Install(frame); |
3748 | 3774 |
3749 const base::CommandLine& command_line = | 3775 const base::CommandLine& command_line = |
3750 *base::CommandLine::ForCurrentProcess(); | 3776 *base::CommandLine::ForCurrentProcess(); |
3751 | 3777 |
3752 if (command_line.HasSwitch(cc::switches::kEnableGpuBenchmarking)) | 3778 if (command_line.HasSwitch(cc::switches::kEnableGpuBenchmarking)) |
3753 GpuBenchmarking::Install(frame); | 3779 GpuBenchmarking::Install(frame); |
3754 | 3780 |
3755 if (command_line.HasSwitch(switches::kEnableSkiaBenchmarking)) | 3781 if (command_line.HasSwitch(switches::kEnableSkiaBenchmarking)) |
3756 SkiaBenchmarking::Install(frame); | 3782 SkiaBenchmarking::Install(frame); |
(...skipping 2522 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6279 void RenderFrameImpl::SendUpdateState() { | 6305 void RenderFrameImpl::SendUpdateState() { |
6280 DCHECK(SiteIsolationPolicy::UseSubframeNavigationEntries()); | 6306 DCHECK(SiteIsolationPolicy::UseSubframeNavigationEntries()); |
6281 if (current_history_item_.isNull()) | 6307 if (current_history_item_.isNull()) |
6282 return; | 6308 return; |
6283 | 6309 |
6284 Send(new FrameHostMsg_UpdateState( | 6310 Send(new FrameHostMsg_UpdateState( |
6285 routing_id_, SingleHistoryItemToPageState(current_history_item_))); | 6311 routing_id_, SingleHistoryItemToPageState(current_history_item_))); |
6286 } | 6312 } |
6287 | 6313 |
6288 void RenderFrameImpl::MaybeEnableMojoBindings() { | 6314 void RenderFrameImpl::MaybeEnableMojoBindings() { |
6289 int enabled_bindings = RenderProcess::current()->GetEnabledBindings(); | |
6290 // BINDINGS_POLICY_WEB_UI, BINDINGS_POLICY_MOJO and BINDINGS_POLICY_HEADLESS | 6315 // BINDINGS_POLICY_WEB_UI, BINDINGS_POLICY_MOJO and BINDINGS_POLICY_HEADLESS |
6291 // are mutually exclusive. They provide access to Mojo bindings, but do so in | 6316 // are mutually exclusive. They provide access to Mojo bindings, but do so in |
6292 // incompatible ways. | 6317 // incompatible ways. |
6293 const int kAllBindingsTypes = | 6318 const int kAllBindingsTypes = |
6294 BINDINGS_POLICY_WEB_UI | BINDINGS_POLICY_MOJO | BINDINGS_POLICY_HEADLESS; | 6319 BINDINGS_POLICY_WEB_UI | BINDINGS_POLICY_MOJO | BINDINGS_POLICY_HEADLESS; |
6295 | 6320 |
6296 // Make sure that at most one of BINDINGS_POLICY_WEB_UI, BINDINGS_POLICY_MOJO | 6321 // Make sure that at most one of BINDINGS_POLICY_WEB_UI, BINDINGS_POLICY_MOJO |
6297 // and BINDINGS_POLICY_HEADLESS have been set. | 6322 // and BINDINGS_POLICY_HEADLESS have been set. |
6298 // NOTE x & (x - 1) == 0 is true iff x is zero or a power of two. | 6323 // NOTE x & (x - 1) == 0 is true iff x is zero or a power of two. |
6299 DCHECK_EQ((enabled_bindings & kAllBindingsTypes) & | 6324 DCHECK_EQ((enabled_bindings_ & kAllBindingsTypes) & |
6300 ((enabled_bindings & kAllBindingsTypes) - 1), | 6325 ((enabled_bindings_ & kAllBindingsTypes) - 1), |
6301 0); | 6326 0); |
6302 | 6327 |
| 6328 DCHECK_EQ(RenderProcess::current()->GetEnabledBindings(), enabled_bindings_); |
| 6329 |
6303 // If an MojoBindingsController already exists for this RenderFrameImpl, avoid | 6330 // If an MojoBindingsController already exists for this RenderFrameImpl, avoid |
6304 // creating another one. It is not kept as a member, as it deletes itself when | 6331 // creating another one. It is not kept as a member, as it deletes itself when |
6305 // the frame is destroyed. | 6332 // the frame is destroyed. |
6306 if (RenderFrameObserverTracker<MojoBindingsController>::Get(this)) | 6333 if (RenderFrameObserverTracker<MojoBindingsController>::Get(this)) |
6307 return; | 6334 return; |
6308 | 6335 |
6309 if (IsMainFrame() && | 6336 if (IsMainFrame() && enabled_bindings_ & BINDINGS_POLICY_WEB_UI) { |
6310 enabled_bindings & BINDINGS_POLICY_WEB_UI) { | |
6311 new MojoBindingsController(this, MojoBindingsType::FOR_WEB_UI); | 6337 new MojoBindingsController(this, MojoBindingsType::FOR_WEB_UI); |
6312 } else if (enabled_bindings & BINDINGS_POLICY_MOJO) { | 6338 } else if (enabled_bindings_ & BINDINGS_POLICY_MOJO) { |
6313 new MojoBindingsController(this, MojoBindingsType::FOR_LAYOUT_TESTS); | 6339 new MojoBindingsController(this, MojoBindingsType::FOR_LAYOUT_TESTS); |
6314 } else if (enabled_bindings & BINDINGS_POLICY_HEADLESS) { | 6340 } else if (enabled_bindings_ & BINDINGS_POLICY_HEADLESS) { |
6315 new MojoBindingsController(this, MojoBindingsType::FOR_HEADLESS); | 6341 new MojoBindingsController(this, MojoBindingsType::FOR_HEADLESS); |
6316 } | 6342 } |
6317 } | 6343 } |
6318 | 6344 |
6319 void RenderFrameImpl::SendFailedProvisionalLoad( | 6345 void RenderFrameImpl::SendFailedProvisionalLoad( |
6320 const blink::WebURLRequest& request, | 6346 const blink::WebURLRequest& request, |
6321 const blink::WebURLError& error, | 6347 const blink::WebURLError& error, |
6322 blink::WebLocalFrame* frame) { | 6348 blink::WebLocalFrame* frame) { |
6323 bool show_repost_interstitial = | 6349 bool show_repost_interstitial = |
6324 (error.reason == net::ERR_CACHE_MISS && | 6350 (error.reason == net::ERR_CACHE_MISS && |
(...skipping 253 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6578 focused_pepper_plugin_->HandleTextInput(text); | 6604 focused_pepper_plugin_->HandleTextInput(text); |
6579 } | 6605 } |
6580 pepper_composition_text_.clear(); | 6606 pepper_composition_text_.clear(); |
6581 } | 6607 } |
6582 #endif // ENABLE_PLUGINS | 6608 #endif // ENABLE_PLUGINS |
6583 | 6609 |
6584 void RenderFrameImpl::RegisterMojoInterfaces() { | 6610 void RenderFrameImpl::RegisterMojoInterfaces() { |
6585 GetAssociatedInterfaceRegistry()->AddInterface( | 6611 GetAssociatedInterfaceRegistry()->AddInterface( |
6586 base::Bind(&RenderFrameImpl::BindEngagement, weak_factory_.GetWeakPtr())); | 6612 base::Bind(&RenderFrameImpl::BindEngagement, weak_factory_.GetWeakPtr())); |
6587 | 6613 |
| 6614 GetAssociatedInterfaceRegistry()->AddInterface(base::Bind( |
| 6615 &RenderFrameImpl::BindFrameBindingsControl, weak_factory_.GetWeakPtr())); |
| 6616 |
6588 if (!frame_->parent()) { | 6617 if (!frame_->parent()) { |
6589 // Only main frame have ImageDownloader service. | 6618 // Only main frame have ImageDownloader service. |
6590 GetInterfaceRegistry()->AddInterface(base::Bind( | 6619 GetInterfaceRegistry()->AddInterface(base::Bind( |
6591 &ImageDownloaderImpl::CreateMojoService, base::Unretained(this))); | 6620 &ImageDownloaderImpl::CreateMojoService, base::Unretained(this))); |
6592 | 6621 |
6593 // Host zoom is per-page, so only added on the main frame. | 6622 // Host zoom is per-page, so only added on the main frame. |
6594 GetAssociatedInterfaceRegistry()->AddInterface(base::Bind( | 6623 GetAssociatedInterfaceRegistry()->AddInterface(base::Bind( |
6595 &RenderFrameImpl::OnHostZoomClientRequest, weak_factory_.GetWeakPtr())); | 6624 &RenderFrameImpl::OnHostZoomClientRequest, weak_factory_.GetWeakPtr())); |
6596 } | 6625 } |
6597 } | 6626 } |
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6647 } | 6676 } |
6648 | 6677 |
6649 blink::WebPageVisibilityState RenderFrameImpl::GetVisibilityState() const { | 6678 blink::WebPageVisibilityState RenderFrameImpl::GetVisibilityState() const { |
6650 return visibilityState(); | 6679 return visibilityState(); |
6651 } | 6680 } |
6652 | 6681 |
6653 bool RenderFrameImpl::IsBrowserSideNavigationPending() { | 6682 bool RenderFrameImpl::IsBrowserSideNavigationPending() { |
6654 return browser_side_navigation_pending_; | 6683 return browser_side_navigation_pending_; |
6655 } | 6684 } |
6656 | 6685 |
| 6686 int RenderFrameImpl::GetEnabledBindings() const { |
| 6687 return enabled_bindings_; |
| 6688 } |
| 6689 |
6657 blink::WebPlugin* RenderFrameImpl::GetWebPluginForFind() { | 6690 blink::WebPlugin* RenderFrameImpl::GetWebPluginForFind() { |
6658 if (frame_->document().isPluginDocument()) | 6691 if (frame_->document().isPluginDocument()) |
6659 return frame_->document().to<WebPluginDocument>().plugin(); | 6692 return frame_->document().to<WebPluginDocument>().plugin(); |
6660 | 6693 |
6661 #if BUILDFLAG(ENABLE_PLUGINS) | 6694 #if BUILDFLAG(ENABLE_PLUGINS) |
6662 if (plugin_find_handler_) | 6695 if (plugin_find_handler_) |
6663 return plugin_find_handler_->container()->plugin(); | 6696 return plugin_find_handler_->container()->plugin(); |
6664 #endif | 6697 #endif |
6665 | 6698 |
6666 return nullptr; | 6699 return nullptr; |
(...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6785 // event target. Potentially a Pepper plugin will receive the event. | 6818 // event target. Potentially a Pepper plugin will receive the event. |
6786 // In order to tell whether a plugin gets the last mouse event and which it | 6819 // In order to tell whether a plugin gets the last mouse event and which it |
6787 // is, we set |pepper_last_mouse_event_target_| to null here. If a plugin gets | 6820 // is, we set |pepper_last_mouse_event_target_| to null here. If a plugin gets |
6788 // the event, it will notify us via DidReceiveMouseEvent() and set itself as | 6821 // the event, it will notify us via DidReceiveMouseEvent() and set itself as |
6789 // |pepper_last_mouse_event_target_|. | 6822 // |pepper_last_mouse_event_target_|. |
6790 pepper_last_mouse_event_target_ = nullptr; | 6823 pepper_last_mouse_event_target_ = nullptr; |
6791 #endif | 6824 #endif |
6792 } | 6825 } |
6793 | 6826 |
6794 } // namespace content | 6827 } // namespace content |
OLD | NEW |