| 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 #ifndef CHROMEOS_NETWORK_ONC_ONC_UTILS_H_ | 5 #ifndef CHROMEOS_NETWORK_ONC_ONC_UTILS_H_ |
| 6 #define CHROMEOS_NETWORK_ONC_ONC_UTILS_H_ | 6 #define CHROMEOS_NETWORK_ONC_ONC_UTILS_H_ |
| 7 | 7 |
| 8 #include <map> | 8 #include <map> |
| 9 #include <string> | 9 #include <string> |
| 10 #include <vector> | 10 #include <vector> |
| (...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 76 const OncValueSignature& signature, | 76 const OncValueSignature& signature, |
| 77 const StringSubstitution& substitution, | 77 const StringSubstitution& substitution, |
| 78 base::DictionaryValue* onc_object); | 78 base::DictionaryValue* onc_object); |
| 79 | 79 |
| 80 // Replaces expandable fields in the networks of |network_configs|, which must | 80 // Replaces expandable fields in the networks of |network_configs|, which must |
| 81 // be a list of ONC NetworkConfigurations. See ExpandStringsInOncObject above. | 81 // be a list of ONC NetworkConfigurations. See ExpandStringsInOncObject above. |
| 82 CHROMEOS_EXPORT void ExpandStringsInNetworks( | 82 CHROMEOS_EXPORT void ExpandStringsInNetworks( |
| 83 const StringSubstitution& substitution, | 83 const StringSubstitution& substitution, |
| 84 base::ListValue* network_configs); | 84 base::ListValue* network_configs); |
| 85 | 85 |
| 86 // Fills in all missing HexSSID fields that are mentioned in the ONC |
| 87 // specification. The object of |onc_object| is modified in place. |
| 88 CHROMEOS_EXPORT void FillInHexSSIDFieldsInOncObject( |
| 89 const OncValueSignature& signature, |
| 90 base::DictionaryValue* onc_object); |
| 91 |
| 92 // If the SSID field is set, but HexSSID is not, converts the contents of the |
| 93 // SSID field to UTF-8 encoding, creates the hex representation and assigns the |
| 94 // result to HexSSID. |
| 95 CHROMEOS_EXPORT void FillInHexSSIDField(base::DictionaryValue* wifi_fields); |
| 96 |
| 86 // Creates a copy of |onc_object| with all values of sensitive fields replaced | 97 // Creates a copy of |onc_object| with all values of sensitive fields replaced |
| 87 // by |mask|. To find sensitive fields, signature and field name are checked | 98 // by |mask|. To find sensitive fields, signature and field name are checked |
| 88 // with the function FieldIsCredential(). | 99 // with the function FieldIsCredential(). |
| 89 CHROMEOS_EXPORT scoped_ptr<base::DictionaryValue> MaskCredentialsInOncObject( | 100 CHROMEOS_EXPORT scoped_ptr<base::DictionaryValue> MaskCredentialsInOncObject( |
| 90 const OncValueSignature& signature, | 101 const OncValueSignature& signature, |
| 91 const base::DictionaryValue& onc_object, | 102 const base::DictionaryValue& onc_object, |
| 92 const std::string& mask); | 103 const std::string& mask); |
| 93 | 104 |
| 94 // Decrypts |onc_blob| with |passphrase| if necessary. Clears |network_configs|, | 105 // Decrypts |onc_blob| with |passphrase| if necessary. Clears |network_configs|, |
| 95 // |global_network_config| and |certificates| and fills them with the validated | 106 // |global_network_config| and |certificates| and fills them with the validated |
| (...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 131 const std::string& type); | 142 const std::string& type); |
| 132 | 143 |
| 133 // Returns true if |property_key| is a recommended value in the ONC dictionary. | 144 // Returns true if |property_key| is a recommended value in the ONC dictionary. |
| 134 CHROMEOS_EXPORT bool IsRecommendedValue(const base::DictionaryValue* onc, | 145 CHROMEOS_EXPORT bool IsRecommendedValue(const base::DictionaryValue* onc, |
| 135 const std::string& property_key); | 146 const std::string& property_key); |
| 136 | 147 |
| 137 } // namespace onc | 148 } // namespace onc |
| 138 } // namespace chromeos | 149 } // namespace chromeos |
| 139 | 150 |
| 140 #endif // CHROMEOS_NETWORK_ONC_ONC_UTILS_H_ | 151 #endif // CHROMEOS_NETWORK_ONC_ONC_UTILS_H_ |
| OLD | NEW |