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

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: . 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 222 matching lines...) Expand 10 before | Expand all | Expand 10 after
233 << "' has value " << *shill_value 233 << "' has value " << *shill_value
234 << ", but expected a string: " << GetName(); 234 << ", but expected a string: " << GetName();
235 } 235 }
236 } 236 }
237 } 237 }
238 238
239 void ShillToONCTranslator::TranslateIPsec() { 239 void ShillToONCTranslator::TranslateIPsec() {
240 CopyPropertiesAccordingToSignature(); 240 CopyPropertiesAccordingToSignature();
241 if (shill_dictionary_->HasKey(shill::kL2tpIpsecXauthUserProperty)) 241 if (shill_dictionary_->HasKey(shill::kL2tpIpsecXauthUserProperty))
242 TranslateAndAddNestedObject(::onc::ipsec::kXAUTH); 242 TranslateAndAddNestedObject(::onc::ipsec::kXAUTH);
243 std::string client_cert_id;
244 shill_dictionary_->GetStringWithoutPathExpansion(
pneubeck (no reviews) 2014/09/04 12:50:14 +Ben who ran into this issue before, see this comm
stevenjb 2014/09/04 15:34:11 I'd rather not block this on a Shill change, we ca
pneubeck (no reviews) 2014/09/04 18:05:20 I didn't intend to suggest blocking this. This sho
245 shill::kL2tpIpsecClientCertIdProperty, &client_cert_id);
246 std::string authentication_type =
247 client_cert_id.empty() ? ::onc::ipsec::kPSK : ::onc::ipsec::kCert;
248 onc_object_->SetStringWithoutPathExpansion(::onc::ipsec::kAuthenticationType,
249 authentication_type);
243 } 250 }
244 251
245 void ShillToONCTranslator::TranslateVPN() { 252 void ShillToONCTranslator::TranslateVPN() {
246 CopyPropertiesAccordingToSignature(); 253 CopyPropertiesAccordingToSignature();
247 254
248 // Parse Shill Provider dictionary. Note, this may not exist, e.g. if we are 255 // Parse Shill Provider dictionary. Note, this may not exist, e.g. if we are
249 // just translating network state in network_util::TranslateNetworkStateToONC. 256 // just translating network state in network_util::TranslateNetworkStateToONC.
250 const base::DictionaryValue* provider = NULL; 257 const base::DictionaryValue* provider = NULL;
251 if (!shill_dictionary_->GetDictionaryWithoutPathExpansion( 258 if (!shill_dictionary_->GetDictionaryWithoutPathExpansion(
252 shill::kProviderProperty, &provider)) { 259 shill::kProviderProperty, &provider)) {
(...skipping 321 matching lines...) Expand 10 before | Expand all | Expand 10 after
574 const base::DictionaryValue& shill_dictionary, 581 const base::DictionaryValue& shill_dictionary,
575 const OncValueSignature* onc_signature) { 582 const OncValueSignature* onc_signature) {
576 CHECK(onc_signature != NULL); 583 CHECK(onc_signature != NULL);
577 584
578 ShillToONCTranslator translator(shill_dictionary, *onc_signature); 585 ShillToONCTranslator translator(shill_dictionary, *onc_signature);
579 return translator.CreateTranslatedONCObject(); 586 return translator.CreateTranslatedONCObject();
580 } 587 }
581 588
582 } // namespace onc 589 } // namespace onc
583 } // namespace chromeos 590 } // namespace chromeos
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698