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

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

Issue 628773003: Partially convert geolocation IPC to Mojo. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Response to review Created 6 years, 2 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 "base/bind.h" 7 #include "base/bind.h"
8 #include "base/command_line.h" 8 #include "base/command_line.h"
9 #include "base/containers/hash_tables.h" 9 #include "base/containers/hash_tables.h"
10 #include "base/lazy_instance.h" 10 #include "base/lazy_instance.h"
11 #include "base/metrics/histogram.h" 11 #include "base/metrics/histogram.h"
12 #include "base/metrics/user_metrics_action.h" 12 #include "base/metrics/user_metrics_action.h"
13 #include "base/time/time.h" 13 #include "base/time/time.h"
14 #include "content/browser/accessibility/accessibility_mode_helper.h" 14 #include "content/browser/accessibility/accessibility_mode_helper.h"
15 #include "content/browser/accessibility/browser_accessibility_manager.h" 15 #include "content/browser/accessibility/browser_accessibility_manager.h"
16 #include "content/browser/accessibility/browser_accessibility_state_impl.h" 16 #include "content/browser/accessibility/browser_accessibility_state_impl.h"
17 #include "content/browser/child_process_security_policy_impl.h" 17 #include "content/browser/child_process_security_policy_impl.h"
18 #include "content/browser/frame_host/cross_process_frame_connector.h" 18 #include "content/browser/frame_host/cross_process_frame_connector.h"
19 #include "content/browser/frame_host/cross_site_transferring_request.h" 19 #include "content/browser/frame_host/cross_site_transferring_request.h"
20 #include "content/browser/frame_host/frame_accessibility.h" 20 #include "content/browser/frame_host/frame_accessibility.h"
21 #include "content/browser/frame_host/frame_tree.h" 21 #include "content/browser/frame_host/frame_tree.h"
22 #include "content/browser/frame_host/frame_tree_node.h" 22 #include "content/browser/frame_host/frame_tree_node.h"
23 #include "content/browser/frame_host/navigator.h" 23 #include "content/browser/frame_host/navigator.h"
24 #include "content/browser/frame_host/render_frame_host_delegate.h" 24 #include "content/browser/frame_host/render_frame_host_delegate.h"
25 #include "content/browser/frame_host/render_frame_proxy_host.h" 25 #include "content/browser/frame_host/render_frame_proxy_host.h"
26 #include "content/browser/frame_host/render_widget_host_view_child_frame.h" 26 #include "content/browser/frame_host/render_widget_host_view_child_frame.h"
27 #include "content/browser/geolocation/geolocation_service_context.h"
27 #include "content/browser/renderer_host/input/input_router.h" 28 #include "content/browser/renderer_host/input/input_router.h"
28 #include "content/browser/renderer_host/input/timeout_monitor.h" 29 #include "content/browser/renderer_host/input/timeout_monitor.h"
29 #include "content/browser/renderer_host/render_process_host_impl.h" 30 #include "content/browser/renderer_host/render_process_host_impl.h"
30 #include "content/browser/renderer_host/render_view_host_delegate.h" 31 #include "content/browser/renderer_host/render_view_host_delegate.h"
31 #include "content/browser/renderer_host/render_view_host_delegate_view.h" 32 #include "content/browser/renderer_host/render_view_host_delegate_view.h"
32 #include "content/browser/renderer_host/render_view_host_impl.h" 33 #include "content/browser/renderer_host/render_view_host_impl.h"
33 #include "content/browser/renderer_host/render_widget_host_impl.h" 34 #include "content/browser/renderer_host/render_widget_host_impl.h"
34 #include "content/browser/renderer_host/render_widget_host_view_base.h" 35 #include "content/browser/renderer_host/render_widget_host_view_base.h"
35 #include "content/browser/transition_request_manager.h" 36 #include "content/browser/transition_request_manager.h"
36 #include "content/common/accessibility_messages.h" 37 #include "content/common/accessibility_messages.h"
(...skipping 158 matching lines...) Expand 10 before | Expand all | Expand 10 after
195 this)); 196 this));
196 197
197 if (is_swapped_out) { 198 if (is_swapped_out) {
198 rfh_state_ = STATE_SWAPPED_OUT; 199 rfh_state_ = STATE_SWAPPED_OUT;
199 } else { 200 } else {
200 rfh_state_ = STATE_DEFAULT; 201 rfh_state_ = STATE_DEFAULT;
201 GetSiteInstance()->increment_active_frame_count(); 202 GetSiteInstance()->increment_active_frame_count();
202 } 203 }
203 204
204 if (GetProcess()->GetServiceRegistry()) { 205 if (GetProcess()->GetServiceRegistry()) {
206 GetServiceRegistry()->AddService<GeolocationService>(
207 base::Bind(&GeolocationServiceContext::CreateService,
208 base::Unretained(delegate_->GetGeolocationServiceContext()),
Michael van Ouwerkerk 2014/10/09 13:11:23 How does this work when GetGeolocationServiceConte
blundell 2014/10/21 12:27:49 Done.
209 base::Bind(&RenderFrameHostImpl::DidUseGeolocationPermission,
210 base::Unretained(this))));
205 RenderFrameSetupPtr setup; 211 RenderFrameSetupPtr setup;
206 GetProcess()->GetServiceRegistry()->ConnectToRemoteService(&setup); 212 GetProcess()->GetServiceRegistry()->ConnectToRemoteService(&setup);
207 mojo::ServiceProviderPtr service_provider; 213 mojo::ServiceProviderPtr service_provider;
208 setup->GetServiceProviderForFrame(routing_id_, 214 setup->GetServiceProviderForFrame(routing_id_,
209 mojo::Get(&service_provider)); 215 mojo::Get(&service_provider));
210 service_registry_.BindRemoteServiceProvider( 216 service_registry_.BindRemoteServiceProvider(
211 service_provider.PassMessagePipe()); 217 service_provider.PassMessagePipe());
212 } 218 }
213 219
214 swapout_event_monitor_timeout_.reset(new TimeoutMonitor(base::Bind( 220 swapout_event_monitor_timeout_.reset(new TimeoutMonitor(base::Bind(
(...skipping 1325 matching lines...) Expand 10 before | Expand all | Expand 10 after
1540 void RenderFrameHostImpl::CancelSuspendedNavigations() { 1546 void RenderFrameHostImpl::CancelSuspendedNavigations() {
1541 // Clear any state if a pending navigation is canceled or preempted. 1547 // Clear any state if a pending navigation is canceled or preempted.
1542 if (suspended_nav_params_) 1548 if (suspended_nav_params_)
1543 suspended_nav_params_.reset(); 1549 suspended_nav_params_.reset();
1544 1550
1545 TRACE_EVENT_ASYNC_END0("navigation", 1551 TRACE_EVENT_ASYNC_END0("navigation",
1546 "RenderFrameHostImpl navigation suspended", this); 1552 "RenderFrameHostImpl navigation suspended", this);
1547 navigations_suspended_ = false; 1553 navigations_suspended_ = false;
1548 } 1554 }
1549 1555
1556 void RenderFrameHostImpl::DidUseGeolocationPermission() {
1557 RenderFrameHost* top_frame = this;
1558 while (top_frame->GetParent()) {
1559 top_frame = top_frame->GetParent();
1560 }
1561 GetContentClient()->browser()->DidUseGeolocationPermission(
1562 delegate_->GetAsWebContents(),
1563 GetLastCommittedURL().GetOrigin(),
1564 top_frame->GetLastCommittedURL().GetOrigin());
1565 }
1566
1550 } // namespace content 1567 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698