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

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

Issue 2750463010: [MD Bookmarks] Handle bookmark moves. (Closed)
Patch Set: remove log 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 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 {{title: string, url: (string|undefined)}} changeInfo 13 * @param {{title: string, url: (string|undefined)}} changeInfo
14 * @return {!Action} 14 * @return {!Action}
15 */ 15 */
16 function editBookmark(id, changeInfo) { 16 function editBookmark(id, changeInfo) {
17 return { 17 return {
18 name: 'edit-bookmark', 18 name: 'edit-bookmark',
19 id: id, 19 id: id,
20 changeInfo: changeInfo, 20 changeInfo: changeInfo,
21 }; 21 };
22 } 22 }
23 23
24 /** 24 /**
25 * @param {string} id 25 * @param {string} id
26 * @param {string} parentId 26 * @param {string} parentId
27 * @param {number} index 27 * @param {number} index
28 * @param {string} oldParentId
29 * @param {number} oldIndex
30 * @return {!Action}
31 */
32 function moveBookmark(id, parentId, index, oldParentId, oldIndex) {
33 return {
34 name: 'move-bookmark',
35 id: id,
36 parentId: parentId,
37 index: index,
38 oldParentId: oldParentId,
39 oldIndex: oldIndex,
40 };
41 }
42
43 /**
44 * @param {string} id
45 * @param {string} parentId
46 * @param {number} index
28 * @return {!Action} 47 * @return {!Action}
29 */ 48 */
30 function removeBookmark(id, parentId, index) { 49 function removeBookmark(id, parentId, index) {
31 return { 50 return {
32 name: 'remove-bookmark', 51 name: 'remove-bookmark',
33 id: id, 52 id: id,
34 parentId: parentId, 53 parentId: parentId,
35 index: index, 54 index: index,
36 }; 55 };
37 } 56 }
(...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after
139 return { 158 return {
140 name: 'finish-search', 159 name: 'finish-search',
141 results: ids, 160 results: ids,
142 }; 161 };
143 } 162 }
144 163
145 return { 164 return {
146 changeFolderOpen: changeFolderOpen, 165 changeFolderOpen: changeFolderOpen,
147 clearSearch: clearSearch, 166 clearSearch: clearSearch,
148 editBookmark: editBookmark, 167 editBookmark: editBookmark,
168 moveBookmark: moveBookmark,
149 refreshNodes: refreshNodes, 169 refreshNodes: refreshNodes,
150 removeBookmark: removeBookmark, 170 removeBookmark: removeBookmark,
151 selectFolder: selectFolder, 171 selectFolder: selectFolder,
152 selectItem: selectItem, 172 selectItem: selectItem,
153 setSearchResults: setSearchResults, 173 setSearchResults: setSearchResults,
154 setSearchTerm: setSearchTerm, 174 setSearchTerm: setSearchTerm,
155 }; 175 };
156 }); 176 });
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