diff options
author | Pierre Rossi <pierre.rossi@digia.com> | 2013-05-13 16:25:46 +0200 |
---|---|---|
committer | Allan Sandfeld Jensen <allan.jensen@qt.io> | 2018-01-22 15:17:10 +0000 |
commit | 966cecdda579ccb32ad28c135e0157e627bd5aa8 (patch) | |
tree | 1ebf917b7d8d86c832795dd9ceb79103e2bfe09d | |
parent | 12bbceb234bd2e8a559ad968a5c43b82145d7710 (diff) | |
download | qtwebengine-chromium-966cecdda579ccb32ad28c135e0157e627bd5aa8.tar.gz |
Disable location requests to the geolocation google API
If we don't have a valid token, it will fail anyway.
And for now we don't provide a way to use an existing API token.
Change-Id: I7208d5ebc9ba7350622686e208761950f26bdc63
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
-rw-r--r-- | chromium/device/geolocation/network_location_provider.cc | 8 | ||||
-rw-r--r-- | chromium/device/geolocation/network_location_request.h | 1 |
2 files changed, 9 insertions, 0 deletions
diff --git a/chromium/device/geolocation/network_location_provider.cc b/chromium/device/geolocation/network_location_provider.cc index 9f33ee3f741..7d098b34947 100644 --- a/chromium/device/geolocation/network_location_provider.cc +++ b/chromium/device/geolocation/network_location_provider.cc @@ -163,6 +163,14 @@ bool NetworkLocationProvider::StartProvider(bool high_accuracy) { if (IsStarted()) return true; + // No point in sending requests without an API key. + if (request_->api_key().empty()) { + Geoposition pos; + pos.error_code = Geoposition::ERROR_CODE_POSITION_UNAVAILABLE; + location_provider_update_callback_.Run(this, pos); + return false; + } + // Registers a callback with the data provider. The first call to Register() // will create a singleton data provider that will be deleted on Unregister(). wifi_data_provider_manager_ = diff --git a/chromium/device/geolocation/network_location_request.h b/chromium/device/geolocation/network_location_request.h index be16c77dc4e..b142c9be34f 100644 --- a/chromium/device/geolocation/network_location_request.h +++ b/chromium/device/geolocation/network_location_request.h @@ -49,6 +49,7 @@ class NetworkLocationRequest : private net::URLFetcherDelegate { bool MakeRequest(const WifiData& wifi_data, const base::Time& wifi_timestamp); bool is_request_pending() const { return url_fetcher_ != NULL; } + const std::string api_key() const { return api_key_; } private: // net::URLFetcherDelegate |