| 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 | 8 |
| 9 namespace { | 9 namespace { |
| 10 // The maximum period of time we'll wait for a complete set of device data | 10 // The maximum period of time we'll wait for a complete set of device data |
| (...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 73 string16* key) { | 73 string16* key) { |
| 74 // Currently we use only the WiFi data, and base the key only on the MAC | 74 // Currently we use only the WiFi data, and base the key only on the MAC |
| 75 // addresses. | 75 // addresses. |
| 76 // TODO(steveblock): Make use of radio_data. | 76 // TODO(steveblock): Make use of radio_data. |
| 77 DCHECK(key); | 77 DCHECK(key); |
| 78 key->clear(); | 78 key->clear(); |
| 79 key->reserve(wifi_data.access_point_data.size() * 19); | 79 key->reserve(wifi_data.access_point_data.size() * 19); |
| 80 const string16 separator(ASCIIToUTF16("|")); | 80 const string16 separator(ASCIIToUTF16("|")); |
| 81 for (WifiData::AccessPointDataSet::const_iterator iter = | 81 for (WifiData::AccessPointDataSet::const_iterator iter = |
| 82 wifi_data.access_point_data.begin(); | 82 wifi_data.access_point_data.begin(); |
| 83 iter != wifi_data.access_point_data.begin(); | 83 iter != wifi_data.access_point_data.end(); |
| 84 iter++) { | 84 iter++) { |
| 85 *key += separator; | 85 *key += separator; |
| 86 *key += iter->mac_address; | 86 *key += iter->mac_address; |
| 87 *key += separator; | 87 *key += separator; |
| 88 } | 88 } |
| 89 // If the key is the empty string, return false, as we don't want to cache a | 89 // If the key is the empty string, return false, as we don't want to cache a |
| 90 // position for such a set of device data. | 90 // position for such a set of device data. |
| 91 return !key->empty(); | 91 return !key->empty(); |
| 92 } | 92 } |
| 93 | 93 |
| (...skipping 190 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 284 return; | 284 return; |
| 285 } | 285 } |
| 286 device_data_updated_timestamp_ = GetCurrentTimeMillis(); | 286 device_data_updated_timestamp_ = GetCurrentTimeMillis(); |
| 287 | 287 |
| 288 is_new_data_available_ = is_radio_data_complete_ || is_radio_data_complete_; | 288 is_new_data_available_ = is_radio_data_complete_ || is_radio_data_complete_; |
| 289 if (delayed_start_task_.empty() || | 289 if (delayed_start_task_.empty() || |
| 290 (is_radio_data_complete_ && is_radio_data_complete_)) { | 290 (is_radio_data_complete_ && is_radio_data_complete_)) { |
| 291 UpdatePosition(); | 291 UpdatePosition(); |
| 292 } | 292 } |
| 293 } | 293 } |
| OLD | NEW |