| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 /** | 5 /** |
| 6 * @fileoverview Polymer element for displaying and modifying a list of cellular | 6 * @fileoverview Polymer element for displaying and modifying a list of cellular |
| 7 * access points. | 7 * access points. |
| 8 */ | 8 */ |
| 9 Polymer({ | 9 Polymer({ |
| 10 is: 'network-apnlist', | 10 is: 'network-apnlist', |
| (...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 133 otherApn.AccessPointName || this.DefaultAccessPointName; | 133 otherApn.AccessPointName || this.DefaultAccessPointName; |
| 134 | 134 |
| 135 // Save the 'other' properties. | 135 // Save the 'other' properties. |
| 136 this.otherApn_ = otherApn; | 136 this.otherApn_ = otherApn; |
| 137 | 137 |
| 138 // Append 'other' to the end of the list of APNs. | 138 // Append 'other' to the end of the list of APNs. |
| 139 result.push(otherApn); | 139 result.push(otherApn); |
| 140 | 140 |
| 141 this.apnSelectList_ = result; | 141 this.apnSelectList_ = result; |
| 142 // Set selectedApn_ after dom-repeat has been stamped. | 142 // Set selectedApn_ after dom-repeat has been stamped. |
| 143 this.async(function() { | 143 this.async(() => { |
| 144 this.selectedApn_ = | 144 this.selectedApn_ = |
| 145 (activeApn && activeApn.AccessPointName) || otherApn.AccessPointName; | 145 (activeApn && activeApn.AccessPointName) || otherApn.AccessPointName; |
| 146 }.bind(this)); | 146 }); |
| 147 }, | 147 }, |
| 148 | 148 |
| 149 /** | 149 /** |
| 150 * @param {!CrOnc.APNProperties|undefined=} apnProperties | 150 * @param {!CrOnc.APNProperties|undefined=} apnProperties |
| 151 * @return {!CrOnc.APNProperties} A new APN object with properties from | 151 * @return {!CrOnc.APNProperties} A new APN object with properties from |
| 152 * |apnProperties| if provided. | 152 * |apnProperties| if provided. |
| 153 * @private | 153 * @private |
| 154 */ | 154 */ |
| 155 createApnObject_: function(apnProperties) { | 155 createApnObject_: function(apnProperties) { |
| 156 var newApn = {AccessPointName: ''}; | 156 var newApn = {AccessPointName: ''}; |
| (...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 260 * @return {CrOnc.APNProperties|undefined} The entry in |apnList| matching | 260 * @return {CrOnc.APNProperties|undefined} The entry in |apnList| matching |
| 261 * |accessPointName| if it exists, or undefined. | 261 * |accessPointName| if it exists, or undefined. |
| 262 * @private | 262 * @private |
| 263 */ | 263 */ |
| 264 findApnInList: function(apnList, accessPointName) { | 264 findApnInList: function(apnList, accessPointName) { |
| 265 return apnList.find(function(a) { | 265 return apnList.find(function(a) { |
| 266 return a.AccessPointName == accessPointName; | 266 return a.AccessPointName == accessPointName; |
| 267 }); | 267 }); |
| 268 } | 268 } |
| 269 }); | 269 }); |
| OLD | NEW |