Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(36)

Unified Diff: chrome/browser/resources/md_history/lazy_load.crisper.js

Issue 2360193002: [MD History] Hide empty synced device cards. (Closed)
Patch Set: rebase Created 4 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | chrome/browser/resources/md_history/lazy_load.vulcanized.html » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/resources/md_history/lazy_load.crisper.js
diff --git a/chrome/browser/resources/md_history/lazy_load.crisper.js b/chrome/browser/resources/md_history/lazy_load.crisper.js
index 29502b017090db42b4004999cd9ec846036c4f53..cc06fa300f274e71fb8b928189b8f69d2adef879 100644
--- a/chrome/browser/resources/md_history/lazy_load.crisper.js
+++ b/chrome/browser/resources/md_history/lazy_load.crisper.js
@@ -2214,8 +2214,10 @@ Polymer({
}
return show;
},
- 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);
},
updateSyncedDevices: function(sessionList) {
this.fetchingSyncedTabs_ = false;
@@ -2228,12 +2230,14 @@ Polymer({
for (var i = 0; i < updateCount; i++) {
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]));
+ var device = this.createInternalDevice_(sessionList[i]);
+ if (device.tabs.length != 0) this.splice('syncedDevices_', i, 1, device);
}
}
if (sessionList.length >= this.syncedDevices_.length) {
for (var i = updateCount; i < sessionList.length; i++) {
- this.push('syncedDevices_', this.createInternalDevice_(sessionList[i]));
+ var device = this.createInternalDevice_(sessionList[i]);
+ if (device.tabs.length != 0) this.push('syncedDevices_', device);
}
} else {
this.splice('syncedDevices_', updateCount, this.syncedDevices_.length - updateCount);
« no previous file with comments | « no previous file | chrome/browser/resources/md_history/lazy_load.vulcanized.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698