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

Unified Diff: chrome/browser/resources/md_bookmarks/actions.js

Issue 2740863003: MD Bookmarks: Implement search and selection in new data flow system (Closed)
Patch Set: Review round 2 Created 3 years, 9 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_bookmarks/app.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/resources/md_bookmarks/actions.js
diff --git a/chrome/browser/resources/md_bookmarks/actions.js b/chrome/browser/resources/md_bookmarks/actions.js
index 1ff0eaaeb410d48e81dab4ded48d2daabf53d213..7ed4cfc4f6a9545fdd8dc7d60b01a46726d7d5b8 100644
--- a/chrome/browser/resources/md_bookmarks/actions.js
+++ b/chrome/browser/resources/md_bookmarks/actions.js
@@ -52,6 +52,7 @@ cr.define('bookmarks.actions', function() {
* @return {!Action}
*/
function selectFolder(id) {
+ assert(id != '0', 'Cannot select root folder');
return {
name: 'select-folder',
id: id,
@@ -71,11 +72,46 @@ cr.define('bookmarks.actions', function() {
};
}
+ /** @return {!Action} */
+ function clearSearch() {
+ return {
+ name: 'clear-search',
+ };
+ }
+
+ /**
+ * @param {string} term
+ * @return {!Action}
+ */
+ function setSearchTerm(term) {
+ if (!term)
+ return clearSearch();
+
+ return {
+ name: 'start-search',
+ term: term,
+ };
+ }
+
+ /**
+ * @param {!Array<string>} ids
+ * @return {!Action}
+ */
+ function setSearchResults(ids) {
+ return {
+ name: 'finish-search',
+ results: ids,
+ };
+ }
+
return {
changeFolderOpen: changeFolderOpen,
+ clearSearch: clearSearch,
editBookmark: editBookmark,
refreshNodes: refreshNodes,
removeBookmark: removeBookmark,
selectFolder: selectFolder,
+ setSearchResults: setSearchResults,
+ setSearchTerm: setSearchTerm,
};
});
« no previous file with comments | « no previous file | chrome/browser/resources/md_bookmarks/app.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698