| OLD | NEW |
| 1 // Copyright 2017 The Chromium Authors. All rights reserved. | 1 // Copyright 2017 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-subpage' is the settings subpage for managing bluetooth | 7 * 'settings-bluetooth-subpage' is the settings subpage for managing bluetooth |
| 8 * properties and devices. | 8 * properties and devices. |
| 9 */ | 9 */ |
| 10 | 10 |
| (...skipping 155 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 166 return this.bluetoothEnabled && !this.dialogId_; | 166 return this.bluetoothEnabled && !this.dialogId_; |
| 167 }, | 167 }, |
| 168 | 168 |
| 169 /** @private */ | 169 /** @private */ |
| 170 adapterStateChanged_: function() { | 170 adapterStateChanged_: function() { |
| 171 this.updateDeviceList_(); | 171 this.updateDeviceList_(); |
| 172 }, | 172 }, |
| 173 | 173 |
| 174 /** @private */ | 174 /** @private */ |
| 175 deviceListChanged_: function() { | 175 deviceListChanged_: function() { |
| 176 var devices = this.$.devices; | 176 this.saveScroll(this.$.devices); |
| 177 this.pairedDeviceList_ = this.deviceList_.filter(function(device) { | 177 this.pairedDeviceList_ = this.deviceList_.filter(function(device) { |
| 178 return !!device.paired || !!device.connecting; | 178 return !!device.paired || !!device.connecting; |
| 179 }); | 179 }); |
| 180 this.updateScrollableContents(); | 180 this.updateScrollableContents(); |
| 181 this.restoreScroll(this.$.devices); |
| 181 }, | 182 }, |
| 182 | 183 |
| 183 /** @private */ | 184 /** @private */ |
| 184 selectedItemChanged_: function() { | 185 selectedItemChanged_: function() { |
| 185 if (this.selectedItem_) | 186 if (this.selectedItem_) |
| 186 this.connectDevice_(this.selectedItem_); | 187 this.connectDevice_(this.selectedItem_); |
| 187 }, | 188 }, |
| 188 | 189 |
| 189 /** | 190 /** |
| 190 * If bluetooth is enabled, request the complete list of devices and update | 191 * If bluetooth is enabled, request the complete list of devices and update |
| (...skipping 215 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 406 this.startDiscovery_(); | 407 this.startDiscovery_(); |
| 407 }, | 408 }, |
| 408 | 409 |
| 409 /** @private */ | 410 /** @private */ |
| 410 onDialogClosed_: function() { | 411 onDialogClosed_: function() { |
| 411 this.stopDiscovery_(); | 412 this.stopDiscovery_(); |
| 412 this.dialogId_ = ''; | 413 this.dialogId_ = ''; |
| 413 this.pairingDevice_ = undefined; | 414 this.pairingDevice_ = undefined; |
| 414 }, | 415 }, |
| 415 }); | 416 }); |
| OLD | NEW |