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

Side by Side Diff: content/browser/frame_host/render_frame_host_impl.cc

Issue 2020633003: Revert of Add FrameHost mojo service (patchset #23 id:490001 of https://codereview.chromium.org/196… (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@2743
Patch Set: Created 4 years, 6 months 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/browser/frame_host/render_frame_host_impl.h" 5 #include "content/browser/frame_host/render_frame_host_impl.h"
6 6
7 #include <utility> 7 #include <utility>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/command_line.h" 10 #include "base/command_line.h"
(...skipping 20 matching lines...) Expand all
31 #include "content/browser/frame_host/frame_tree_node.h" 31 #include "content/browser/frame_host/frame_tree_node.h"
32 #include "content/browser/frame_host/navigation_entry_impl.h" 32 #include "content/browser/frame_host/navigation_entry_impl.h"
33 #include "content/browser/frame_host/navigation_handle_impl.h" 33 #include "content/browser/frame_host/navigation_handle_impl.h"
34 #include "content/browser/frame_host/navigation_request.h" 34 #include "content/browser/frame_host/navigation_request.h"
35 #include "content/browser/frame_host/navigator.h" 35 #include "content/browser/frame_host/navigator.h"
36 #include "content/browser/frame_host/navigator_impl.h" 36 #include "content/browser/frame_host/navigator_impl.h"
37 #include "content/browser/frame_host/render_frame_host_delegate.h" 37 #include "content/browser/frame_host/render_frame_host_delegate.h"
38 #include "content/browser/frame_host/render_frame_proxy_host.h" 38 #include "content/browser/frame_host/render_frame_proxy_host.h"
39 #include "content/browser/frame_host/render_widget_host_view_child_frame.h" 39 #include "content/browser/frame_host/render_widget_host_view_child_frame.h"
40 #include "content/browser/geolocation/geolocation_service_context.h" 40 #include "content/browser/geolocation/geolocation_service_context.h"
41 #include "content/browser/host_zoom_map_impl.h"
42 #include "content/browser/loader/resource_dispatcher_host_impl.h" 41 #include "content/browser/loader/resource_dispatcher_host_impl.h"
43 #include "content/browser/permissions/permission_service_context.h" 42 #include "content/browser/permissions/permission_service_context.h"
44 #include "content/browser/permissions/permission_service_impl.h" 43 #include "content/browser/permissions/permission_service_impl.h"
45 #include "content/browser/presentation/presentation_service_impl.h" 44 #include "content/browser/presentation/presentation_service_impl.h"
46 #include "content/browser/renderer_host/input/input_router_impl.h" 45 #include "content/browser/renderer_host/input/input_router_impl.h"
47 #include "content/browser/renderer_host/input/timeout_monitor.h" 46 #include "content/browser/renderer_host/input/timeout_monitor.h"
48 #include "content/browser/renderer_host/render_process_host_impl.h" 47 #include "content/browser/renderer_host/render_process_host_impl.h"
49 #include "content/browser/renderer_host/render_view_host_delegate.h" 48 #include "content/browser/renderer_host/render_view_host_delegate.h"
50 #include "content/browser/renderer_host/render_view_host_delegate_view.h" 49 #include "content/browser/renderer_host/render_view_host_delegate_view.h"
51 #include "content/browser/renderer_host/render_view_host_impl.h" 50 #include "content/browser/renderer_host/render_view_host_impl.h"
(...skipping 13 matching lines...) Expand all
65 #include "content/public/browser/ax_event_notification_details.h" 64 #include "content/public/browser/ax_event_notification_details.h"
66 #include "content/public/browser/browser_accessibility_state.h" 65 #include "content/public/browser/browser_accessibility_state.h"
67 #include "content/public/browser/browser_context.h" 66 #include "content/public/browser/browser_context.h"
68 #include "content/public/browser/browser_plugin_guest_manager.h" 67 #include "content/public/browser/browser_plugin_guest_manager.h"
69 #include "content/public/browser/browser_thread.h" 68 #include "content/public/browser/browser_thread.h"
70 #include "content/public/browser/content_browser_client.h" 69 #include "content/public/browser/content_browser_client.h"
71 #include "content/public/browser/permission_manager.h" 70 #include "content/public/browser/permission_manager.h"
72 #include "content/public/browser/permission_type.h" 71 #include "content/public/browser/permission_type.h"
73 #include "content/public/browser/render_process_host.h" 72 #include "content/public/browser/render_process_host.h"
74 #include "content/public/browser/render_widget_host_view.h" 73 #include "content/public/browser/render_widget_host_view.h"
75 #include "content/public/browser/storage_partition.h"
76 #include "content/public/browser/stream_handle.h" 74 #include "content/public/browser/stream_handle.h"
77 #include "content/public/browser/user_metrics.h" 75 #include "content/public/browser/user_metrics.h"
78 #include "content/public/common/browser_side_navigation_policy.h" 76 #include "content/public/common/browser_side_navigation_policy.h"
79 #include "content/public/common/content_constants.h" 77 #include "content/public/common/content_constants.h"
80 #include "content/public/common/content_switches.h" 78 #include "content/public/common/content_switches.h"
81 #include "content/public/common/isolated_world_ids.h" 79 #include "content/public/common/isolated_world_ids.h"
82 #include "content/public/common/url_constants.h" 80 #include "content/public/common/url_constants.h"
83 #include "content/public/common/url_utils.h" 81 #include "content/public/common/url_utils.h"
84 #include "device/vibration/vibration_manager_impl.h" 82 #include "device/vibration/vibration_manager_impl.h"
85 #include "ui/accessibility/ax_tree.h" 83 #include "ui/accessibility/ax_tree.h"
(...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after
204 RenderViewHostImpl* render_view_host, 202 RenderViewHostImpl* render_view_host,
205 RenderFrameHostDelegate* delegate, 203 RenderFrameHostDelegate* delegate,
206 RenderWidgetHostDelegate* rwh_delegate, 204 RenderWidgetHostDelegate* rwh_delegate,
207 FrameTree* frame_tree, 205 FrameTree* frame_tree,
208 FrameTreeNode* frame_tree_node, 206 FrameTreeNode* frame_tree_node,
209 int32_t routing_id, 207 int32_t routing_id,
210 int32_t widget_routing_id, 208 int32_t widget_routing_id,
211 bool hidden) 209 bool hidden)
212 : render_view_host_(render_view_host), 210 : render_view_host_(render_view_host),
213 delegate_(delegate), 211 delegate_(delegate),
214 frame_host_binding_(this),
215 site_instance_(static_cast<SiteInstanceImpl*>(site_instance)), 212 site_instance_(static_cast<SiteInstanceImpl*>(site_instance)),
216 process_(site_instance->GetProcess()), 213 process_(site_instance->GetProcess()),
217 cross_process_frame_connector_(NULL), 214 cross_process_frame_connector_(NULL),
218 render_frame_proxy_host_(NULL), 215 render_frame_proxy_host_(NULL),
219 frame_tree_(frame_tree), 216 frame_tree_(frame_tree),
220 frame_tree_node_(frame_tree_node), 217 frame_tree_node_(frame_tree_node),
221 render_widget_host_(nullptr), 218 render_widget_host_(nullptr),
222 routing_id_(routing_id), 219 routing_id_(routing_id),
223 is_waiting_for_swapout_ack_(false), 220 is_waiting_for_swapout_ack_(false),
224 render_frame_created_(false), 221 render_frame_created_(false),
(...skipping 1764 matching lines...) Expand 10 before | Expand all | Expand 10 after
1989 #if defined(ENABLE_WEBVR) 1986 #if defined(ENABLE_WEBVR)
1990 const base::CommandLine& browser_command_line = 1987 const base::CommandLine& browser_command_line =
1991 *base::CommandLine::ForCurrentProcess(); 1988 *base::CommandLine::ForCurrentProcess();
1992 1989
1993 if (browser_command_line.HasSwitch(switches::kEnableWebVR)) { 1990 if (browser_command_line.HasSwitch(switches::kEnableWebVR)) {
1994 GetServiceRegistry()->AddService<blink::mojom::VRService>( 1991 GetServiceRegistry()->AddService<blink::mojom::VRService>(
1995 base::Bind(&VRDeviceManager::BindRequest)); 1992 base::Bind(&VRDeviceManager::BindRequest));
1996 } 1993 }
1997 #endif 1994 #endif
1998 1995
1999 GetServiceRegistry()->AddService<mojom::FrameHost>(base::Bind(
2000 &RenderFrameHostImpl::BindFrameHostService, base::Unretained(this)));
2001
2002 GetContentClient()->browser()->RegisterRenderFrameMojoServices( 1996 GetContentClient()->browser()->RegisterRenderFrameMojoServices(
2003 GetServiceRegistry(), this); 1997 GetServiceRegistry(), this);
2004 } 1998 }
2005 1999
2006 void RenderFrameHostImpl::ResetWaitingState() { 2000 void RenderFrameHostImpl::ResetWaitingState() {
2007 DCHECK(is_active()); 2001 DCHECK(is_active());
2008 2002
2009 // The active state of the RVH is determined by its main frame, since 2003 // The active state of the RVH is determined by its main frame, since
2010 // subframes should have their own widgets. 2004 // subframes should have their own widgets.
2011 if (frame_tree_node_->IsMainFrame()) { 2005 if (frame_tree_node_->IsMainFrame()) {
(...skipping 562 matching lines...) Expand 10 before | Expand all | Expand 10 after
2574 2568
2575 return is_live; 2569 return is_live;
2576 } 2570 }
2577 2571
2578 int RenderFrameHostImpl::GetProxyCount() { 2572 int RenderFrameHostImpl::GetProxyCount() {
2579 if (this != frame_tree_node_->current_frame_host()) 2573 if (this != frame_tree_node_->current_frame_host())
2580 return 0; 2574 return 0;
2581 return frame_tree_node_->render_manager()->GetProxyCount(); 2575 return frame_tree_node_->render_manager()->GetProxyCount();
2582 } 2576 }
2583 2577
2584 void RenderFrameHostImpl::GetHostZoomLevel(
2585 const GURL& url,
2586 const GetHostZoomLevelCallback& callback) {
2587 RenderProcessHost* render_process_host =
2588 RenderProcessHost::FromID(GetProcess()->GetID());
2589 double zoom_level = 0.0;
2590 if (render_process_host) {
2591 const HostZoomMapImpl* host_zoom_map = static_cast<const HostZoomMapImpl*>(
2592 render_process_host->GetStoragePartition()->GetHostZoomMap());
2593 zoom_level = host_zoom_map->GetZoomLevelForView(url, GetProcess()->GetID(),
2594 routing_id_);
2595 }
2596 callback.Run(zoom_level);
2597 }
2598
2599 #if defined(OS_MACOSX) 2578 #if defined(OS_MACOSX)
2600 2579
2601 void RenderFrameHostImpl::DidSelectPopupMenuItem(int selected_index) { 2580 void RenderFrameHostImpl::DidSelectPopupMenuItem(int selected_index) {
2602 Send(new FrameMsg_SelectPopupMenuItem(routing_id_, selected_index)); 2581 Send(new FrameMsg_SelectPopupMenuItem(routing_id_, selected_index));
2603 } 2582 }
2604 2583
2605 void RenderFrameHostImpl::DidCancelPopupMenu() { 2584 void RenderFrameHostImpl::DidCancelPopupMenu() {
2606 Send(new FrameMsg_SelectPopupMenuItem(routing_id_, -1)); 2585 Send(new FrameMsg_SelectPopupMenuItem(routing_id_, -1));
2607 } 2586 }
2608 2587
(...skipping 208 matching lines...) Expand 10 before | Expand all | Expand 10 after
2817 // For the root frame tree node, also store the AXTreeID of the focused frame. 2796 // For the root frame tree node, also store the AXTreeID of the focused frame.
2818 FrameTreeNode* focused_frame_tree_node = frame_tree_->GetFocusedFrame(); 2797 FrameTreeNode* focused_frame_tree_node = frame_tree_->GetFocusedFrame();
2819 if (!focused_frame_tree_node) 2798 if (!focused_frame_tree_node)
2820 return; 2799 return;
2821 RenderFrameHostImpl* focused_frame = 2800 RenderFrameHostImpl* focused_frame =
2822 focused_frame_tree_node->current_frame_host(); 2801 focused_frame_tree_node->current_frame_host();
2823 DCHECK(focused_frame); 2802 DCHECK(focused_frame);
2824 dst->focused_tree_id = focused_frame->GetAXTreeID(); 2803 dst->focused_tree_id = focused_frame->GetAXTreeID();
2825 } 2804 }
2826 2805
2827 void RenderFrameHostImpl::BindFrameHostService(
2828 mojom::FrameHostRequest request) {
2829 frame_host_binding_.Bind(std::move(request));
2830 frame_host_binding_.set_connection_error_handler(
2831 base::Bind(&mojo::Binding<mojom::FrameHost>::Unbind,
2832 base::Unretained(&frame_host_binding_)));
2833 }
2834
2835 void RenderFrameHostImpl::CreateWebBluetoothService( 2806 void RenderFrameHostImpl::CreateWebBluetoothService(
2836 blink::mojom::WebBluetoothServiceRequest request) { 2807 blink::mojom::WebBluetoothServiceRequest request) {
2837 DCHECK(!web_bluetooth_service_); 2808 DCHECK(!web_bluetooth_service_);
2838 web_bluetooth_service_.reset( 2809 web_bluetooth_service_.reset(
2839 new WebBluetoothServiceImpl(this, std::move(request))); 2810 new WebBluetoothServiceImpl(this, std::move(request)));
2840 // RFHI owns web_bluetooth_service_ and web_bluetooth_service owns the 2811 // RFHI owns web_bluetooth_service_ and web_bluetooth_service owns the
2841 // binding_ which may run the error handler. binding_ can't run the error 2812 // binding_ which may run the error handler. binding_ can't run the error
2842 // handler after it's destroyed so it can't run after the RFHI is destroyed. 2813 // handler after it's destroyed so it can't run after the RFHI is destroyed.
2843 web_bluetooth_service_->SetClientConnectionErrorHandler(base::Bind( 2814 web_bluetooth_service_->SetClientConnectionErrorHandler(base::Bind(
2844 &RenderFrameHostImpl::DeleteWebBluetoothService, base::Unretained(this))); 2815 &RenderFrameHostImpl::DeleteWebBluetoothService, base::Unretained(this)));
2845 } 2816 }
2846 2817
2847 void RenderFrameHostImpl::DeleteWebBluetoothService() { 2818 void RenderFrameHostImpl::DeleteWebBluetoothService() {
2848 web_bluetooth_service_.reset(); 2819 web_bluetooth_service_.reset();
2849 } 2820 }
2850 2821
2851 } // namespace content 2822 } // namespace content
OLDNEW
« no previous file with comments | « content/browser/frame_host/render_frame_host_impl.h ('k') | content/browser/host_zoom_map_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698