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 2733463002: MD Bookmarks: Add basic page features to new data-flow system (Closed)
Patch Set: calamity@ review 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
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..1ff0eaaeb410d48e81dab4ded48d2daabf53d213
--- /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 {
+ changeFolderOpen: changeFolderOpen,
+ editBookmark: editBookmark,
+ refreshNodes: refreshNodes,
+ removeBookmark: removeBookmark,
+ selectFolder: selectFolder,
+ };
+});

Powered by Google App Engine
This is Rietveld 408576698