| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 "content/browser/geolocation/network_location_provider.h" | 5 #include "content/browser/geolocation/network_location_provider.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/time.h" | 8 #include "base/time.h" |
| 9 #include "base/utf_string_conversions.h" | 9 #include "base/utf_string_conversions.h" |
| 10 #include "content/browser/geolocation/access_token_store.h" | 10 #include "content/public/browser/access_token_store.h" |
| 11 |
| 12 using content::AccessTokenStore; |
| 11 | 13 |
| 12 namespace { | 14 namespace { |
| 13 // The maximum period of time we'll wait for a complete set of device data | 15 // The maximum period of time we'll wait for a complete set of device data |
| 14 // before sending the request. | 16 // before sending the request. |
| 15 const int kDataCompleteWaitPeriod = 1000 * 2; // 2 seconds | 17 const int kDataCompleteWaitPeriod = 1000 * 2; // 2 seconds |
| 16 } // namespace | 18 } // namespace |
| 17 | 19 |
| 18 // static | 20 // static |
| 19 const size_t NetworkLocationProvider::PositionCache::kMaximumSize = 10; | 21 const size_t NetworkLocationProvider::PositionCache::kMaximumSize = 10; |
| 20 | 22 |
| (...skipping 260 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 281 device_data_updated_timestamp_ = base::Time::Now(); | 283 device_data_updated_timestamp_ = base::Time::Now(); |
| 282 | 284 |
| 283 is_new_data_available_ = is_radio_data_complete_ || is_wifi_data_complete_; | 285 is_new_data_available_ = is_radio_data_complete_ || is_wifi_data_complete_; |
| 284 UpdatePosition(); | 286 UpdatePosition(); |
| 285 } | 287 } |
| 286 | 288 |
| 287 bool NetworkLocationProvider::IsStarted() const { | 289 bool NetworkLocationProvider::IsStarted() const { |
| 288 DCHECK_EQ(!!radio_data_provider_, !!wifi_data_provider_); | 290 DCHECK_EQ(!!radio_data_provider_, !!wifi_data_provider_); |
| 289 return wifi_data_provider_ != NULL; | 291 return wifi_data_provider_ != NULL; |
| 290 } | 292 } |
| OLD | NEW |