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

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

Issue 311193006: Renable WebViewTest.GeolocationAPIEmbedderHasAccessMultipleBridgeIdAllow with fixes. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 6 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
« no previous file with comments | « chrome/test/data/extensions/platform_apps/web_view/geolocation/geolocation_access_iframe.html ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 {
« no previous file with comments | « chrome/test/data/extensions/platform_apps/web_view/geolocation/geolocation_access_iframe.html ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698