Chromium Code Reviews| Index: content/browser/frame_host/render_frame_host_impl.cc |
| diff --git a/content/browser/frame_host/render_frame_host_impl.cc b/content/browser/frame_host/render_frame_host_impl.cc |
| index e7659989eb5da1bf07e0303378f5cc2383f38e77..87b18ea6f757c35960878d6d9dfd5f50fc15a5d2 100644 |
| --- a/content/browser/frame_host/render_frame_host_impl.cc |
| +++ b/content/browser/frame_host/render_frame_host_impl.cc |
| @@ -24,6 +24,7 @@ |
| #include "content/browser/frame_host/render_frame_host_delegate.h" |
| #include "content/browser/frame_host/render_frame_proxy_host.h" |
| #include "content/browser/frame_host/render_widget_host_view_child_frame.h" |
| +#include "content/browser/geolocation/geolocation_service_context.h" |
| #include "content/browser/renderer_host/input/input_router.h" |
| #include "content/browser/renderer_host/input/timeout_monitor.h" |
| #include "content/browser/renderer_host/render_process_host_impl.h" |
| @@ -202,6 +203,11 @@ RenderFrameHostImpl::RenderFrameHostImpl(RenderViewHostImpl* render_view_host, |
| } |
| if (GetProcess()->GetServiceRegistry()) { |
| + GetServiceRegistry()->AddService<GeolocationService>( |
| + base::Bind(&GeolocationServiceContext::CreateService, |
| + 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.
|
| + base::Bind(&RenderFrameHostImpl::DidUseGeolocationPermission, |
| + base::Unretained(this)))); |
| RenderFrameSetupPtr setup; |
| GetProcess()->GetServiceRegistry()->ConnectToRemoteService(&setup); |
| mojo::ServiceProviderPtr service_provider; |
| @@ -1547,4 +1553,15 @@ void RenderFrameHostImpl::CancelSuspendedNavigations() { |
| navigations_suspended_ = false; |
| } |
| +void RenderFrameHostImpl::DidUseGeolocationPermission() { |
| + RenderFrameHost* top_frame = this; |
| + while (top_frame->GetParent()) { |
| + top_frame = top_frame->GetParent(); |
| + } |
| + GetContentClient()->browser()->DidUseGeolocationPermission( |
| + delegate_->GetAsWebContents(), |
| + GetLastCommittedURL().GetOrigin(), |
| + top_frame->GetLastCommittedURL().GetOrigin()); |
| +} |
| + |
| } // namespace content |