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

Unified Diff: chrome/browser/resources/options/chromeos/internet_detail.js

Issue 1043343002: Use networkingPrivate.startConnect (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@issue_430115_internet_options_cellular
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
« no previous file with comments | « no previous file | chrome/browser/ui/webui/options/chromeos/internet_options_handler.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/resources/options/chromeos/internet_detail.js
diff --git a/chrome/browser/resources/options/chromeos/internet_detail.js b/chrome/browser/resources/options/chromeos/internet_detail.js
index 7193f7905f91c87145161b68bfb15e0169ebb0a3..950061dd435b34c86f570ecbab1a86805288a404 100644
--- a/chrome/browser/resources/options/chromeos/internet_detail.js
+++ b/chrome/browser/resources/options/chromeos/internet_detail.js
@@ -1163,8 +1163,27 @@ cr.define('options.internet', function() {
sendChromeMetricsAction('Options_NetworkConnectToWifi');
else if (detailsPage.type_ == 'VPN')
sendChromeMetricsAction('Options_NetworkConnectToVPN');
- // TODO(stevenjb): chrome.networkingPrivate.startConnect
- chrome.send('startConnect', [detailsPage.onc_.guid()]);
+
+ var onc = detailsPage.onc_;
+ var guid = onc.guid();
+
+ // Unconfigured networks, VPNs, and secure WiFi networks with ErrorState
+ // set require configuration before they can be connected to.
+ if (!onc.getActiveValue('Connectable') || (detailsPage.type_ == 'VPN') ||
armansito 2015/04/01 00:41:54 Won't this lead to a call to 'configureNetwork' if
stevenjb 2015/04/01 20:53:39 In theory that should be correct; if 'Connectable'
+ (detailsPage.type_ == 'WiFi' && onc.getActiveValue('ErrorState') &&
+ onc.getWiFiSecurity() != 'None')) {
+ chrome.send('configureNetwork', [guid]);
+ return;
+ }
+
+ if (detailsPage.type_ == 'Cellular') {
+ var activationState = onc.getActiveValue('Cellular.ActivationState');
+ if (activationState != 'Activated' && activationState != 'Unknown') {
+ DetailsInternetPage.activateCellular(guid);
+ return;
+ }
+ }
+ chrome.networkingPrivate.startConnect(guid);
PageManager.closeOverlay();
};
« no previous file with comments | « no previous file | chrome/browser/ui/webui/options/chromeos/internet_options_handler.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698