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

Unified Diff: content/browser/geolocation/geolocation_dispatcher_host.cc

Issue 454253002: Location chooser (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Addressing meacer@ comments Created 6 years, 4 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 side-by-side diff with in-line comments
Download patch
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..66ad502a0baca5652c1edd3cf6a74dda491607b8 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(geoposition, geolocationPrecision_)));
}
}
@@ -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;
GeolocationProviderImpl::GetInstance()->
UserDidOptIntoLocationServices();
}

Powered by Google App Engine
This is Rietveld 408576698