| 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 "content/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 "base/utf_string_conversions.h" |
| 9 #include "chrome/browser/geolocation/access_token_store.h" | 9 #include "content/browser/geolocation/access_token_store.h" |
| 10 | 10 |
| 11 namespace { | 11 namespace { |
| 12 // 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 |
| 13 // before sending the request. | 13 // before sending the request. |
| 14 const int kDataCompleteWaitPeriod = 1000 * 2; // 2 seconds | 14 const int kDataCompleteWaitPeriod = 1000 * 2; // 2 seconds |
| 15 } // namespace | 15 } // namespace |
| 16 | 16 |
| 17 // static | 17 // static |
| 18 const size_t NetworkLocationProvider::PositionCache::kMaximumSize = 10; | 18 const size_t NetworkLocationProvider::PositionCache::kMaximumSize = 10; |
| 19 | 19 |
| (...skipping 290 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 310 is_new_data_available_ = is_gateway_data_complete_ || | 310 is_new_data_available_ = is_gateway_data_complete_ || |
| 311 is_radio_data_complete_ || is_wifi_data_complete_; | 311 is_radio_data_complete_ || is_wifi_data_complete_; |
| 312 UpdatePosition(); | 312 UpdatePosition(); |
| 313 } | 313 } |
| 314 | 314 |
| 315 bool NetworkLocationProvider::IsStarted() const { | 315 bool NetworkLocationProvider::IsStarted() const { |
| 316 DCHECK_EQ(!!gateway_data_provider_, !!wifi_data_provider_); | 316 DCHECK_EQ(!!gateway_data_provider_, !!wifi_data_provider_); |
| 317 DCHECK_EQ(!!radio_data_provider_, !!wifi_data_provider_); | 317 DCHECK_EQ(!!radio_data_provider_, !!wifi_data_provider_); |
| 318 return wifi_data_provider_ != NULL; | 318 return wifi_data_provider_ != NULL; |
| 319 } | 319 } |
| OLD | NEW |