| OLD | NEW |
| 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 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 "chromeos/network/geolocation_handler.h" | 5 #include "chromeos/network/geolocation_handler.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 #include <stdint.h> | 8 #include <stdint.h> |
| 9 | 9 |
| 10 #include "base/bind.h" | 10 #include "base/bind.h" |
| (...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 105 const base::ListValue* technologies = nullptr; | 105 const base::ListValue* technologies = nullptr; |
| 106 if (!value.GetAsList(&technologies) || !technologies) | 106 if (!value.GetAsList(&technologies) || !technologies) |
| 107 return; | 107 return; |
| 108 bool wifi_was_enabled = wifi_enabled_; | 108 bool wifi_was_enabled = wifi_enabled_; |
| 109 bool cellular_was_enabled = cellular_enabled_; | 109 bool cellular_was_enabled = cellular_enabled_; |
| 110 cellular_enabled_ = false; | 110 cellular_enabled_ = false; |
| 111 wifi_enabled_ = false; | 111 wifi_enabled_ = false; |
| 112 for (base::ListValue::const_iterator iter = technologies->begin(); | 112 for (base::ListValue::const_iterator iter = technologies->begin(); |
| 113 iter != technologies->end(); ++iter) { | 113 iter != technologies->end(); ++iter) { |
| 114 std::string technology; | 114 std::string technology; |
| 115 iter->GetAsString(&technology); | 115 (*iter)->GetAsString(&technology); |
| 116 if (technology == shill::kTypeWifi) { | 116 if (technology == shill::kTypeWifi) { |
| 117 wifi_enabled_ = true; | 117 wifi_enabled_ = true; |
| 118 } else if (technology == shill::kTypeCellular) { | 118 } else if (technology == shill::kTypeCellular) { |
| 119 cellular_enabled_ = true; | 119 cellular_enabled_ = true; |
| 120 } | 120 } |
| 121 if (wifi_enabled_ && cellular_enabled_) | 121 if (wifi_enabled_ && cellular_enabled_) |
| 122 break; | 122 break; |
| 123 } | 123 } |
| 124 | 124 |
| 125 // Request initial location data. | 125 // Request initial location data. |
| (...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 230 } | 230 } |
| 231 entry->GetString(shill::kGeoCellIdProperty, &ct.ci); | 231 entry->GetString(shill::kGeoCellIdProperty, &ct.ci); |
| 232 entry->GetString(shill::kGeoLocationAreaCodeProperty, &ct.lac); | 232 entry->GetString(shill::kGeoLocationAreaCodeProperty, &ct.lac); |
| 233 entry->GetString(shill::kGeoMobileCountryCodeProperty, &ct.mcc); | 233 entry->GetString(shill::kGeoMobileCountryCodeProperty, &ct.mcc); |
| 234 entry->GetString(shill::kGeoMobileNetworkCodeProperty, &ct.mnc); | 234 entry->GetString(shill::kGeoMobileNetworkCodeProperty, &ct.mnc); |
| 235 | 235 |
| 236 cell_towers_.push_back(ct); | 236 cell_towers_.push_back(ct); |
| 237 } | 237 } |
| 238 | 238 |
| 239 } // namespace chromeos | 239 } // namespace chromeos |
| OLD | NEW |