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

Unified Diff: chrome/browser/resources/md_extensions/item_list.js

Issue 2974583003: MD Extensions: Show messages for no extensions, and for no search results (Closed)
Patch Set: add md_extensions_strings.grdp=* in OWNER Created 3 years, 5 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
Index: chrome/browser/resources/md_extensions/item_list.js
diff --git a/chrome/browser/resources/md_extensions/item_list.js b/chrome/browser/resources/md_extensions/item_list.js
index 109feeb337010a5799fe1b28548e582c9e6fbe60..a545b82e4c3786501e2bf6e3e96d06537aaa791b 100644
--- a/chrome/browser/resources/md_extensions/item_list.js
+++ b/chrome/browser/resources/md_extensions/item_list.js
@@ -21,6 +21,12 @@ cr.define('extensions', function() {
},
filter: String,
+
+ /** @private {Array<!chrome.developerPrivate.ExtensionInfo>} */
+ shownItems_: {
+ type: Array,
+ computed: 'computeShownItems_(items.*, filter)',
+ }
},
listeners: {
@@ -73,6 +79,15 @@ cr.define('extensions', function() {
return item.name.toLowerCase().includes(this.filter.toLowerCase());
}, this);
},
+
+ shouldShowEmptyItemsMessage_: function() {
+ return this.items.length === 0;
+ },
+
+ shouldShowEmptySearchMessage_: function() {
+ return !this.shouldShowEmptyItemsMessage_() &&
+ this.shownItems_.length === 0;
+ },
});
return {
« no previous file with comments | « chrome/browser/resources/md_extensions/item_list.html ('k') | chrome/browser/resources/md_extensions/manager.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698