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 | 6 * @fileoverview |
7 * 'settings-bluetooth-page' is the settings page for managing bluetooth | 7 * 'settings-bluetooth-page' is the settings page for managing bluetooth |
8 * properties and devices. | 8 * properties and devices. |
9 * | 9 * |
10 * Example: | 10 * Example: |
(...skipping 179 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
190 } | 190 } |
191 }, | 191 }, |
192 | 192 |
193 bluetoothEnabledChanged_: function() { | 193 bluetoothEnabledChanged_: function() { |
194 // When bluetooth is enabled, auto-expand the device list. | 194 // When bluetooth is enabled, auto-expand the device list. |
195 if (this.bluetoothEnabled) | 195 if (this.bluetoothEnabled) |
196 this.deviceListExpanded = true; | 196 this.deviceListExpanded = true; |
197 }, | 197 }, |
198 | 198 |
199 /** | 199 /** |
200 * @return {boolean} Whether the <iron-collapse> can be shown. | |
201 * @private | |
202 */ | |
203 canShowDeviceList_: function() { | |
stevenjb
2016/04/12 15:58:49
We never resolved this in the style guide, but we
Dan Beam
2016/04/12 19:51:02
Done.
| |
204 return this.bluetoothEnabled && this.deviceListExpanded; | |
205 }, | |
206 | |
207 /** | |
200 * If bluetooth is enabled, request the complete list of devices and update | 208 * If bluetooth is enabled, request the complete list of devices and update |
201 * |deviceList|. | 209 * |deviceList|. |
202 * @private | 210 * @private |
203 */ | 211 */ |
204 updateDeviceList_: function() { | 212 updateDeviceList_: function() { |
205 if (!this.bluetoothEnabled) { | 213 if (!this.bluetoothEnabled) { |
206 this.deviceList = []; | 214 this.deviceList = []; |
207 return; | 215 return; |
208 } | 216 } |
209 this.bluetooth.getDevices(function(devices) { | 217 this.bluetooth.getDevices(function(devices) { |
(...skipping 301 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
511 | 519 |
512 /** @private */ | 520 /** @private */ |
513 onCloseDialog_: function(event) { this.closeDialog_(); }, | 521 onCloseDialog_: function(event) { this.closeDialog_(); }, |
514 | 522 |
515 /** @private */ | 523 /** @private */ |
516 onDialogOpened_: function() { this.startDiscovery_(); }, | 524 onDialogOpened_: function() { this.startDiscovery_(); }, |
517 | 525 |
518 /** @private */ | 526 /** @private */ |
519 onDialogClosed_: function() { this.stopDiscovery_(); }, | 527 onDialogClosed_: function() { this.stopDiscovery_(); }, |
520 }); | 528 }); |
OLD | NEW |