Chromium Code Reviews| Index: chrome/browser/resources/md_history/synced_device_manager.js |
| diff --git a/chrome/browser/resources/md_history/synced_device_manager.js b/chrome/browser/resources/md_history/synced_device_manager.js |
| index 476d8a2129f13531021b58ada2f06bdbf8607e14..3d0b77dff2477bd6db6f7bd2f6dfb8720b036aa5 100644 |
| --- a/chrome/browser/resources/md_history/synced_device_manager.js |
| +++ b/chrome/browser/resources/md_history/synced_device_manager.js |
| @@ -204,12 +204,13 @@ Polymer({ |
| /** |
| * Decide what message should be displayed when user is logged in and there |
| * are no synced tabs. |
| - * @param {boolean} fetchingSyncedTabs |
| * @return {string} |
| */ |
| - noSyncedTabsMessage: function(fetchingSyncedTabs) { |
| - return loadTimeData.getString( |
| - fetchingSyncedTabs ? 'loading' : 'noSyncedResults'); |
| + noSyncedTabsMessage: function() { |
| + var stringName = this.fetchingSyncedTabs_ ? 'loading' : 'noSyncedResults'; |
| + if (this.searchTerm !== '') |
| + stringName = 'noSearchResults'; |
| + return loadTimeData.getString(stringName); |
| }, |
| /** |
| @@ -239,15 +240,18 @@ Polymer({ |
| var oldDevice = this.syncedDevices_[i]; |
| if (oldDevice.tag != sessionList[i].tag || |
| oldDevice.timestamp != sessionList[i].timestamp) { |
| - this.splice( |
| - 'syncedDevices_', i, 1, this.createInternalDevice_(sessionList[i])); |
| + device = this.createInternalDevice_(sessionList[i]); |
|
tsergeant
2016/09/22 06:58:50
Nit: Add `var`
calamity
2016/09/22 07:52:53
Done.
|
| + if (device.tabs.length != 0) |
| + this.splice('syncedDevices_', i, 1, device); |
| } |
| } |
| if (sessionList.length >= this.syncedDevices_.length) { |
| // The list grew; append new items. |
| for (var i = updateCount; i < sessionList.length; i++) { |
| - this.push('syncedDevices_', this.createInternalDevice_(sessionList[i])); |
| + device = this.createInternalDevice_(sessionList[i]); |
|
tsergeant
2016/09/22 06:58:50
Nit: Here too
(or declare `var device;` at the to
calamity
2016/09/22 07:52:53
Done.
|
| + if (device.tabs.length != 0) |
| + this.push('syncedDevices_', device); |
| } |
| } else { |
| // The list shrank; remove deleted items. |