Chromium Code Reviews| Index: chrome/browser/resources/settings/bluetooth_page/bluetooth_page.js |
| diff --git a/chrome/browser/resources/settings/bluetooth_page/bluetooth_page.js b/chrome/browser/resources/settings/bluetooth_page/bluetooth_page.js |
| index 66db1a9cf1c5244464a27de0d3f4e7fc0440d63c..ea9118f6f73ff5d147cb48db2428a82d2453dcc6 100644 |
| --- a/chrome/browser/resources/settings/bluetooth_page/bluetooth_page.js |
| +++ b/chrome/browser/resources/settings/bluetooth_page/bluetooth_page.js |
| @@ -80,6 +80,17 @@ Polymer({ |
| }, |
| /** |
| + * The ordered list of paired or connecting bluetooth devices. |
| + * @type {!Array<!chrome.bluetooth.Device>} |
| + */ |
| + pairedDeviceList_: { |
| + type: Array, |
| + value: /** @return {Array} */ function() { |
| + return []; |
| + }, |
| + }, |
| + |
| + /** |
| * Reflects the iron-list selecteditem property. |
| * @type {!chrome.bluetooth.Device} |
| * @private |
| @@ -228,6 +239,14 @@ Polymer({ |
| /** @private */ |
| deviceListChanged_: function() { |
| + var devices = this.$.devices; |
|
Dan Beam
2017/02/01 06:13:17
what's the point of this var? |this| wont change
stevenjb
2017/02/02 01:17:47
We use it twice below... Not sure I understand the
|
| + this.saveScroll(devices); |
| + this.pairedDeviceList_ = this.deviceList_.filter(function(device) { |
| + return !!device.paired || !!device.connecting; |
| + }); |
| + this.updateScrollableContents(); |
| + this.restoreScroll(devices); |
| + |
| for (var i = 0; i < this.deviceList_.length; ++i) { |
| if (this.deviceList_[i].connected) { |
| this.deviceConnected_ = true; |
| @@ -289,7 +308,6 @@ Polymer({ |
| } |
| this.bluetooth.getDevices(function(devices) { |
| this.deviceList_ = devices; |
| - this.updateScrollableContents(); |
| }.bind(this)); |
| }, |
| @@ -486,16 +504,6 @@ Polymer({ |
| }, |
| /** |
| - * @return {!Array<!chrome.bluetooth.Device>} |
| - * @private |
| - */ |
| - getPairedOrConnecting_: function() { |
| - return this.deviceList_.filter(function(device) { |
| - return !!device.paired || !!device.connecting; |
| - }); |
| - }, |
| - |
| - /** |
| * @return {boolean} True if deviceList contains any paired devices. |
| * @private |
| */ |