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 137 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
148 return; // No enabled devices, don't update received time. | 148 return; // No enabled devices, don't update received time. |
149 | 149 |
150 // Dictionary<device_type, entry_list> | 150 // Dictionary<device_type, entry_list> |
151 // Example dict returned from shill: | 151 // Example dict returned from shill: |
152 // { | 152 // { |
153 // kGeoWifiAccessPointsProperty: [ {kGeoMacAddressProperty: mac_value, ...}, | 153 // kGeoWifiAccessPointsProperty: [ {kGeoMacAddressProperty: mac_value, ...}, |
154 // ... | 154 // ... |
155 // ], | 155 // ], |
156 // kGeoCellTowersProperty: [ {kGeoCellIdProperty: cell_id_value, ...}, ... ] | 156 // kGeoCellTowersProperty: [ {kGeoCellIdProperty: cell_id_value, ...}, ... ] |
157 // } | 157 // } |
158 for (auto device_type : kDevicePropertyNames) { | 158 for (auto* device_type : kDevicePropertyNames) { |
159 if (!properties.HasKey(device_type)) { | 159 if (!properties.HasKey(device_type)) { |
160 continue; | 160 continue; |
161 } | 161 } |
162 | 162 |
163 const base::ListValue* entry_list = nullptr; | 163 const base::ListValue* entry_list = nullptr; |
164 if (!properties.GetList(device_type, &entry_list)) { | 164 if (!properties.GetList(device_type, &entry_list)) { |
165 LOG(WARNING) << "Geolocation dictionary value not a List: " | 165 LOG(WARNING) << "Geolocation dictionary value not a List: " |
166 << device_type; | 166 << device_type; |
167 continue; | 167 continue; |
168 } | 168 } |
(...skipping 61 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 |