| 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 // The implementation of TranslateONCObjectToShill is structured in two parts: | 5 // The implementation of TranslateONCObjectToShill is structured in two parts: |
| 6 // - The recursion through the existing ONC hierarchy | 6 // - The recursion through the existing ONC hierarchy |
| 7 // see TranslateONCHierarchy | 7 // see TranslateONCHierarchy |
| 8 // - The local translation of an object depending on the associated signature | 8 // - The local translation of an object depending on the associated signature |
| 9 // see LocalTranslator::TranslateFields | 9 // see LocalTranslator::TranslateFields |
| 10 | 10 |
| 11 #include "chrome/browser/chromeos/network_settings/onc_translator.h" | 11 #include "chromeos/network/onc/onc_translator.h" |
| 12 | 12 |
| 13 #include <string> | 13 #include <string> |
| 14 | 14 |
| 15 #include "base/json/json_reader.h" | 15 #include "base/json/json_reader.h" |
| 16 #include "base/json/json_writer.h" | 16 #include "base/json/json_writer.h" |
| 17 #include "base/logging.h" | 17 #include "base/logging.h" |
| 18 #include "base/values.h" | 18 #include "base/values.h" |
| 19 #include "chrome/browser/chromeos/cros/onc_constants.h" | 19 #include "chromeos/network/onc/onc_constants.h" |
| 20 #include "chrome/browser/chromeos/network_settings/onc_signature.h" | 20 #include "chromeos/network/onc/onc_signature.h" |
| 21 #include "chrome/browser/chromeos/network_settings/onc_translation_tables.h" | 21 #include "chromeos/network/onc/onc_translation_tables.h" |
| 22 #include "third_party/cros_system_api/dbus/service_constants.h" | 22 #include "third_party/cros_system_api/dbus/service_constants.h" |
| 23 | 23 |
| 24 namespace chromeos { | 24 namespace chromeos { |
| 25 namespace onc { | 25 namespace onc { |
| 26 | 26 |
| 27 namespace { | 27 namespace { |
| 28 | 28 |
| 29 scoped_ptr<base::StringValue> ConvertValueToString(const base::Value& value) { | 29 scoped_ptr<base::StringValue> ConvertValueToString(const base::Value& value) { |
| 30 std::string str; | 30 std::string str; |
| 31 if (!value.GetAsString(&str)) | 31 if (!value.GetAsString(&str)) |
| (...skipping 169 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 201 const OncValueSignature* onc_signature, | 201 const OncValueSignature* onc_signature, |
| 202 const base::DictionaryValue& onc_object) { | 202 const base::DictionaryValue& onc_object) { |
| 203 CHECK(onc_signature != NULL); | 203 CHECK(onc_signature != NULL); |
| 204 scoped_ptr<base::DictionaryValue> shill_dictionary(new base::DictionaryValue); | 204 scoped_ptr<base::DictionaryValue> shill_dictionary(new base::DictionaryValue); |
| 205 TranslateONCHierarchy(*onc_signature, onc_object, shill_dictionary.get()); | 205 TranslateONCHierarchy(*onc_signature, onc_object, shill_dictionary.get()); |
| 206 return shill_dictionary.Pass(); | 206 return shill_dictionary.Pass(); |
| 207 } | 207 } |
| 208 | 208 |
| 209 } // namespace onc | 209 } // namespace onc |
| 210 } // namespace chromeos | 210 } // namespace chromeos |
| OLD | NEW |