Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(72)

Side by Side Diff: content/renderer/render_frame_impl.cc

Issue 2456493003: Add frame-specific InterfaceProviderSpec. (Closed)
Patch Set: . Created 4 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 61 matching lines...) Expand 10 before | Expand all | Expand 10 after
72 #include "content/public/common/content_constants.h" 72 #include "content/public/common/content_constants.h"
73 #include "content/public/common/content_features.h" 73 #include "content/public/common/content_features.h"
74 #include "content/public/common/content_switches.h" 74 #include "content/public/common/content_switches.h"
75 #include "content/public/common/context_menu_params.h" 75 #include "content/public/common/context_menu_params.h"
76 #include "content/public/common/file_chooser_file_info.h" 76 #include "content/public/common/file_chooser_file_info.h"
77 #include "content/public/common/file_chooser_params.h" 77 #include "content/public/common/file_chooser_params.h"
78 #include "content/public/common/isolated_world_ids.h" 78 #include "content/public/common/isolated_world_ids.h"
79 #include "content/public/common/page_state.h" 79 #include "content/public/common/page_state.h"
80 #include "content/public/common/resource_response.h" 80 #include "content/public/common/resource_response.h"
81 #include "content/public/common/service_manager_connection.h" 81 #include "content/public/common/service_manager_connection.h"
82 #include "content/public/common/service_names.h"
82 #include "content/public/common/url_constants.h" 83 #include "content/public/common/url_constants.h"
83 #include "content/public/common/url_utils.h" 84 #include "content/public/common/url_utils.h"
84 #include "content/public/renderer/browser_plugin_delegate.h" 85 #include "content/public/renderer/browser_plugin_delegate.h"
85 #include "content/public/renderer/content_renderer_client.h" 86 #include "content/public/renderer/content_renderer_client.h"
86 #include "content/public/renderer/context_menu_client.h" 87 #include "content/public/renderer/context_menu_client.h"
87 #include "content/public/renderer/document_state.h" 88 #include "content/public/renderer/document_state.h"
88 #include "content/public/renderer/navigation_state.h" 89 #include "content/public/renderer/navigation_state.h"
89 #include "content/public/renderer/render_frame_observer.h" 90 #include "content/public/renderer/render_frame_observer.h"
90 #include "content/public/renderer/renderer_ppapi_host.h" 91 #include "content/public/renderer/renderer_ppapi_host.h"
91 #include "content/renderer/accessibility/render_accessibility_impl.h" 92 #include "content/renderer/accessibility/render_accessibility_impl.h"
(...skipping 1027 matching lines...) Expand 10 before | Expand all | Expand 10 after
1119 #endif 1120 #endif
1120 frame_binding_(this), 1121 frame_binding_(this),
1121 host_zoom_binding_(this), 1122 host_zoom_binding_(this),
1122 has_accessed_initial_document_(false), 1123 has_accessed_initial_document_(false),
1123 weak_factory_(this) { 1124 weak_factory_(this) {
1124 // We don't have a service_manager::Connection at this point, so use empty 1125 // We don't have a service_manager::Connection at this point, so use empty
1125 // identity/specs. 1126 // identity/specs.
1126 // TODO(beng): We should fix this, so we can apply policy about which 1127 // TODO(beng): We should fix this, so we can apply policy about which
1127 // interfaces get exposed. 1128 // interfaces get exposed.
1128 interface_registry_ = base::MakeUnique<service_manager::InterfaceRegistry>( 1129 interface_registry_ = base::MakeUnique<service_manager::InterfaceRegistry>(
1129 service_manager::Identity(), service_manager::InterfaceProviderSpec()); 1130 mojom::kNavigation_FrameSpec);
1130 service_manager::mojom::InterfaceProviderPtr remote_interfaces; 1131 service_manager::mojom::InterfaceProviderPtr remote_interfaces;
1131 pending_remote_interface_provider_request_ = GetProxy(&remote_interfaces); 1132 pending_remote_interface_provider_request_ = GetProxy(&remote_interfaces);
1132 remote_interfaces_.reset(new service_manager::InterfaceProvider); 1133 remote_interfaces_.reset(new service_manager::InterfaceProvider);
1133 remote_interfaces_->Bind(std::move(remote_interfaces)); 1134 remote_interfaces_->Bind(std::move(remote_interfaces));
1134 blink_interface_provider_.reset(new BlinkInterfaceProviderImpl( 1135 blink_interface_provider_.reset(new BlinkInterfaceProviderImpl(
1135 remote_interfaces_->GetWeakPtr())); 1136 remote_interfaces_->GetWeakPtr()));
1136 blink_interface_registry_.reset( 1137 blink_interface_registry_.reset(
1137 new BlinkInterfaceRegistryImpl(interface_registry_->GetWeakPtr())); 1138 new BlinkInterfaceRegistryImpl(interface_registry_->GetWeakPtr()));
1138 1139
1139 std::pair<RoutingIDFrameMap::iterator, bool> result = 1140 std::pair<RoutingIDFrameMap::iterator, bool> result =
(...skipping 1495 matching lines...) Expand 10 before | Expand all | Expand 10 after
2635 } 2636 }
2636 2637
2637 bool RenderFrameImpl::IsPasting() const { 2638 bool RenderFrameImpl::IsPasting() const {
2638 return is_pasting_; 2639 return is_pasting_;
2639 } 2640 }
2640 2641
2641 // mojom::Frame implementation ------------------------------------------------- 2642 // mojom::Frame implementation -------------------------------------------------
2642 2643
2643 void RenderFrameImpl::GetInterfaceProvider( 2644 void RenderFrameImpl::GetInterfaceProvider(
2644 service_manager::mojom::InterfaceProviderRequest request) { 2645 service_manager::mojom::InterfaceProviderRequest request) {
2645 interface_registry_->Bind(std::move(request), 2646 service_manager::ServiceInfo child_info =
2646 service_manager::Identity(), 2647 ChildThreadImpl::current()->GetChildServiceInfo();
2647 service_manager::InterfaceProviderSpec()); 2648 service_manager::ServiceInfo browser_info =
2649 ChildThreadImpl::current()->GetBrowserServiceInfo();
2650
2651 service_manager::InterfaceProviderSpec child_spec, browser_spec;
2652 // TODO(beng): CHECK these return true.
2653 service_manager::GetInterfaceProviderSpec(
2654 mojom::kNavigation_FrameSpec, child_info.interface_provider_specs,
2655 &child_spec);
2656 service_manager::GetInterfaceProviderSpec(
2657 mojom::kNavigation_FrameSpec, browser_info.interface_provider_specs,
2658 &browser_spec);
2659 interface_registry_->Bind(std::move(request), child_info.identity, child_spec,
2660 browser_info.identity, browser_spec);
2648 } 2661 }
2649 2662
2650 // mojom::HostZoom implementation ---------------------------------------------- 2663 // mojom::HostZoom implementation ----------------------------------------------
2651 2664
2652 void RenderFrameImpl::SetHostZoomLevel(const GURL& url, double zoom_level) { 2665 void RenderFrameImpl::SetHostZoomLevel(const GURL& url, double zoom_level) {
2653 // TODO(wjmaclean): We should see if this restriction is really necessary, 2666 // TODO(wjmaclean): We should see if this restriction is really necessary,
2654 // since it isn't enforced in other parts of the page zoom system (e.g. 2667 // since it isn't enforced in other parts of the page zoom system (e.g.
2655 // when a users changes the zoom of a currently displayed page). Android 2668 // when a users changes the zoom of a currently displayed page). Android
2656 // has no UI for this, so in theory the following code would normally just use 2669 // has no UI for this, so in theory the following code would normally just use
2657 // the default zoom anyways. 2670 // the default zoom anyways.
(...skipping 3966 matching lines...) Expand 10 before | Expand all | Expand 10 after
6624 // event target. Potentially a Pepper plugin will receive the event. 6637 // event target. Potentially a Pepper plugin will receive the event.
6625 // In order to tell whether a plugin gets the last mouse event and which it 6638 // In order to tell whether a plugin gets the last mouse event and which it
6626 // is, we set |pepper_last_mouse_event_target_| to null here. If a plugin gets 6639 // is, we set |pepper_last_mouse_event_target_| to null here. If a plugin gets
6627 // the event, it will notify us via DidReceiveMouseEvent() and set itself as 6640 // the event, it will notify us via DidReceiveMouseEvent() and set itself as
6628 // |pepper_last_mouse_event_target_|. 6641 // |pepper_last_mouse_event_target_|.
6629 pepper_last_mouse_event_target_ = nullptr; 6642 pepper_last_mouse_event_target_ = nullptr;
6630 #endif 6643 #endif
6631 } 6644 }
6632 6645
6633 } // namespace content 6646 } // namespace content
OLDNEW
« no previous file with comments | « content/renderer/render_frame_impl.h ('k') | content/renderer/service_worker/embedded_worker_instance_client_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698