| 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/onc/onc_utils.h" | 5 #include "chromeos/network/onc/onc_utils.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 #include <stdint.h> | 8 #include <stdint.h> |
| 9 | 9 |
| 10 #include "base/base64.h" | 10 #include "base/base64.h" |
| (...skipping 743 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 754 network_config); | 754 network_config); |
| 755 } | 755 } |
| 756 | 756 |
| 757 NetworkTypePattern NetworkTypePatternFromOncType(const std::string& type) { | 757 NetworkTypePattern NetworkTypePatternFromOncType(const std::string& type) { |
| 758 if (type == ::onc::network_type::kAllTypes) | 758 if (type == ::onc::network_type::kAllTypes) |
| 759 return NetworkTypePattern::Default(); | 759 return NetworkTypePattern::Default(); |
| 760 if (type == ::onc::network_type::kCellular) | 760 if (type == ::onc::network_type::kCellular) |
| 761 return NetworkTypePattern::Cellular(); | 761 return NetworkTypePattern::Cellular(); |
| 762 if (type == ::onc::network_type::kEthernet) | 762 if (type == ::onc::network_type::kEthernet) |
| 763 return NetworkTypePattern::Ethernet(); | 763 return NetworkTypePattern::Ethernet(); |
| 764 if (type == ::onc::network_type::kTether) |
| 765 return NetworkTypePattern::Tether(); |
| 764 if (type == ::onc::network_type::kVPN) | 766 if (type == ::onc::network_type::kVPN) |
| 765 return NetworkTypePattern::VPN(); | 767 return NetworkTypePattern::VPN(); |
| 766 if (type == ::onc::network_type::kWiFi) | 768 if (type == ::onc::network_type::kWiFi) |
| 767 return NetworkTypePattern::WiFi(); | 769 return NetworkTypePattern::WiFi(); |
| 768 if (type == ::onc::network_type::kWimax) | 770 if (type == ::onc::network_type::kWimax) |
| 769 return NetworkTypePattern::Wimax(); | 771 return NetworkTypePattern::Wimax(); |
| 770 if (type == ::onc::network_type::kWireless) | 772 if (type == ::onc::network_type::kWireless) |
| 771 return NetworkTypePattern::Wireless(); | 773 return NetworkTypePattern::Wireless(); |
| 772 NOTREACHED() << "Unrecognized ONC type: " << type; | 774 NOTREACHED() << "Unrecognized ONC type: " << type; |
| 773 return NetworkTypePattern::Default(); | 775 return NetworkTypePattern::Default(); |
| (...skipping 545 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1319 const PrefService* local_state_prefs, | 1321 const PrefService* local_state_prefs, |
| 1320 const NetworkState& network) { | 1322 const NetworkState& network) { |
| 1321 ::onc::ONCSource ignored_onc_source; | 1323 ::onc::ONCSource ignored_onc_source; |
| 1322 const base::DictionaryValue* policy = onc::GetPolicyForNetwork( | 1324 const base::DictionaryValue* policy = onc::GetPolicyForNetwork( |
| 1323 profile_prefs, local_state_prefs, network, &ignored_onc_source); | 1325 profile_prefs, local_state_prefs, network, &ignored_onc_source); |
| 1324 return policy != NULL; | 1326 return policy != NULL; |
| 1325 } | 1327 } |
| 1326 | 1328 |
| 1327 } // namespace onc | 1329 } // namespace onc |
| 1328 } // namespace chromeos | 1330 } // namespace chromeos |
| OLD | NEW |