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

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

Issue 2733463002: MD Bookmarks: Add basic page features to new data-flow system (Closed)
Patch Set: Rebase Created 3 years, 10 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_bookmarks/actions.js
diff --git a/chrome/browser/resources/md_bookmarks/actions.js b/chrome/browser/resources/md_bookmarks/actions.js
new file mode 100644
index 0000000000000000000000000000000000000000..6793084b62af2799a15cbaf0fdb2e89ea765298a
--- /dev/null
+++ b/chrome/browser/resources/md_bookmarks/actions.js
@@ -0,0 +1,81 @@
+// Copyright 2017 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+/**
+ * @fileoverview Module for functions which produce action objects. These are
+ * listed in one place to document available actions and their parameters.
+ */
+
+cr.define('bookmarks.actions', function() {
+ /**
+ * @param {string} id
+ * @param {{title: string, url: (string|undefined)}} changeInfo
+ * @return {!Action}
+ */
+ function editBookmark(id, changeInfo) {
+ return {
+ name: 'edit-bookmark',
+ id: id,
+ changeInfo: changeInfo,
+ };
+ }
+
+ /**
+ * @param {string} id
+ * @param {string} parentId
+ * @param {number} index
+ * @return {!Action}
+ */
+ function removeBookmark(id, parentId, index) {
+ return {
+ name: 'remove-bookmark',
+ id: id,
+ parentId: parentId,
+ index: index,
+ };
+ }
+
+ /**
+ * @param {NodeList} nodeMap
+ * @return {!Action}
+ */
+ function refreshNodes(nodeMap) {
+ return {
+ name: 'refresh-nodes',
+ nodes: nodeMap,
+ };
+ };
+
+ /**
+ * @param {string} id
+ * @return {!Action}
+ */
+ function selectFolder(id) {
+ return {
+ name: 'select-folder',
+ id: id,
+ };
+ }
+
+ /**
+ * @param {string} id
+ * @param {boolean} open
+ * @return {!Action}
+ */
+ function changeFolderOpen(id, open) {
+ return {
+ name: 'change-folder-open',
+ id: id,
+ open: open,
+ };
+ }
+
+ return {
+ editBookmark: editBookmark,
+ removeBookmark: removeBookmark,
+ refreshNodes: refreshNodes,
+ selectFolder: selectFolder,
+ changeFolderOpen: changeFolderOpen,
calamity 2017/03/07 07:27:35 nit: Sort? I don't feel super strongly.
tsergeant 2017/03/08 02:47:10 Done.
+ };
+});

Powered by Google App Engine
This is Rietveld 408576698