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

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

Issue 589693002: Fix JS for proxy config UI (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 3 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 | no next file » | 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 e4235695322367803a77f60db43514cf92da1965..61cb0777e4293ba5809422d250043499d7a7bae9 100644
--- a/chrome/browser/resources/options/chromeos/internet_detail.js
+++ b/chrome/browser/resources/options/chromeos/internet_detail.js
@@ -443,9 +443,9 @@ cr.define('options.internet', function() {
* Update details page controls.
*/
updateControls: function() {
+ // Note: onc may be undefined when called from a pref update before
+ // initialized in sendNetworkDetails.
var onc = this.onc_;
- if (onc == undefined)
- return; // May get called from a pref update before initialized.
// Always show the ipconfig section. TODO(stevenjb): Improve the display
// for unconnected networks. Currently the IP address fields may be
@@ -464,7 +464,7 @@ cr.define('options.internet', function() {
updateHidden('#details-internet-page .proxy-details', !this.showProxy_);
// Cellular
- if (this.type_ == 'Cellular') {
+ if (onc && this.type_ == 'Cellular') {
// Hide gsm/cdma specific elements.
if (onc.getActiveValue('Cellular.Family') == 'GSM')
updateHidden('#details-internet-page .cdma-only', true);
@@ -479,10 +479,11 @@ cr.define('options.internet', function() {
this.type_ == 'VPN');
// Password and shared.
- var source = onc.getSource();
+ var source = onc ? onc.getSource() : 'None';
var shared = (source == 'Device' || source == 'DevicePolicy');
+ var security = onc ? onc.getWiFiSecurity() : 'None';
updateHidden('#details-internet-page #password-details',
- this.type_ != 'WiFi' || onc.getWiFiSecurity() == 'None');
+ this.type_ != 'WiFi' || security == 'None');
updateHidden('#details-internet-page #wifi-shared-network', !shared);
updateHidden('#details-internet-page #prefer-network', source == 'None');
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698