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

Unified Diff: chromeos/network/onc/onc_translator_onc_to_shill.cc

Issue 1019033002: Add an ONC property for the third-party VPN provider extension ID (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fixed browser tests. Created 5 years, 9 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chromeos/network/onc/onc_signature.cc ('k') | chromeos/network/onc/onc_translator_shill_to_onc.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chromeos/network/onc/onc_translator_onc_to_shill.cc
diff --git a/chromeos/network/onc/onc_translator_onc_to_shill.cc b/chromeos/network/onc/onc_translator_onc_to_shill.cc
index fdd8fbdd8a10aad2b9a3e6c0ee425bfd9e2406ca..3cf9789f447a15e9f2f19ca46946dada92098583 100644
--- a/chromeos/network/onc/onc_translator_onc_to_shill.cc
+++ b/chromeos/network/onc/onc_translator_onc_to_shill.cc
@@ -188,10 +188,28 @@ void LocalTranslator::TranslateIPsec() {
}
void LocalTranslator::TranslateVPN() {
- CopyFieldFromONCToShill(::onc::vpn::kHost, shill::kProviderHostProperty);
- std::string type;
- if (onc_object_->GetStringWithoutPathExpansion(::onc::vpn::kType, &type))
- TranslateWithTableAndSet(type, kVPNTypeTable, shill::kProviderTypeProperty);
+ std::string onc_type;
+ if (onc_object_->GetStringWithoutPathExpansion(::onc::vpn::kType,
+ &onc_type)) {
+ TranslateWithTableAndSet(onc_type, kVPNTypeTable,
+ shill::kProviderTypeProperty);
+ }
+ if (onc_type == ::onc::vpn::kThirdPartyVpn) {
+ // For third-party VPNs, |shill::kProviderHostProperty| is used to store the
+ // provider's extension ID.
+ const base::DictionaryValue* onc_third_party_vpn = nullptr;
+ onc_object_->GetDictionaryWithoutPathExpansion(::onc::vpn::kThirdPartyVpn,
+ &onc_third_party_vpn);
+ std::string onc_extension_id;
+ if (onc_third_party_vpn &&
+ onc_third_party_vpn->GetStringWithoutPathExpansion(
+ ::onc::third_party_vpn::kExtensionID, &onc_extension_id)) {
+ shill_dictionary_->SetStringWithoutPathExpansion(
+ shill::kProviderHostProperty, onc_extension_id);
+ }
+ } else {
+ CopyFieldFromONCToShill(::onc::vpn::kHost, shill::kProviderHostProperty);
+ }
CopyFieldsAccordingToSignature();
}
« no previous file with comments | « chromeos/network/onc/onc_signature.cc ('k') | chromeos/network/onc/onc_translator_shill_to_onc.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698