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 954 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1107 is_pasting_(false), | 1108 is_pasting_(false), |
1108 suppress_further_dialogs_(false), | 1109 suppress_further_dialogs_(false), |
1109 blame_context_(nullptr), | 1110 blame_context_(nullptr), |
1110 #if BUILDFLAG(ENABLE_PLUGINS) | 1111 #if BUILDFLAG(ENABLE_PLUGINS) |
1111 focused_pepper_plugin_(nullptr), | 1112 focused_pepper_plugin_(nullptr), |
1112 pepper_last_mouse_event_target_(nullptr), | 1113 pepper_last_mouse_event_target_(nullptr), |
1113 #endif | 1114 #endif |
1114 engagement_binding_(this), | 1115 engagement_binding_(this), |
1115 frame_binding_(this), | 1116 frame_binding_(this), |
1116 host_zoom_binding_(this), | 1117 host_zoom_binding_(this), |
| 1118 frame_bindings_control_binding_(this), |
1117 has_accessed_initial_document_(false), | 1119 has_accessed_initial_document_(false), |
1118 weak_factory_(this) { | 1120 weak_factory_(this) { |
1119 // We don't have a service_manager::Connection at this point, so use empty | 1121 // We don't have a service_manager::Connection at this point, so use empty |
1120 // identity/specs. | 1122 // identity/specs. |
1121 // TODO(beng): We should fix this, so we can apply policy about which | 1123 // TODO(beng): We should fix this, so we can apply policy about which |
1122 // interfaces get exposed. | 1124 // interfaces get exposed. |
1123 interface_registry_ = base::MakeUnique<service_manager::InterfaceRegistry>( | 1125 interface_registry_ = base::MakeUnique<service_manager::InterfaceRegistry>( |
1124 mojom::kNavigation_FrameSpec); | 1126 mojom::kNavigation_FrameSpec); |
1125 service_manager::mojom::InterfaceProviderPtr remote_interfaces; | 1127 service_manager::mojom::InterfaceProviderPtr remote_interfaces; |
1126 pending_remote_interface_provider_request_ = MakeRequest(&remote_interfaces); | 1128 pending_remote_interface_provider_request_ = MakeRequest(&remote_interfaces); |
(...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1225 bool is_tracing_navigation = false; | 1227 bool is_tracing_navigation = false; |
1226 TRACE_EVENT_CATEGORY_GROUP_ENABLED("navigation", &is_tracing_navigation); | 1228 TRACE_EVENT_CATEGORY_GROUP_ENABLED("navigation", &is_tracing_navigation); |
1227 TRACE_EVENT_CATEGORY_GROUP_ENABLED("rail", &is_tracing_rail); | 1229 TRACE_EVENT_CATEGORY_GROUP_ENABLED("rail", &is_tracing_rail); |
1228 if (is_tracing_rail || is_tracing_navigation) { | 1230 if (is_tracing_rail || is_tracing_navigation) { |
1229 int parent_id = GetRoutingIdForFrameOrProxy(frame_->parent()); | 1231 int parent_id = GetRoutingIdForFrameOrProxy(frame_->parent()); |
1230 TRACE_EVENT2("navigation,rail", "RenderFrameImpl::Initialize", | 1232 TRACE_EVENT2("navigation,rail", "RenderFrameImpl::Initialize", |
1231 "id", routing_id_, | 1233 "id", routing_id_, |
1232 "parent", parent_id); | 1234 "parent", parent_id); |
1233 } | 1235 } |
1234 | 1236 |
1235 MaybeEnableMojoBindings(); | |
1236 | |
1237 #if BUILDFLAG(ENABLE_PLUGINS) | 1237 #if BUILDFLAG(ENABLE_PLUGINS) |
1238 new PepperBrowserConnection(this); | 1238 new PepperBrowserConnection(this); |
1239 #endif | 1239 #endif |
1240 shared_worker_repository_ = base::MakeUnique<SharedWorkerRepository>(this); | 1240 shared_worker_repository_ = base::MakeUnique<SharedWorkerRepository>(this); |
1241 GetWebFrame()->setSharedWorkerRepositoryClient( | 1241 GetWebFrame()->setSharedWorkerRepositoryClient( |
1242 shared_worker_repository_.get()); | 1242 shared_worker_repository_.get()); |
1243 | 1243 |
1244 if (IsLocalRoot()) { | 1244 if (IsLocalRoot()) { |
1245 // DevToolsAgent is a RenderFrameObserver, and will destruct itself | 1245 // DevToolsAgent is a RenderFrameObserver, and will destruct itself |
1246 // when |this| is deleted. | 1246 // when |this| is deleted. |
(...skipping 11 matching lines...) Expand all Loading... |
1258 #endif | 1258 #endif |
1259 | 1259 |
1260 RenderThreadImpl* render_thread = RenderThreadImpl::current(); | 1260 RenderThreadImpl* render_thread = RenderThreadImpl::current(); |
1261 // render_thread may be NULL in tests. | 1261 // render_thread may be NULL in tests. |
1262 InputHandlerManager* input_handler_manager = | 1262 InputHandlerManager* input_handler_manager = |
1263 render_thread ? render_thread->input_handler_manager() : nullptr; | 1263 render_thread ? render_thread->input_handler_manager() : nullptr; |
1264 if (input_handler_manager) { | 1264 if (input_handler_manager) { |
1265 DCHECK(render_view_->HasAddedInputHandler()); | 1265 DCHECK(render_view_->HasAddedInputHandler()); |
1266 input_handler_manager->RegisterRoutingID(GetRoutingID()); | 1266 input_handler_manager->RegisterRoutingID(GetRoutingID()); |
1267 } | 1267 } |
| 1268 |
| 1269 const base::CommandLine& command_line = |
| 1270 *base::CommandLine::ForCurrentProcess(); |
| 1271 if (command_line.HasSwitch(switches::kDomAutomationController)) |
| 1272 enabled_bindings_ |= BINDINGS_POLICY_DOM_AUTOMATION; |
| 1273 if (command_line.HasSwitch(switches::kStatsCollectionController)) |
| 1274 enabled_bindings_ |= BINDINGS_POLICY_STATS_COLLECTION; |
1268 } | 1275 } |
1269 | 1276 |
1270 void RenderFrameImpl::InitializeBlameContext(RenderFrameImpl* parent_frame) { | 1277 void RenderFrameImpl::InitializeBlameContext(RenderFrameImpl* parent_frame) { |
1271 DCHECK(!blame_context_); | 1278 DCHECK(!blame_context_); |
1272 blame_context_ = base::MakeUnique<FrameBlameContext>(this, parent_frame); | 1279 blame_context_ = base::MakeUnique<FrameBlameContext>(this, parent_frame); |
1273 blame_context_->Initialize(); | 1280 blame_context_->Initialize(); |
1274 } | 1281 } |
1275 | 1282 |
1276 RenderWidget* RenderFrameImpl::GetRenderWidget() { | 1283 RenderWidget* RenderFrameImpl::GetRenderWidget() { |
1277 return GetLocalRoot()->render_widget_.get(); | 1284 return GetLocalRoot()->render_widget_.get(); |
(...skipping 361 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 1042 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2701 service_manager::GetInterfaceProviderSpec( | 2713 service_manager::GetInterfaceProviderSpec( |
2702 mojom::kNavigation_FrameSpec, child_info.interface_provider_specs, | 2714 mojom::kNavigation_FrameSpec, child_info.interface_provider_specs, |
2703 &child_spec); | 2715 &child_spec); |
2704 service_manager::GetInterfaceProviderSpec( | 2716 service_manager::GetInterfaceProviderSpec( |
2705 mojom::kNavigation_FrameSpec, browser_info.interface_provider_specs, | 2717 mojom::kNavigation_FrameSpec, browser_info.interface_provider_specs, |
2706 &browser_spec); | 2718 &browser_spec); |
2707 interface_registry_->Bind(std::move(request), child_info.identity, child_spec, | 2719 interface_registry_->Bind(std::move(request), child_info.identity, child_spec, |
2708 browser_info.identity, browser_spec); | 2720 browser_info.identity, browser_spec); |
2709 } | 2721 } |
2710 | 2722 |
| 2723 void RenderFrameImpl::AllowBindings(int32_t enabled_bindings_flags) { |
| 2724 if (IsMainFrame() && (enabled_bindings_flags & BINDINGS_POLICY_WEB_UI) && |
| 2725 !(enabled_bindings_ & BINDINGS_POLICY_WEB_UI)) { |
| 2726 // TODO(sammc): Move WebUIExtensionData to be a RenderFrameObserver. |
| 2727 // WebUIExtensionData deletes itself when |render_view_| is destroyed. |
| 2728 new WebUIExtensionData(render_view_); |
| 2729 } |
| 2730 |
| 2731 enabled_bindings_ |= enabled_bindings_flags; |
| 2732 |
| 2733 // Keep track of the total bindings accumulated in this process. |
| 2734 RenderProcess::current()->AddBindings(enabled_bindings_flags); |
| 2735 |
| 2736 MaybeEnableMojoBindings(); |
| 2737 } |
| 2738 |
2711 // mojom::HostZoom implementation ---------------------------------------------- | 2739 // mojom::HostZoom implementation ---------------------------------------------- |
2712 | 2740 |
2713 void RenderFrameImpl::SetHostZoomLevel(const GURL& url, double zoom_level) { | 2741 void RenderFrameImpl::SetHostZoomLevel(const GURL& url, double zoom_level) { |
2714 // TODO(wjmaclean): We should see if this restriction is really necessary, | 2742 // TODO(wjmaclean): We should see if this restriction is really necessary, |
2715 // since it isn't enforced in other parts of the page zoom system (e.g. | 2743 // since it isn't enforced in other parts of the page zoom system (e.g. |
2716 // when a users changes the zoom of a currently displayed page). Android | 2744 // when a users changes the zoom of a currently displayed page). Android |
2717 // has no UI for this, so in theory the following code would normally just use | 2745 // has no UI for this, so in theory the following code would normally just use |
2718 // the default zoom anyways. | 2746 // the default zoom anyways. |
2719 #if !defined(OS_ANDROID) | 2747 #if !defined(OS_ANDROID) |
2720 // On Android, page zoom isn't used, and in case of WebView, text zoom is used | 2748 // On Android, page zoom isn't used, and in case of WebView, text zoom is used |
(...skipping 980 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3701 | 3729 |
3702 for (auto& observer : observers_) | 3730 for (auto& observer : observers_) |
3703 observer.DidCreateNewDocument(); | 3731 observer.DidCreateNewDocument(); |
3704 for (auto& observer : render_view_->observers()) | 3732 for (auto& observer : render_view_->observers()) |
3705 observer.DidCreateNewDocument(frame); | 3733 observer.DidCreateNewDocument(frame); |
3706 } | 3734 } |
3707 | 3735 |
3708 void RenderFrameImpl::didClearWindowObject(blink::WebLocalFrame* frame) { | 3736 void RenderFrameImpl::didClearWindowObject(blink::WebLocalFrame* frame) { |
3709 DCHECK_EQ(frame_, frame); | 3737 DCHECK_EQ(frame_, frame); |
3710 | 3738 |
3711 int enabled_bindings = render_view_->GetEnabledBindings(); | 3739 if (enabled_bindings_ & BINDINGS_POLICY_WEB_UI) |
3712 | |
3713 if (enabled_bindings & BINDINGS_POLICY_WEB_UI) | |
3714 WebUIExtension::Install(frame); | 3740 WebUIExtension::Install(frame); |
3715 | 3741 |
3716 if (enabled_bindings & BINDINGS_POLICY_DOM_AUTOMATION) | 3742 if (enabled_bindings_ & BINDINGS_POLICY_DOM_AUTOMATION) |
3717 DomAutomationController::Install(this, frame); | 3743 DomAutomationController::Install(this, frame); |
3718 | 3744 |
3719 if (enabled_bindings & BINDINGS_POLICY_STATS_COLLECTION) | 3745 if (enabled_bindings_ & BINDINGS_POLICY_STATS_COLLECTION) |
3720 StatsCollectionController::Install(frame); | 3746 StatsCollectionController::Install(frame); |
3721 | 3747 |
3722 const base::CommandLine& command_line = | 3748 const base::CommandLine& command_line = |
3723 *base::CommandLine::ForCurrentProcess(); | 3749 *base::CommandLine::ForCurrentProcess(); |
3724 | 3750 |
3725 if (command_line.HasSwitch(cc::switches::kEnableGpuBenchmarking)) | 3751 if (command_line.HasSwitch(cc::switches::kEnableGpuBenchmarking)) |
3726 GpuBenchmarking::Install(frame); | 3752 GpuBenchmarking::Install(frame); |
3727 | 3753 |
3728 if (command_line.HasSwitch(switches::kEnableSkiaBenchmarking)) | 3754 if (command_line.HasSwitch(switches::kEnableSkiaBenchmarking)) |
3729 SkiaBenchmarking::Install(frame); | 3755 SkiaBenchmarking::Install(frame); |
(...skipping 2638 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6368 void RenderFrameImpl::SendUpdateState() { | 6394 void RenderFrameImpl::SendUpdateState() { |
6369 DCHECK(SiteIsolationPolicy::UseSubframeNavigationEntries()); | 6395 DCHECK(SiteIsolationPolicy::UseSubframeNavigationEntries()); |
6370 if (current_history_item_.isNull()) | 6396 if (current_history_item_.isNull()) |
6371 return; | 6397 return; |
6372 | 6398 |
6373 Send(new FrameHostMsg_UpdateState( | 6399 Send(new FrameHostMsg_UpdateState( |
6374 routing_id_, SingleHistoryItemToPageState(current_history_item_))); | 6400 routing_id_, SingleHistoryItemToPageState(current_history_item_))); |
6375 } | 6401 } |
6376 | 6402 |
6377 void RenderFrameImpl::MaybeEnableMojoBindings() { | 6403 void RenderFrameImpl::MaybeEnableMojoBindings() { |
6378 int enabled_bindings = RenderProcess::current()->GetEnabledBindings(); | |
6379 // BINDINGS_POLICY_WEB_UI, BINDINGS_POLICY_MOJO and BINDINGS_POLICY_HEADLESS | 6404 // BINDINGS_POLICY_WEB_UI, BINDINGS_POLICY_MOJO and BINDINGS_POLICY_HEADLESS |
6380 // are mutually exclusive. They provide access to Mojo bindings, but do so in | 6405 // are mutually exclusive. They provide access to Mojo bindings, but do so in |
6381 // incompatible ways. | 6406 // incompatible ways. |
6382 const int kAllBindingsTypes = | 6407 const int kAllBindingsTypes = |
6383 BINDINGS_POLICY_WEB_UI | BINDINGS_POLICY_MOJO | BINDINGS_POLICY_HEADLESS; | 6408 BINDINGS_POLICY_WEB_UI | BINDINGS_POLICY_MOJO | BINDINGS_POLICY_HEADLESS; |
6384 | 6409 |
6385 // Make sure that at most one of BINDINGS_POLICY_WEB_UI, BINDINGS_POLICY_MOJO | 6410 // Make sure that at most one of BINDINGS_POLICY_WEB_UI, BINDINGS_POLICY_MOJO |
6386 // and BINDINGS_POLICY_HEADLESS have been set. | 6411 // and BINDINGS_POLICY_HEADLESS have been set. |
6387 // NOTE x & (x - 1) == 0 is true iff x is zero or a power of two. | 6412 // NOTE x & (x - 1) == 0 is true iff x is zero or a power of two. |
6388 DCHECK_EQ((enabled_bindings & kAllBindingsTypes) & | 6413 DCHECK_EQ((enabled_bindings_ & kAllBindingsTypes) & |
6389 ((enabled_bindings & kAllBindingsTypes) - 1), | 6414 ((enabled_bindings_ & kAllBindingsTypes) - 1), |
6390 0); | 6415 0); |
6391 | 6416 |
| 6417 DCHECK_EQ(RenderProcess::current()->GetEnabledBindings(), enabled_bindings_); |
| 6418 |
6392 // If an MojoBindingsController already exists for this RenderFrameImpl, avoid | 6419 // If an MojoBindingsController already exists for this RenderFrameImpl, avoid |
6393 // creating another one. It is not kept as a member, as it deletes itself when | 6420 // creating another one. It is not kept as a member, as it deletes itself when |
6394 // the frame is destroyed. | 6421 // the frame is destroyed. |
6395 if (RenderFrameObserverTracker<MojoBindingsController>::Get(this)) | 6422 if (RenderFrameObserverTracker<MojoBindingsController>::Get(this)) |
6396 return; | 6423 return; |
6397 | 6424 |
6398 if (IsMainFrame() && | 6425 if (IsMainFrame() && enabled_bindings_ & BINDINGS_POLICY_WEB_UI) { |
6399 enabled_bindings & BINDINGS_POLICY_WEB_UI) { | |
6400 new MojoBindingsController(this, MojoBindingsType::FOR_WEB_UI); | 6426 new MojoBindingsController(this, MojoBindingsType::FOR_WEB_UI); |
6401 } else if (enabled_bindings & BINDINGS_POLICY_MOJO) { | 6427 } else if (enabled_bindings_ & BINDINGS_POLICY_MOJO) { |
6402 new MojoBindingsController(this, MojoBindingsType::FOR_LAYOUT_TESTS); | 6428 new MojoBindingsController(this, MojoBindingsType::FOR_LAYOUT_TESTS); |
6403 } else if (enabled_bindings & BINDINGS_POLICY_HEADLESS) { | 6429 } else if (enabled_bindings_ & BINDINGS_POLICY_HEADLESS) { |
6404 new MojoBindingsController(this, MojoBindingsType::FOR_HEADLESS); | 6430 new MojoBindingsController(this, MojoBindingsType::FOR_HEADLESS); |
6405 } | 6431 } |
6406 } | 6432 } |
6407 | 6433 |
6408 void RenderFrameImpl::SendFailedProvisionalLoad( | 6434 void RenderFrameImpl::SendFailedProvisionalLoad( |
6409 const blink::WebURLRequest& request, | 6435 const blink::WebURLRequest& request, |
6410 const blink::WebURLError& error, | 6436 const blink::WebURLError& error, |
6411 blink::WebLocalFrame* frame) { | 6437 blink::WebLocalFrame* frame) { |
6412 bool show_repost_interstitial = | 6438 bool show_repost_interstitial = |
6413 (error.reason == net::ERR_CACHE_MISS && | 6439 (error.reason == net::ERR_CACHE_MISS && |
(...skipping 253 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6667 focused_pepper_plugin_->HandleTextInput(text); | 6693 focused_pepper_plugin_->HandleTextInput(text); |
6668 } | 6694 } |
6669 pepper_composition_text_.clear(); | 6695 pepper_composition_text_.clear(); |
6670 } | 6696 } |
6671 #endif // ENABLE_PLUGINS | 6697 #endif // ENABLE_PLUGINS |
6672 | 6698 |
6673 void RenderFrameImpl::RegisterMojoInterfaces() { | 6699 void RenderFrameImpl::RegisterMojoInterfaces() { |
6674 GetAssociatedInterfaceRegistry()->AddInterface( | 6700 GetAssociatedInterfaceRegistry()->AddInterface( |
6675 base::Bind(&RenderFrameImpl::BindEngagement, weak_factory_.GetWeakPtr())); | 6701 base::Bind(&RenderFrameImpl::BindEngagement, weak_factory_.GetWeakPtr())); |
6676 | 6702 |
| 6703 GetAssociatedInterfaceRegistry()->AddInterface(base::Bind( |
| 6704 &RenderFrameImpl::BindFrameBindingsControl, weak_factory_.GetWeakPtr())); |
| 6705 |
6677 if (!frame_->parent()) { | 6706 if (!frame_->parent()) { |
6678 // Only main frame have ImageDownloader service. | 6707 // Only main frame have ImageDownloader service. |
6679 GetInterfaceRegistry()->AddInterface(base::Bind( | 6708 GetInterfaceRegistry()->AddInterface(base::Bind( |
6680 &ImageDownloaderImpl::CreateMojoService, base::Unretained(this))); | 6709 &ImageDownloaderImpl::CreateMojoService, base::Unretained(this))); |
6681 | 6710 |
6682 // Host zoom is per-page, so only added on the main frame. | 6711 // Host zoom is per-page, so only added on the main frame. |
6683 GetAssociatedInterfaceRegistry()->AddInterface(base::Bind( | 6712 GetAssociatedInterfaceRegistry()->AddInterface(base::Bind( |
6684 &RenderFrameImpl::OnHostZoomClientRequest, weak_factory_.GetWeakPtr())); | 6713 &RenderFrameImpl::OnHostZoomClientRequest, weak_factory_.GetWeakPtr())); |
6685 } | 6714 } |
6686 } | 6715 } |
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6736 } | 6765 } |
6737 | 6766 |
6738 blink::WebPageVisibilityState RenderFrameImpl::GetVisibilityState() const { | 6767 blink::WebPageVisibilityState RenderFrameImpl::GetVisibilityState() const { |
6739 return visibilityState(); | 6768 return visibilityState(); |
6740 } | 6769 } |
6741 | 6770 |
6742 bool RenderFrameImpl::IsBrowserSideNavigationPending() { | 6771 bool RenderFrameImpl::IsBrowserSideNavigationPending() { |
6743 return browser_side_navigation_pending_; | 6772 return browser_side_navigation_pending_; |
6744 } | 6773 } |
6745 | 6774 |
| 6775 int RenderFrameImpl::GetEnabledBindings() const { |
| 6776 return enabled_bindings_; |
| 6777 } |
| 6778 |
6746 blink::WebPlugin* RenderFrameImpl::GetWebPluginForFind() { | 6779 blink::WebPlugin* RenderFrameImpl::GetWebPluginForFind() { |
6747 if (frame_->document().isPluginDocument()) | 6780 if (frame_->document().isPluginDocument()) |
6748 return frame_->document().to<WebPluginDocument>().plugin(); | 6781 return frame_->document().to<WebPluginDocument>().plugin(); |
6749 | 6782 |
6750 #if BUILDFLAG(ENABLE_PLUGINS) | 6783 #if BUILDFLAG(ENABLE_PLUGINS) |
6751 if (plugin_find_handler_) | 6784 if (plugin_find_handler_) |
6752 return plugin_find_handler_->container()->plugin(); | 6785 return plugin_find_handler_->container()->plugin(); |
6753 #endif | 6786 #endif |
6754 | 6787 |
6755 return nullptr; | 6788 return nullptr; |
(...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6873 // event target. Potentially a Pepper plugin will receive the event. | 6906 // event target. Potentially a Pepper plugin will receive the event. |
6874 // In order to tell whether a plugin gets the last mouse event and which it | 6907 // In order to tell whether a plugin gets the last mouse event and which it |
6875 // is, we set |pepper_last_mouse_event_target_| to null here. If a plugin gets | 6908 // is, we set |pepper_last_mouse_event_target_| to null here. If a plugin gets |
6876 // the event, it will notify us via DidReceiveMouseEvent() and set itself as | 6909 // the event, it will notify us via DidReceiveMouseEvent() and set itself as |
6877 // |pepper_last_mouse_event_target_|. | 6910 // |pepper_last_mouse_event_target_|. |
6878 pepper_last_mouse_event_target_ = nullptr; | 6911 pepper_last_mouse_event_target_ = nullptr; |
6879 #endif | 6912 #endif |
6880 } | 6913 } |
6881 | 6914 |
6882 } // namespace content | 6915 } // namespace content |
OLD | NEW |