| 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 |
| (...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 107 &certKUs) && | 107 &certKUs) && |
| 108 certKUs->GetString(0, &certKU)) { | 108 certKUs->GetString(0, &certKU)) { |
| 109 shill_dictionary_->SetStringWithoutPathExpansion( | 109 shill_dictionary_->SetStringWithoutPathExpansion( |
| 110 flimflam::kOpenVPNRemoteCertKUProperty, certKU); | 110 flimflam::kOpenVPNRemoteCertKUProperty, certKU); |
| 111 } | 111 } |
| 112 | 112 |
| 113 for (base::DictionaryValue::Iterator it(*onc_object_); !it.IsAtEnd(); | 113 for (base::DictionaryValue::Iterator it(*onc_object_); !it.IsAtEnd(); |
| 114 it.Advance()) { | 114 it.Advance()) { |
| 115 scoped_ptr<base::Value> translated; | 115 scoped_ptr<base::Value> translated; |
| 116 if (it.key() == vpn::kSaveCredentials || | 116 if (it.key() == vpn::kSaveCredentials || |
| 117 it.key() == openvpn::kRemoteCertKU) { | 117 it.key() == openvpn::kRemoteCertKU || |
| 118 it.key() == openvpn::kServerCAPEMs) { |
| 118 translated.reset(it.value().DeepCopy()); | 119 translated.reset(it.value().DeepCopy()); |
| 119 } else { | 120 } else { |
| 120 // Shill wants all Provider/VPN fields to be strings. | 121 // Shill wants all Provider/VPN fields to be strings. |
| 121 translated = ConvertValueToString(it.value()); | 122 translated = ConvertValueToString(it.value()); |
| 122 } | 123 } |
| 123 AddValueAccordingToSignature(it.key(), translated.Pass()); | 124 AddValueAccordingToSignature(it.key(), translated.Pass()); |
| 124 } | 125 } |
| 125 } | 126 } |
| 126 | 127 |
| 127 void LocalTranslator::TranslateVPN() { | 128 void LocalTranslator::TranslateVPN() { |
| (...skipping 128 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 256 const OncValueSignature* onc_signature, | 257 const OncValueSignature* onc_signature, |
| 257 const base::DictionaryValue& onc_object) { | 258 const base::DictionaryValue& onc_object) { |
| 258 CHECK(onc_signature != NULL); | 259 CHECK(onc_signature != NULL); |
| 259 scoped_ptr<base::DictionaryValue> shill_dictionary(new base::DictionaryValue); | 260 scoped_ptr<base::DictionaryValue> shill_dictionary(new base::DictionaryValue); |
| 260 TranslateONCHierarchy(*onc_signature, onc_object, shill_dictionary.get()); | 261 TranslateONCHierarchy(*onc_signature, onc_object, shill_dictionary.get()); |
| 261 return shill_dictionary.Pass(); | 262 return shill_dictionary.Pass(); |
| 262 } | 263 } |
| 263 | 264 |
| 264 } // namespace onc | 265 } // namespace onc |
| 265 } // namespace chromeos | 266 } // namespace chromeos |
| OLD | NEW |