| 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 127 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 138 } else { | 138 } else { |
| 139 CopyPropertiesAccordingToSignature(); | 139 CopyPropertiesAccordingToSignature(); |
| 140 } | 140 } |
| 141 return onc_object_.Pass(); | 141 return onc_object_.Pass(); |
| 142 } | 142 } |
| 143 | 143 |
| 144 void ShillToONCTranslator::TranslateEthernet() { | 144 void ShillToONCTranslator::TranslateEthernet() { |
| 145 std::string shill_network_type; | 145 std::string shill_network_type; |
| 146 shill_dictionary_->GetStringWithoutPathExpansion(shill::kTypeProperty, | 146 shill_dictionary_->GetStringWithoutPathExpansion(shill::kTypeProperty, |
| 147 &shill_network_type); | 147 &shill_network_type); |
| 148 const char* onc_auth = ::onc::ethernet::kNone; | 148 const char* onc_auth = ::onc::ethernet::kAuthenticationNone; |
| 149 if (shill_network_type == shill::kTypeEthernetEap) | 149 if (shill_network_type == shill::kTypeEthernetEap) |
| 150 onc_auth = ::onc::ethernet::k8021X; | 150 onc_auth = ::onc::ethernet::k8021X; |
| 151 onc_object_->SetStringWithoutPathExpansion(::onc::ethernet::kAuthentication, | 151 onc_object_->SetStringWithoutPathExpansion(::onc::ethernet::kAuthentication, |
| 152 onc_auth); | 152 onc_auth); |
| 153 } | 153 } |
| 154 | 154 |
| 155 void ShillToONCTranslator::TranslateOpenVPN() { | 155 void ShillToONCTranslator::TranslateOpenVPN() { |
| 156 if (shill_dictionary_->HasKey(shill::kOpenVPNVerifyX509NameProperty)) | 156 if (shill_dictionary_->HasKey(shill::kOpenVPNVerifyX509NameProperty)) |
| 157 TranslateAndAddNestedObject(::onc::openvpn::kVerifyX509); | 157 TranslateAndAddNestedObject(::onc::openvpn::kVerifyX509); |
| 158 | 158 |
| (...skipping 334 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 493 const base::DictionaryValue& shill_dictionary, | 493 const base::DictionaryValue& shill_dictionary, |
| 494 const OncValueSignature* onc_signature) { | 494 const OncValueSignature* onc_signature) { |
| 495 CHECK(onc_signature != NULL); | 495 CHECK(onc_signature != NULL); |
| 496 | 496 |
| 497 ShillToONCTranslator translator(shill_dictionary, *onc_signature); | 497 ShillToONCTranslator translator(shill_dictionary, *onc_signature); |
| 498 return translator.CreateTranslatedONCObject(); | 498 return translator.CreateTranslatedONCObject(); |
| 499 } | 499 } |
| 500 | 500 |
| 501 } // namespace onc | 501 } // namespace onc |
| 502 } // namespace chromeos | 502 } // namespace chromeos |
| OLD | NEW |