| 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 183 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 194 TranslateWithTableAndSet(type, kVPNTypeTable, shill::kProviderTypeProperty); | 194 TranslateWithTableAndSet(type, kVPNTypeTable, shill::kProviderTypeProperty); |
| 195 | 195 |
| 196 CopyFieldsAccordingToSignature(); | 196 CopyFieldsAccordingToSignature(); |
| 197 } | 197 } |
| 198 | 198 |
| 199 void LocalTranslator::TranslateWiFi() { | 199 void LocalTranslator::TranslateWiFi() { |
| 200 std::string security; | 200 std::string security; |
| 201 if (onc_object_->GetStringWithoutPathExpansion( | 201 if (onc_object_->GetStringWithoutPathExpansion( |
| 202 ::onc::wifi::kSecurity, &security)) { | 202 ::onc::wifi::kSecurity, &security)) { |
| 203 TranslateWithTableAndSet(security, kWiFiSecurityTable, | 203 TranslateWithTableAndSet(security, kWiFiSecurityTable, |
| 204 shill::kSecurityProperty); | 204 shill::kSecurityClassProperty); |
| 205 } | 205 } |
| 206 | 206 |
| 207 std::string ssid; | 207 std::string ssid; |
| 208 onc_object_->GetStringWithoutPathExpansion(::onc::wifi::kSSID, &ssid); | 208 onc_object_->GetStringWithoutPathExpansion(::onc::wifi::kSSID, &ssid); |
| 209 if (!ssid.empty()) | 209 if (!ssid.empty()) |
| 210 shill_property_util::SetSSID(ssid, shill_dictionary_); | 210 shill_property_util::SetSSID(ssid, shill_dictionary_); |
| 211 | 211 |
| 212 // We currently only support managed and no adhoc networks. | 212 // We currently only support managed and no adhoc networks. |
| 213 shill_dictionary_->SetStringWithoutPathExpansion(shill::kModeProperty, | 213 shill_dictionary_->SetStringWithoutPathExpansion(shill::kModeProperty, |
| 214 shill::kModeManaged); | 214 shill::kModeManaged); |
| (...skipping 174 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 389 const OncValueSignature* onc_signature, | 389 const OncValueSignature* onc_signature, |
| 390 const base::DictionaryValue& onc_object) { | 390 const base::DictionaryValue& onc_object) { |
| 391 CHECK(onc_signature != NULL); | 391 CHECK(onc_signature != NULL); |
| 392 scoped_ptr<base::DictionaryValue> shill_dictionary(new base::DictionaryValue); | 392 scoped_ptr<base::DictionaryValue> shill_dictionary(new base::DictionaryValue); |
| 393 TranslateONCHierarchy(*onc_signature, onc_object, shill_dictionary.get()); | 393 TranslateONCHierarchy(*onc_signature, onc_object, shill_dictionary.get()); |
| 394 return shill_dictionary.Pass(); | 394 return shill_dictionary.Pass(); |
| 395 } | 395 } |
| 396 | 396 |
| 397 } // namespace onc | 397 } // namespace onc |
| 398 } // namespace chromeos | 398 } // namespace chromeos |
| OLD | NEW |