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

Unified Diff: ash/system/chromeos/network/vpn_delegate.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: ash/system/chromeos/network/vpn_delegate.cc
diff --git a/ash/system/chromeos/network/vpn_delegate.cc b/ash/system/chromeos/network/vpn_delegate.cc
index a3b2dcf316b0b6f3d70627cda89aaefa403af703..62264a6511f4188aa86c12c7bfb938a05a6d826d 100644
--- a/ash/system/chromeos/network/vpn_delegate.cc
+++ b/ash/system/chromeos/network/vpn_delegate.cc
@@ -24,12 +24,12 @@ bool VPNProvider::Key::MatchesNetwork(
const chromeos::NetworkState& network) const {
if (network.type() != shill::kTypeVPN)
return false;
- if (third_party)
- return network.vpn_provider_extension_id() == extension_id;
- // Currently, all networks with an empty |vpn_provider_extension_id| use a
- // single built-in VPN providers. In the future, we may distinguish between
- // multiple built-in providers based on the |Provider.Type| property.
- return network.vpn_provider_extension_id().empty();
+ const bool network_uses_third_party_provider =
+ network.vpn_provider_type() == shill::kProviderThirdPartyVpn;
+ if (!third_party)
+ return !network_uses_third_party_provider;
+ return network_uses_third_party_provider &&
+ network.third_party_vpn_provider_extension_id() == extension_id;
}
VPNProvider::VPNProvider(const Key& key, const std::string& name)

Powered by Google App Engine
This is Rietveld 408576698