| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "chrome/browser/geolocation/network_location_provider.h" | 5 #include "chrome/browser/geolocation/network_location_provider.h" |
| 6 | 6 |
| 7 #include "base/time.h" | 7 #include "base/time.h" |
| 8 #include "base/utf_string_conversions.h" |
| 8 #include "chrome/browser/geolocation/access_token_store.h" | 9 #include "chrome/browser/geolocation/access_token_store.h" |
| 9 | 10 |
| 10 namespace { | 11 namespace { |
| 11 // The maximum period of time we'll wait for a complete set of device data | 12 // The maximum period of time we'll wait for a complete set of device data |
| 12 // before sending the request. | 13 // before sending the request. |
| 13 const int kDataCompleteWaitPeriod = 1000 * 2; // 2 seconds | 14 const int kDataCompleteWaitPeriod = 1000 * 2; // 2 seconds |
| 14 | 15 |
| 15 // The maximum size of the cache of positions for previously requested device | 16 // The maximum size of the cache of positions for previously requested device |
| 16 // data. | 17 // data. |
| 17 const size_t kMaximumCacheSize = 10; | 18 const size_t kMaximumCacheSize = 10; |
| (...skipping 268 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 286 device_data_updated_timestamp_ = base::Time::Now(); | 287 device_data_updated_timestamp_ = base::Time::Now(); |
| 287 | 288 |
| 288 is_new_data_available_ = is_radio_data_complete_ || is_wifi_data_complete_; | 289 is_new_data_available_ = is_radio_data_complete_ || is_wifi_data_complete_; |
| 289 UpdatePosition(); | 290 UpdatePosition(); |
| 290 } | 291 } |
| 291 | 292 |
| 292 bool NetworkLocationProvider::IsStarted() const { | 293 bool NetworkLocationProvider::IsStarted() const { |
| 293 DCHECK_EQ(!!radio_data_provider_, !!wifi_data_provider_); | 294 DCHECK_EQ(!!radio_data_provider_, !!wifi_data_provider_); |
| 294 return wifi_data_provider_ != NULL; | 295 return wifi_data_provider_ != NULL; |
| 295 } | 296 } |
| OLD | NEW |