Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(62)

Side by Side Diff: chromeos/network/onc/onc_translator_shill_to_onc.cc

Issue 539573002: Elim 'Translated' from Managed ONC dictionary (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix proxy settings Created 6 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 230 matching lines...) Expand 10 before | Expand all | Expand 10 after
241 << "' has value " << *shill_value 241 << "' has value " << *shill_value
242 << ", but expected a string: " << GetName(); 242 << ", but expected a string: " << GetName();
243 } 243 }
244 } 244 }
245 } 245 }
246 246
247 void ShillToONCTranslator::TranslateIPsec() { 247 void ShillToONCTranslator::TranslateIPsec() {
248 CopyPropertiesAccordingToSignature(); 248 CopyPropertiesAccordingToSignature();
249 if (shill_dictionary_->HasKey(shill::kL2tpIpsecXauthUserProperty)) 249 if (shill_dictionary_->HasKey(shill::kL2tpIpsecXauthUserProperty))
250 TranslateAndAddNestedObject(::onc::ipsec::kXAUTH); 250 TranslateAndAddNestedObject(::onc::ipsec::kXAUTH);
251 std::string client_cert_id;
252 shill_dictionary_->GetStringWithoutPathExpansion(
253 shill::kL2tpIpsecClientCertIdProperty, &client_cert_id);
254 std::string authentication_type =
255 client_cert_id.empty() ? ::onc::ipsec::kPSK : ::onc::ipsec::kCert;
256 onc_object_->SetStringWithoutPathExpansion(::onc::ipsec::kAuthenticationType,
257 authentication_type);
251 } 258 }
252 259
253 void ShillToONCTranslator::TranslateVPN() { 260 void ShillToONCTranslator::TranslateVPN() {
254 CopyPropertiesAccordingToSignature(); 261 CopyPropertiesAccordingToSignature();
255 262
256 // Parse Shill Provider dictionary. Note, this may not exist, e.g. if we are 263 // Parse Shill Provider dictionary. Note, this may not exist, e.g. if we are
257 // just translating network state in network_util::TranslateNetworkStateToONC. 264 // just translating network state in network_util::TranslateNetworkStateToONC.
258 const base::DictionaryValue* provider = NULL; 265 const base::DictionaryValue* provider = NULL;
259 if (!shill_dictionary_->GetDictionaryWithoutPathExpansion( 266 if (!shill_dictionary_->GetDictionaryWithoutPathExpansion(
260 shill::kProviderProperty, &provider)) { 267 shill::kProviderProperty, &provider)) {
(...skipping 353 matching lines...) Expand 10 before | Expand all | Expand 10 after
614 const base::DictionaryValue& shill_dictionary, 621 const base::DictionaryValue& shill_dictionary,
615 const OncValueSignature* onc_signature) { 622 const OncValueSignature* onc_signature) {
616 CHECK(onc_signature != NULL); 623 CHECK(onc_signature != NULL);
617 624
618 ShillToONCTranslator translator(shill_dictionary, *onc_signature); 625 ShillToONCTranslator translator(shill_dictionary, *onc_signature);
619 return translator.CreateTranslatedONCObject(); 626 return translator.CreateTranslatedONCObject();
620 } 627 }
621 628
622 } // namespace onc 629 } // namespace onc
623 } // namespace chromeos 630 } // namespace chromeos
OLDNEW
« no previous file with comments | « chromeos/network/onc/onc_translation_tables.cc ('k') | chromeos/test/data/network/translation_of_shill_l2tpipsec.onc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698