Chromium Code Reviews| Index: content/browser/geolocation/geolocation_dispatcher_host.cc |
| diff --git a/content/browser/geolocation/geolocation_dispatcher_host.cc b/content/browser/geolocation/geolocation_dispatcher_host.cc |
| index 75abab5a527f91a45d2a76a3a7ee64b39e79c7dd..3d885275c0f7244d213d02ceed70076596b74052 100644 |
| --- a/content/browser/geolocation/geolocation_dispatcher_host.cc |
| +++ b/content/browser/geolocation/geolocation_dispatcher_host.cc |
| @@ -78,10 +78,10 @@ GeolocationDispatcherHost::PendingPermission::PendingPermission( |
| GeolocationDispatcherHost::PendingPermission::~PendingPermission() { |
| } |
| -GeolocationDispatcherHost::GeolocationDispatcherHost( |
| - WebContents* web_contents) |
| +GeolocationDispatcherHost::GeolocationDispatcherHost(WebContents* web_contents) |
| : WebContentsObserver(web_contents), |
| paused_(false), |
| + geolocationPrecision_(-1), |
| weak_factory_(this) { |
| // This is initialized by WebContentsImpl. Do not add any non-trivial |
| // initialization here, defer to OnStartUpdating which is triggered whenever |
| @@ -140,7 +140,8 @@ void GeolocationDispatcherHost::OnLocationUpdate( |
| top_frame->GetLastCommittedURL().GetOrigin()); |
| i->first->Send(new GeolocationMsg_PositionUpdated( |
| - i->first->GetRoutingID(), geoposition)); |
| + i->first->GetRoutingID(), |
| + geoposition.ApplyPrecision(geolocationPrecision_))); |
|
meacer
2014/08/15 22:20:25
Since this is creating a new geoposition object, y
mhm
2014/08/15 23:18:57
Done.
|
| } |
| } |
| @@ -238,6 +239,7 @@ void GeolocationDispatcherHost::SendGeolocationPermissionResponse( |
| int render_process_id, |
| int render_frame_id, |
| int bridge_id, |
| + int choice, |
| bool allowed) { |
| for (size_t i = 0; i < pending_permissions_.size(); ++i) { |
| if (pending_permissions_[i].render_process_id == render_process_id && |
| @@ -251,6 +253,7 @@ void GeolocationDispatcherHost::SendGeolocationPermissionResponse( |
| } |
| if (allowed) { |
| + geolocationPrecision_ = choice; |
|
meacer
2014/08/15 22:20:25
Ah, I think I see why you don't use precision inst
mhm
2014/08/15 23:18:57
Done.
|
| GeolocationProviderImpl::GetInstance()-> |
| UserDidOptIntoLocationServices(); |
| } |