| 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 <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
| 11 #include "base/memory/scoped_ptr.h" | 11 #include "base/memory/scoped_ptr.h" |
| 12 #include "chromeos/chromeos_export.h" | 12 #include "chromeos/chromeos_export.h" |
| 13 #include "chromeos/network/onc/onc_constants.h" | 13 #include "chromeos/network/onc/onc_constants.h" |
| 14 #include "chromeos/network/onc/onc_signature.h" | |
| 15 | 14 |
| 16 namespace base { | 15 namespace base { |
| 17 class DictionaryValue; | 16 class DictionaryValue; |
| 18 } | 17 } |
| 19 | 18 |
| 20 namespace chromeos { | 19 namespace chromeos { |
| 21 namespace onc { | 20 namespace onc { |
| 22 | 21 |
| 22 class OncValueSignature; |
| 23 |
| 23 // A valid but empty (no networks and no certificates) and unencrypted | 24 // A valid but empty (no networks and no certificates) and unencrypted |
| 24 // configuration. | 25 // configuration. |
| 25 CHROMEOS_EXPORT extern const char kEmptyUnencryptedConfiguration[]; | 26 CHROMEOS_EXPORT extern const char kEmptyUnencryptedConfiguration[]; |
| 26 | 27 |
| 27 // Parses |json| according to the JSON format. If |json| is a JSON formatted | 28 // Parses |json| according to the JSON format. If |json| is a JSON formatted |
| 28 // dictionary, the function returns the dictionary as a DictionaryValue. | 29 // dictionary, the function returns the dictionary as a DictionaryValue. |
| 29 // Otherwise returns NULL. | 30 // Otherwise returns NULL. |
| 30 CHROMEOS_EXPORT scoped_ptr<base::DictionaryValue> ReadDictionaryFromJson( | 31 CHROMEOS_EXPORT scoped_ptr<base::DictionaryValue> ReadDictionaryFromJson( |
| 31 const std::string& json); | 32 const std::string& json); |
| 32 | 33 |
| (...skipping 28 matching lines...) Expand all Loading... |
| 61 // expanded. The replacement strings are obtained from |substitution|. | 62 // expanded. The replacement strings are obtained from |substitution|. |
| 62 CHROMEOS_EXPORT void ExpandStringsInOncObject( | 63 CHROMEOS_EXPORT void ExpandStringsInOncObject( |
| 63 const OncValueSignature& signature, | 64 const OncValueSignature& signature, |
| 64 const StringSubstitution& substitution, | 65 const StringSubstitution& substitution, |
| 65 base::DictionaryValue* onc_object); | 66 base::DictionaryValue* onc_object); |
| 66 | 67 |
| 67 // Creates a copy of |onc_object| with all values of sensitive fields replaced | 68 // Creates a copy of |onc_object| with all values of sensitive fields replaced |
| 68 // by |mask|. To find sensitive fields, signature and field name are checked | 69 // by |mask|. To find sensitive fields, signature and field name are checked |
| 69 // with the function FieldIsCredential(). | 70 // with the function FieldIsCredential(). |
| 70 CHROMEOS_EXPORT scoped_ptr<base::DictionaryValue> MaskCredentialsInOncObject( | 71 CHROMEOS_EXPORT scoped_ptr<base::DictionaryValue> MaskCredentialsInOncObject( |
| 71 const onc::OncValueSignature& signature, | 72 const OncValueSignature& signature, |
| 72 const base::DictionaryValue& onc_object, | 73 const base::DictionaryValue& onc_object, |
| 73 const std::string& mask); | 74 const std::string& mask); |
| 74 | 75 |
| 75 } // namespace onc | 76 } // namespace onc |
| 76 } // namespace chromeos | 77 } // namespace chromeos |
| 77 | 78 |
| 78 #endif // CHROMEOS_NETWORK_ONC_ONC_UTILS_H_ | 79 #endif // CHROMEOS_NETWORK_ONC_ONC_UTILS_H_ |
| OLD | NEW |