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 #include "chromeos/network/onc/onc_translator.h" | 5 #include "chromeos/network/onc/onc_translator.h" |
6 | 6 |
7 #include <string> | 7 #include <string> |
8 | 8 |
9 #include "base/basictypes.h" | 9 #include "base/basictypes.h" |
10 #include "base/json/json_reader.h" | 10 #include "base/json/json_reader.h" |
(...skipping 295 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
306 bool save_credentials; | 306 bool save_credentials; |
307 if (shill_dictionary_->GetBooleanWithoutPathExpansion( | 307 if (shill_dictionary_->GetBooleanWithoutPathExpansion( |
308 shill::kSaveCredentialsProperty, &save_credentials)) { | 308 shill::kSaveCredentialsProperty, &save_credentials)) { |
309 SetNestedOncValue(provider_type_dictionary, | 309 SetNestedOncValue(provider_type_dictionary, |
310 ::onc::vpn::kSaveCredentials, | 310 ::onc::vpn::kSaveCredentials, |
311 base::FundamentalValue(save_credentials)); | 311 base::FundamentalValue(save_credentials)); |
312 } | 312 } |
313 } | 313 } |
314 | 314 |
315 void ShillToONCTranslator::TranslateWiFiWithState() { | 315 void ShillToONCTranslator::TranslateWiFiWithState() { |
316 TranslateWithTableAndSet( | 316 TranslateWithTableAndSet(shill::kSecurityClassProperty, |
317 shill::kSecurityProperty, kWiFiSecurityTable, ::onc::wifi::kSecurity); | 317 kWiFiSecurityTable, |
| 318 ::onc::wifi::kSecurity); |
318 std::string ssid = shill_property_util::GetSSIDFromProperties( | 319 std::string ssid = shill_property_util::GetSSIDFromProperties( |
319 *shill_dictionary_, NULL /* ignore unknown encoding */); | 320 *shill_dictionary_, NULL /* ignore unknown encoding */); |
320 if (!ssid.empty()) | 321 if (!ssid.empty()) |
321 onc_object_->SetStringWithoutPathExpansion(::onc::wifi::kSSID, ssid); | 322 onc_object_->SetStringWithoutPathExpansion(::onc::wifi::kSSID, ssid); |
322 | 323 |
323 bool link_monitor_disable; | 324 bool link_monitor_disable; |
324 if (shill_dictionary_->GetBooleanWithoutPathExpansion( | 325 if (shill_dictionary_->GetBooleanWithoutPathExpansion( |
325 shill::kLinkMonitorDisableProperty, &link_monitor_disable)) { | 326 shill::kLinkMonitorDisableProperty, &link_monitor_disable)) { |
326 onc_object_->SetBooleanWithoutPathExpansion( | 327 onc_object_->SetBooleanWithoutPathExpansion( |
327 ::onc::wifi::kAllowGatewayARPPolling, !link_monitor_disable); | 328 ::onc::wifi::kAllowGatewayARPPolling, !link_monitor_disable); |
(...skipping 370 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
698 ::onc::ONCSource onc_source, | 699 ::onc::ONCSource onc_source, |
699 const OncValueSignature* onc_signature) { | 700 const OncValueSignature* onc_signature) { |
700 CHECK(onc_signature != NULL); | 701 CHECK(onc_signature != NULL); |
701 | 702 |
702 ShillToONCTranslator translator(shill_dictionary, onc_source, *onc_signature); | 703 ShillToONCTranslator translator(shill_dictionary, onc_source, *onc_signature); |
703 return translator.CreateTranslatedONCObject(); | 704 return translator.CreateTranslatedONCObject(); |
704 } | 705 } |
705 | 706 |
706 } // namespace onc | 707 } // namespace onc |
707 } // namespace chromeos | 708 } // namespace chromeos |
OLD | NEW |