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

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

Issue 11179003: Reapply geolocation network protocol changes. (Closed) Base URL: svn://svn.chromium.org/chrome/branches/1271/src/
Patch Set: Created 8 years, 2 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/location_arbitrator.cc
===================================================================
--- content/browser/geolocation/location_arbitrator.cc (revision 162123)
+++ content/browser/geolocation/location_arbitrator.cc (working copy)
@@ -17,7 +17,8 @@
namespace {
-const char* kDefaultNetworkProviderUrl = "https://maps.googleapis.com/maps/api/browserlocation/json";
+const char* kDefaultNetworkProviderUrl =
+ "https://www.googleapis.com/geolocation/v1/geolocate";
GeolocationArbitratorDependencyFactory* g_dependency_factory_for_test = NULL;
} // namespace
@@ -54,6 +55,10 @@
return arbitrator;
}
+GURL GeolocationArbitrator::DefaultNetworkProviderURL() {
+ return GURL(kDefaultNetworkProviderUrl);
+}
+
void GeolocationArbitrator::OnPermissionGranted() {
is_permission_granted_ = true;
for (ScopedVector<LocationProviderBase>::iterator i = providers_.begin();
@@ -67,7 +72,7 @@
// Stash options as OnAccessTokenStoresLoaded has not yet been called.
current_provider_options_ = options;
if (providers_.empty()) {
- DCHECK(GURL(kDefaultNetworkProviderUrl).is_valid());
+ DCHECK(DefaultNetworkProviderURL().is_valid());
access_token_store_->LoadAccessTokens(
base::Bind(&GeolocationArbitrator::OnAccessTokenStoresLoaded,
base::Unretained(this)));
@@ -97,7 +102,7 @@
}
// If there are no access tokens, boot strap it with the default server URL.
if (access_token_set.empty())
- access_token_set[GURL(kDefaultNetworkProviderUrl)];
+ access_token_set[DefaultNetworkProviderURL()];
for (AccessTokenStore::AccessTokenSet::iterator i =
access_token_set.begin();
i != access_token_set.end(); ++i) {
« no previous file with comments | « content/browser/geolocation/location_arbitrator.h ('k') | content/browser/geolocation/network_location_provider_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698