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

Side by Side Diff: chrome/browser/resources/md_bookmarks/actions.js

Issue 2795623002: MD Bookmarks: Handle bookmark creation (Closed)
Patch Set: Update test Created 3 years, 8 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 unified diff | Download patch
« no previous file with comments | « no previous file | chrome/browser/resources/md_bookmarks/api_listener.js » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2017 The Chromium Authors. All rights reserved. 1 // Copyright 2017 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 /** 5 /**
6 * @fileoverview Module for functions which produce action objects. These are 6 * @fileoverview Module for functions which produce action objects. These are
7 * listed in one place to document available actions and their parameters. 7 * listed in one place to document available actions and their parameters.
8 */ 8 */
9 9
10 cr.define('bookmarks.actions', function() { 10 cr.define('bookmarks.actions', function() {
11 /** 11 /**
12 * @param {string} id 12 * @param {string} id
13 * @param {BookmarkTreeNode} treeNode
14 */
15 function createBookmark(id, treeNode) {
16 return {
17 name: 'create-bookmark',
18 id: id,
19 parentId: treeNode.parentId,
20 parentIndex: treeNode.index,
21 node: bookmarks.util.normalizeNode(treeNode),
22 };
23 }
24
25 /**
26 * @param {string} id
13 * @param {{title: string, url: (string|undefined)}} changeInfo 27 * @param {{title: string, url: (string|undefined)}} changeInfo
14 * @return {!Action} 28 * @return {!Action}
15 */ 29 */
16 function editBookmark(id, changeInfo) { 30 function editBookmark(id, changeInfo) {
17 return { 31 return {
18 name: 'edit-bookmark', 32 name: 'edit-bookmark',
19 id: id, 33 id: id,
20 changeInfo: changeInfo, 34 changeInfo: changeInfo,
21 }; 35 };
22 } 36 }
(...skipping 141 matching lines...) Expand 10 before | Expand all | Expand 10 after
164 function setSearchResults(ids) { 178 function setSearchResults(ids) {
165 return { 179 return {
166 name: 'finish-search', 180 name: 'finish-search',
167 results: ids, 181 results: ids,
168 }; 182 };
169 } 183 }
170 184
171 return { 185 return {
172 changeFolderOpen: changeFolderOpen, 186 changeFolderOpen: changeFolderOpen,
173 clearSearch: clearSearch, 187 clearSearch: clearSearch,
188 createBookmark: createBookmark,
174 deselectItems: deselectItems, 189 deselectItems: deselectItems,
175 editBookmark: editBookmark, 190 editBookmark: editBookmark,
176 moveBookmark: moveBookmark, 191 moveBookmark: moveBookmark,
177 refreshNodes: refreshNodes, 192 refreshNodes: refreshNodes,
178 removeBookmark: removeBookmark, 193 removeBookmark: removeBookmark,
179 selectFolder: selectFolder, 194 selectFolder: selectFolder,
180 selectItem: selectItem, 195 selectItem: selectItem,
181 setSearchResults: setSearchResults, 196 setSearchResults: setSearchResults,
182 setSearchTerm: setSearchTerm, 197 setSearchTerm: setSearchTerm,
183 }; 198 };
184 }); 199 });
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/resources/md_bookmarks/api_listener.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698