| 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 the network state for a specific | 6 * @fileoverview Polymer element for displaying the network state for a specific |
| 7 * type and a list of networks for that type. | 7 * type and a list of networks for that type. |
| 8 */ | 8 */ |
| 9 | 9 |
| 10 /** @typedef {chrome.networkingPrivate.DeviceStateProperties} */ | 10 /** @typedef {chrome.networkingPrivate.DeviceStateProperties} */ |
| (...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 97 return !!this.expanded_ && !!this.deviceState.Scanning; | 97 return !!this.expanded_ && !!this.deviceState.Scanning; |
| 98 }, | 98 }, |
| 99 | 99 |
| 100 /** | 100 /** |
| 101 * Show the <network-siminfo> element if this is a disabled and locked | 101 * Show the <network-siminfo> element if this is a disabled and locked |
| 102 * cellular device. | 102 * cellular device. |
| 103 * @return {boolean} | 103 * @return {boolean} |
| 104 * @private | 104 * @private |
| 105 */ | 105 */ |
| 106 showSimInfo_: function() { | 106 showSimInfo_: function() { |
| 107 let device = this.deviceState; | 107 var device = this.deviceState; |
| 108 if (device.Type != CrOnc.Type.CELLULAR || | 108 if (device.Type != CrOnc.Type.CELLULAR || |
| 109 this.deviceIsEnabled_(this.deviceState)) { | 109 this.deviceIsEnabled_(this.deviceState)) { |
| 110 return false; | 110 return false; |
| 111 } | 111 } |
| 112 return device.SimPresent === false || | 112 return device.SimPresent === false || |
| 113 device.SimLockType == CrOnc.LockType.PIN || | 113 device.SimLockType == CrOnc.LockType.PIN || |
| 114 device.SimLockType == CrOnc.LockType.PUK; | 114 device.SimLockType == CrOnc.LockType.PUK; |
| 115 }, | 115 }, |
| 116 | 116 |
| 117 /** | 117 /** |
| (...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 194 chrome.networkingPrivate.DeviceStateType.PROHIBITED; | 194 chrome.networkingPrivate.DeviceStateType.PROHIBITED; |
| 195 }, | 195 }, |
| 196 | 196 |
| 197 /** | 197 /** |
| 198 * @return {boolean} Whether or not to show the UI to expand the list. | 198 * @return {boolean} Whether or not to show the UI to expand the list. |
| 199 * @private | 199 * @private |
| 200 */ | 200 */ |
| 201 expandIsVisible_: function() { | 201 expandIsVisible_: function() { |
| 202 if (!this.deviceIsEnabled_(this.deviceState)) | 202 if (!this.deviceIsEnabled_(this.deviceState)) |
| 203 return false; | 203 return false; |
| 204 let type = this.deviceState.Type; | 204 var type = this.deviceState.Type; |
| 205 var minLength = | 205 var minLength = |
| 206 (type == CrOnc.Type.WI_FI || type == CrOnc.Type.VPN) ? 1 : 2; | 206 (type == CrOnc.Type.WI_FI || type == CrOnc.Type.VPN) ? 1 : 2; |
| 207 return this.networkStateList.length >= minLength; | 207 return this.networkStateList.length >= minLength; |
| 208 }, | 208 }, |
| 209 | 209 |
| 210 /** | 210 /** |
| 211 * @return {boolean} Whether or not to show the UI to show details. | 211 * @return {boolean} Whether or not to show the UI to show details. |
| 212 * @private | 212 * @private |
| 213 */ | 213 */ |
| 214 showDetailsIsVisible_: function() { | 214 showDetailsIsVisible_: function() { |
| (...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 272 */ | 272 */ |
| 273 onDeviceEnabledTap_: function(event) { | 273 onDeviceEnabledTap_: function(event) { |
| 274 var deviceIsEnabled = this.deviceIsEnabled_(this.deviceState); | 274 var deviceIsEnabled = this.deviceIsEnabled_(this.deviceState); |
| 275 var type = this.deviceState ? this.deviceState.Type : ''; | 275 var type = this.deviceState ? this.deviceState.Type : ''; |
| 276 this.fire( | 276 this.fire( |
| 277 'device-enabled-toggled', {enabled: !deviceIsEnabled, type: type}); | 277 'device-enabled-toggled', {enabled: !deviceIsEnabled, type: type}); |
| 278 // Make sure this does not propagate to onDetailsTap_. | 278 // Make sure this does not propagate to onDetailsTap_. |
| 279 event.stopPropagation(); | 279 event.stopPropagation(); |
| 280 }, | 280 }, |
| 281 }); | 281 }); |
| OLD | NEW |