diff options
Diffstat (limited to 'chromium/device/geolocation/network_location_provider.cc')
-rw-r--r-- | chromium/device/geolocation/network_location_provider.cc | 8 |
1 files changed, 8 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_ = |