OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 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/shill_property_util.h" | 5 #include "chromeos/network/shill_property_util.h" |
6 | 6 |
7 #include "base/i18n/icu_encoding_detection.h" | 7 #include "base/i18n/icu_encoding_detection.h" |
8 #include "base/i18n/icu_string_conversions.h" | 8 #include "base/i18n/icu_string_conversions.h" |
9 #include "base/json/json_writer.h" | 9 #include "base/json/json_writer.h" |
10 #include "base/strings/string_number_conversions.h" | 10 #include "base/strings/string_number_conversions.h" |
(...skipping 233 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
244 // properties. | 244 // properties. |
245 } else { | 245 } else { |
246 NOTREACHED() << "Unsupported network type " << type; | 246 NOTREACHED() << "Unsupported network type " << type; |
247 success = false; | 247 success = false; |
248 } | 248 } |
249 if (!success) | 249 if (!success) |
250 NET_LOG_ERROR("CopyIdentifyingProperties", "Missing required properties"); | 250 NET_LOG_ERROR("CopyIdentifyingProperties", "Missing required properties"); |
251 return success; | 251 return success; |
252 } | 252 } |
253 | 253 |
| 254 bool DoIdentifyingPropertiesMatch(const base::DictionaryValue& properties_a, |
| 255 const base::DictionaryValue& properties_b) { |
| 256 base::DictionaryValue identifying_a; |
| 257 if (!CopyIdentifyingProperties(properties_a, &identifying_a)) |
| 258 return false; |
| 259 base::DictionaryValue identifying_b; |
| 260 if (!CopyIdentifyingProperties(properties_b, &identifying_b)) |
| 261 return false; |
| 262 |
| 263 return identifying_a.Equals(&identifying_b); |
| 264 } |
| 265 |
254 } // namespace shill_property_util | 266 } // namespace shill_property_util |
255 | 267 |
256 namespace { | 268 namespace { |
257 | 269 |
258 const char kPatternDefault[] = "PatternDefault"; | 270 const char kPatternDefault[] = "PatternDefault"; |
259 const char kPatternEthernet[] = "PatternEthernet"; | 271 const char kPatternEthernet[] = "PatternEthernet"; |
260 const char kPatternWireless[] = "PatternWireless"; | 272 const char kPatternWireless[] = "PatternWireless"; |
261 const char kPatternMobile[] = "PatternMobile"; | 273 const char kPatternMobile[] = "PatternMobile"; |
262 const char kPatternNonVirtual[] = "PatternNonVirtual"; | 274 const char kPatternNonVirtual[] = "PatternNonVirtual"; |
263 | 275 |
(...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
382 if (!str.empty()) | 394 if (!str.empty()) |
383 str += "|"; | 395 str += "|"; |
384 str += shill_type_to_flag[i].shill_network_type; | 396 str += shill_type_to_flag[i].shill_network_type; |
385 } | 397 } |
386 return str; | 398 return str; |
387 } | 399 } |
388 | 400 |
389 NetworkTypePattern::NetworkTypePattern(int pattern) : pattern_(pattern) {} | 401 NetworkTypePattern::NetworkTypePattern(int pattern) : pattern_(pattern) {} |
390 | 402 |
391 } // namespace chromeos | 403 } // namespace chromeos |
OLD | NEW |