OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/network_util.h" | 5 #include "chromeos/network/network_util.h" |
6 | 6 |
7 #include <stddef.h> | 7 #include <stddef.h> |
8 #include <stdint.h> | 8 #include <stdint.h> |
9 | 9 |
10 #include <utility> | 10 #include <utility> |
(...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
130 } | 130 } |
131 return result; | 131 return result; |
132 } | 132 } |
133 | 133 |
134 bool ParseCellularScanResults(const base::ListValue& list, | 134 bool ParseCellularScanResults(const base::ListValue& list, |
135 std::vector<CellularScanResult>* scan_results) { | 135 std::vector<CellularScanResult>* scan_results) { |
136 scan_results->clear(); | 136 scan_results->clear(); |
137 scan_results->reserve(list.GetSize()); | 137 scan_results->reserve(list.GetSize()); |
138 for (const auto& value : list) { | 138 for (const auto& value : list) { |
139 const base::DictionaryValue* dict; | 139 const base::DictionaryValue* dict; |
140 if (!value->GetAsDictionary(&dict)) | 140 if (!value.GetAsDictionary(&dict)) |
141 return false; | 141 return false; |
142 CellularScanResult scan_result; | 142 CellularScanResult scan_result; |
143 // If the network id property is not present then this network cannot be | 143 // If the network id property is not present then this network cannot be |
144 // connected to so don't include it in the results. | 144 // connected to so don't include it in the results. |
145 if (!dict->GetStringWithoutPathExpansion(shill::kNetworkIdProperty, | 145 if (!dict->GetStringWithoutPathExpansion(shill::kNetworkIdProperty, |
146 &scan_result.network_id)) | 146 &scan_result.network_id)) |
147 continue; | 147 continue; |
148 dict->GetStringWithoutPathExpansion(shill::kStatusProperty, | 148 dict->GetStringWithoutPathExpansion(shill::kStatusProperty, |
149 &scan_result.status); | 149 &scan_result.status); |
150 dict->GetStringWithoutPathExpansion(shill::kLongNameProperty, | 150 dict->GetStringWithoutPathExpansion(shill::kLongNameProperty, |
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
228 std::string TranslateShillTypeToONC(const std::string& shill_type) { | 228 std::string TranslateShillTypeToONC(const std::string& shill_type) { |
229 if (shill_type == shill::kTypeEthernet) | 229 if (shill_type == shill::kTypeEthernet) |
230 return ::onc::network_type::kEthernet; | 230 return ::onc::network_type::kEthernet; |
231 std::string onc_type; | 231 std::string onc_type; |
232 onc::TranslateStringToONC(onc::kNetworkTypeTable, shill_type, &onc_type); | 232 onc::TranslateStringToONC(onc::kNetworkTypeTable, shill_type, &onc_type); |
233 return onc_type; | 233 return onc_type; |
234 } | 234 } |
235 | 235 |
236 } // namespace network_util | 236 } // namespace network_util |
237 } // namespace chromeos | 237 } // namespace chromeos |
OLD | NEW |