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

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

Issue 701243002: Fix JS errors for Cellular (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 1 month 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 | « chrome/browser/resources/options/chromeos/internet_detail.html ('k') | 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 ed08b6c458f5f8689b7a31d38fa213f669ab3e7d..3fdc203184e4a3b658f36f364c861fb8ad9f6a08 100644
--- a/chrome/browser/resources/options/chromeos/internet_detail.js
+++ b/chrome/browser/resources/options/chromeos/internet_detail.js
@@ -780,19 +780,22 @@ cr.define('options.internet', function() {
option.textContent =
name ? (name + ' (' + accessPointName + ')') : accessPointName;
option.value = i;
- // If this matches the active Apn, or LastGoodApn, set it as the
- // selected Apn.
+ // Insert new option before "other" option.
+ apnSelector.add(option, otherOption);
+ if (this.selectedApnIndex_ != -1)
+ continue;
+ // If this matches the active Apn, or LastGoodApn (or there is no last
+ // good APN), set it as the selected Apn.
if ((activeApn == accessPointName &&
- activeUsername == apnDict['Username'] &&
- activePassword == apnDict['Password']) ||
+ activeUsername == apnDict['Username'] &&
+ activePassword == apnDict['Password']) ||
+ (!activeApn && !lastGoodApn) ||
(!activeApn &&
- lastGoodApn == accessPointName &&
- lastGoodUsername == apnDict['Username'] &&
- lastGoodPassword == apnDict['Password'])) {
+ lastGoodApn == accessPointName &&
+ lastGoodUsername == apnDict['Username'] &&
+ lastGoodPassword == apnDict['Password'])) {
this.selectedApnIndex_ = i;
}
- // Insert new option before "other" option.
- apnSelector.add(option, otherOption);
}
if (this.selectedApnIndex_ == -1 && activeApn) {
var activeOption = document.createElement('option');
@@ -1560,6 +1563,7 @@ cr.define('options.internet', function() {
'#details-internet-page .controlled-setting-indicator');
for (var i = 0; i < indicators.length; i++) {
var managed = indicators[i].hasAttribute('managed');
+ // TODO(stevenjb): Eliminate support for 'data' once 39 is stable.
var attributeName = managed ? 'managed' : 'data';
var propName = indicators[i].getAttribute(attributeName);
if (!propName)
@@ -1567,9 +1571,9 @@ cr.define('options.internet', function() {
var propValue = managed ?
onc.getManagedProperty(propName) :
onc.getActiveValue(propName);
- if (propValue == undefined)
+ // If the property is unset or unmanaged (i.e. not an Object) skip it.
+ if (propValue == undefined || (typeof propValue != 'object'))
continue;
- propValue = assertInstanceof(propValue, Object);
var event;
if (managed)
event = detailsPage.createManagedEvent_(propName, propValue);
« no previous file with comments | « chrome/browser/resources/options/chromeos/internet_detail.html ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698