Index: content/browser/geolocation/geolocation_provider_impl.cc |
diff --git a/content/browser/geolocation/geolocation_provider_impl.cc b/content/browser/geolocation/geolocation_provider_impl.cc |
index 901cadea02efa8ea1258ff91053129c57dc21e5e..626a52afa4fb7353a4ec70ca14f9e983cfb86700 100644 |
--- a/content/browser/geolocation/geolocation_provider_impl.cc |
+++ b/content/browser/geolocation/geolocation_provider_impl.cc |
@@ -51,7 +51,6 @@ void GeolocationProviderImpl::UserDidOptIntoLocationServices() { |
void GeolocationProviderImpl::OverrideLocationForTesting( |
const Geoposition& position) { |
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
- position_ = position; |
ignore_location_updates_ = true; |
NotifyClients(position); |
} |
@@ -100,9 +99,11 @@ void GeolocationProviderImpl::OnClientsChanged() { |
base::Closure task; |
if (high_accuracy_callbacks_.empty() && low_accuracy_callbacks_.empty()) { |
DCHECK(IsRunning()); |
- // We have no more observers, so we clear the cached geoposition so that |
- // when the next observer is added we will not provide a stale position. |
- position_ = Geoposition(); |
+ if (!ignore_location_updates_) { |
+ // We have no more observers, so we clear the cached geoposition so that |
+ // when the next observer is added we will not provide a stale position. |
+ position_ = Geoposition(); |
+ } |
task = base::Bind(&GeolocationProviderImpl::StopProviders, |
base::Unretained(this)); |
} else { |