| 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 CHROME_BROWSER_CHROMEOS_NETWORK_SETTINGS_ONC_TRANSLATOR_H_ | 5 #ifndef CHROMEOS_NETWORK_ONC_TRANSLATOR_H_ |
| 6 #define CHROME_BROWSER_CHROMEOS_NETWORK_SETTINGS_ONC_TRANSLATOR_H_ | 6 #define CHROMEOS_NETWORK_ONC_TRANSLATOR_H_ |
| 7 | 7 |
| 8 #include "base/memory/scoped_ptr.h" | 8 #include "base/memory/scoped_ptr.h" |
| 9 #include "chromeos/chromeos_export.h" |
| 9 | 10 |
| 10 namespace base { | 11 namespace base { |
| 11 class DictionaryValue; | 12 class DictionaryValue; |
| 12 } | 13 } |
| 13 | 14 |
| 14 namespace chromeos { | 15 namespace chromeos { |
| 15 namespace onc { | 16 namespace onc { |
| 16 | 17 |
| 17 struct OncValueSignature; | 18 struct OncValueSignature; |
| 18 | 19 |
| 19 // Translates a hierarchical ONC dictionary |onc_object| to a flat Shill | 20 // Translates a hierarchical ONC dictionary |onc_object| to a flat Shill |
| 20 // dictionary. The |signature| declares the type of |onc_object| and must point | 21 // dictionary. The |signature| declares the type of |onc_object| and must point |
| 21 // to one of the signature objects in "onc_signature.h". The resulting Shill | 22 // to one of the signature objects in "onc_signature.h". The resulting Shill |
| 22 // dictionary is returned. | 23 // dictionary is returned. |
| 23 // | 24 // |
| 24 // This function is used to translate network settings from ONC to Shill's | 25 // This function is used to translate network settings from ONC to Shill's |
| 25 // format before sending them to Shill. | 26 // format before sending them to Shill. |
| 27 CHROMEOS_EXPORT |
| 26 scoped_ptr<base::DictionaryValue> TranslateONCObjectToShill( | 28 scoped_ptr<base::DictionaryValue> TranslateONCObjectToShill( |
| 27 const OncValueSignature* signature, | 29 const OncValueSignature* signature, |
| 28 const base::DictionaryValue& onc_object); | 30 const base::DictionaryValue& onc_object); |
| 29 | 31 |
| 30 // Translates a |shill_dictionary| to an ONC object according to the given | 32 // Translates a |shill_dictionary| to an ONC object according to the given |
| 31 // |onc_signature|. |onc_signature| must point to a signature object in | 33 // |onc_signature|. |onc_signature| must point to a signature object in |
| 32 // "onc_signature.h". The resulting ONC object is returned. | 34 // "onc_signature.h". The resulting ONC object is returned. |
| 33 // | 35 // |
| 34 // This function is used to translate network settings coming from Shill to ONC | 36 // This function is used to translate network settings coming from Shill to ONC |
| 35 // before sending them to the UI. The result doesn't have to be valid ONC, but | 37 // before sending them to the UI. The result doesn't have to be valid ONC, but |
| 36 // only a subset of it and includes only the values that are actually required | 38 // only a subset of it and includes only the values that are actually required |
| 37 // by the UI. | 39 // by the UI. |
| 40 CHROMEOS_EXPORT |
| 38 scoped_ptr<base::DictionaryValue> TranslateShillServiceToONCPart( | 41 scoped_ptr<base::DictionaryValue> TranslateShillServiceToONCPart( |
| 39 const base::DictionaryValue& shill_dictionary, | 42 const base::DictionaryValue& shill_dictionary, |
| 40 const OncValueSignature* onc_signature); | 43 const OncValueSignature* onc_signature); |
| 41 | 44 |
| 42 } // namespace onc | 45 } // namespace onc |
| 43 } // namespace chromeos | 46 } // namespace chromeos |
| 44 | 47 |
| 45 #endif // CHROME_BROWSER_CHROMEOS_NETWORK_SETTINGS_ONC_TRANSLATOR_H_ | 48 #endif // CHROMEOS_NETWORK_ONC_TRANSLATOR_H_ |
| OLD | NEW |