| 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 35054c2c1ce4ede61e2d090f91b7aac4b6588d5f..c4c883fae65d1a566595358b1999d6ab189b031b 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,7 +239,15 @@ Polymer({
|
|
|
| /** @private */
|
| deviceListChanged_: function() {
|
| - for (let device of this.deviceList_) {
|
| + var devices = this.$.devices;
|
| + this.saveScroll(devices);
|
| + this.pairedDeviceList_ = this.deviceList_.filter(function(device) {
|
| + return !!device.paired || !!device.connecting;
|
| + });
|
| + this.updateScrollableContents();
|
| + this.restoreScroll(devices);
|
| +
|
| + for (let device of this.pairedDeviceList_) {
|
| if (device.connected) {
|
| this.deviceConnected_ = true;
|
| return;
|
| @@ -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
|
| */
|
|
|