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

Unified Diff: chrome/browser/resources/settings/internet_page/internet_detail_page.js

Issue 1403773002: Fix VPN connected logic in internet settings (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Make closure happy Created 5 years, 2 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: chrome/browser/resources/settings/internet_page/internet_detail_page.js
diff --git a/chrome/browser/resources/settings/internet_page/internet_detail_page.js b/chrome/browser/resources/settings/internet_page/internet_detail_page.js
index 76a49bc38ba4967f190113048053e4de301cbd26..88a4ce8864be06b9a2de176fcfa13985ebdd2ea9 100644
--- a/chrome/browser/resources/settings/internet_page/internet_detail_page.js
+++ b/chrome/browser/resources/settings/internet_page/internet_detail_page.js
@@ -66,6 +66,15 @@ Polymer({
},
/**
+ * Highest priority connected network or null.
+ * @type {?CrOnc.NetworkStateProperties}
+ */
+ defaultNetwork: {
+ type: Object,
+ value: null
+ },
+
+ /**
* Object providing network type values for data binding.
* @const
*/
@@ -310,15 +319,18 @@ Polymer({
},
/**
+ * @param {!CrOnc.NetworkProperties} properties
+ * @param {?CrOnc.NetworkStateProperties} defaultNetwork
* @return {boolean} Whether or not to enable the network connect button.
* @private
*/
- enableConnect_: function(properties) {
+ enableConnect_: function(properties, defaultNetwork) {
if (!properties || !this.showConnect_(properties))
return false;
if (properties.Type == CrOnc.Type.CELLULAR && CrOnc.isSimLocked(properties))
return false;
- // TODO(stevenjb): For VPN, check connected state of any network.
+ if (properties.Type == CrOnc.Type.VPN && !defaultNetwork)
+ return false;
return true;
},

Powered by Google App Engine
This is Rietveld 408576698