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

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: 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
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..5ad1e409d42e24b4c076beb8893bafdde780a822 100644
--- a/chromeos/network/onc/onc_translator_onc_to_shill.cc
+++ b/chromeos/network/onc/onc_translator_onc_to_shill.cc
@@ -188,10 +188,26 @@ 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))
pneubeck (no reviews) 2015/03/18 19:35:29 nit: missing {}
bartfab (slow) 2015/03/18 20:02:14 Done.
+ 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();
}

Powered by Google App Engine
This is Rietveld 408576698