| 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..89c44b34e54dd168635e0c9d76b48b1505776f57 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_impl.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(&GeolocationServiceImpl::Create,
|
| + delegate_->GetGeolocationContext(),
|
| + 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
|
|
|