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 178 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
189 | 189 |
190 void LocalTranslator::TranslateVPN() { | 190 void LocalTranslator::TranslateVPN() { |
191 CopyFieldFromONCToShill(::onc::vpn::kHost, shill::kProviderHostProperty); | 191 CopyFieldFromONCToShill(::onc::vpn::kHost, shill::kProviderHostProperty); |
192 std::string type; | 192 std::string type; |
193 if (onc_object_->GetStringWithoutPathExpansion(::onc::vpn::kType, &type)) | 193 if (onc_object_->GetStringWithoutPathExpansion(::onc::vpn::kType, &type)) |
194 TranslateWithTableAndSet(type, kVPNTypeTable, shill::kProviderTypeProperty); | 194 TranslateWithTableAndSet(type, kVPNTypeTable, shill::kProviderTypeProperty); |
195 | 195 |
196 CopyFieldsAccordingToSignature(); | 196 CopyFieldsAccordingToSignature(); |
197 } | 197 } |
198 | 198 |
199 // XXX check how used | |
stevenjb
2014/12/08 22:27:21
Elim
mukesh agrawal
2014/12/16 22:07:00
Done.
| |
199 void LocalTranslator::TranslateWiFi() { | 200 void LocalTranslator::TranslateWiFi() { |
200 std::string security; | 201 std::string security; |
201 onc_object_->GetStringWithoutPathExpansion(::onc::wifi::kSecurity, &security); | 202 onc_object_->GetStringWithoutPathExpansion(::onc::wifi::kSecurity, &security); |
202 TranslateWithTableAndSet(security, kWiFiSecurityTable, | 203 TranslateWithTableAndSet(security, kWiFiSecurityTable, |
203 shill::kSecurityProperty); | 204 shill::kSecurityClassProperty); |
204 | 205 |
205 std::string ssid; | 206 std::string ssid; |
206 onc_object_->GetStringWithoutPathExpansion(::onc::wifi::kSSID, &ssid); | 207 onc_object_->GetStringWithoutPathExpansion(::onc::wifi::kSSID, &ssid); |
207 if (!ssid.empty()) | 208 if (!ssid.empty()) |
208 shill_property_util::SetSSID(ssid, shill_dictionary_); | 209 shill_property_util::SetSSID(ssid, shill_dictionary_); |
209 | 210 |
210 // We currently only support managed and no adhoc networks. | 211 // We currently only support managed and no adhoc networks. |
211 shill_dictionary_->SetStringWithoutPathExpansion(shill::kModeProperty, | 212 shill_dictionary_->SetStringWithoutPathExpansion(shill::kModeProperty, |
212 shill::kModeManaged); | 213 shill::kModeManaged); |
213 | 214 |
(...skipping 160 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
374 const OncValueSignature* onc_signature, | 375 const OncValueSignature* onc_signature, |
375 const base::DictionaryValue& onc_object) { | 376 const base::DictionaryValue& onc_object) { |
376 CHECK(onc_signature != NULL); | 377 CHECK(onc_signature != NULL); |
377 scoped_ptr<base::DictionaryValue> shill_dictionary(new base::DictionaryValue); | 378 scoped_ptr<base::DictionaryValue> shill_dictionary(new base::DictionaryValue); |
378 TranslateONCHierarchy(*onc_signature, onc_object, shill_dictionary.get()); | 379 TranslateONCHierarchy(*onc_signature, onc_object, shill_dictionary.get()); |
379 return shill_dictionary.Pass(); | 380 return shill_dictionary.Pass(); |
380 } | 381 } |
381 | 382 |
382 } // namespace onc | 383 } // namespace onc |
383 } // namespace chromeos | 384 } // namespace chromeos |
OLD | NEW |