| OLD | NEW |
| 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() { |
| (...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 49 id: id, | 49 id: id, |
| 50 parentId: parentId, | 50 parentId: parentId, |
| 51 index: index, | 51 index: index, |
| 52 oldParentId: oldParentId, | 52 oldParentId: oldParentId, |
| 53 oldIndex: oldIndex, | 53 oldIndex: oldIndex, |
| 54 }; | 54 }; |
| 55 } | 55 } |
| 56 | 56 |
| 57 /** | 57 /** |
| 58 * @param {string} id | 58 * @param {string} id |
| 59 * @param {!Array<string>} newChildIds |
| 60 */ |
| 61 function reorderChildren(id, newChildIds) { |
| 62 return { |
| 63 name: 'reorder-children', |
| 64 id: id, |
| 65 children: newChildIds, |
| 66 }; |
| 67 } |
| 68 |
| 69 /** |
| 70 * @param {string} id |
| 59 * @param {string} parentId | 71 * @param {string} parentId |
| 60 * @param {number} index | 72 * @param {number} index |
| 61 * @param {NodeList} nodes | 73 * @param {NodeList} nodes |
| 62 * @return {!Action} | 74 * @return {!Action} |
| 63 */ | 75 */ |
| 64 function removeBookmark(id, parentId, index, nodes) { | 76 function removeBookmark(id, parentId, index, nodes) { |
| 65 var descendants = bookmarks.util.getDescendants(nodes, id); | 77 var descendants = bookmarks.util.getDescendants(nodes, id); |
| 66 return { | 78 return { |
| 67 name: 'remove-bookmark', | 79 name: 'remove-bookmark', |
| 68 id: id, | 80 id: id, |
| (...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 187 | 199 |
| 188 return { | 200 return { |
| 189 changeFolderOpen: changeFolderOpen, | 201 changeFolderOpen: changeFolderOpen, |
| 190 clearSearch: clearSearch, | 202 clearSearch: clearSearch, |
| 191 createBookmark: createBookmark, | 203 createBookmark: createBookmark, |
| 192 deselectItems: deselectItems, | 204 deselectItems: deselectItems, |
| 193 editBookmark: editBookmark, | 205 editBookmark: editBookmark, |
| 194 moveBookmark: moveBookmark, | 206 moveBookmark: moveBookmark, |
| 195 refreshNodes: refreshNodes, | 207 refreshNodes: refreshNodes, |
| 196 removeBookmark: removeBookmark, | 208 removeBookmark: removeBookmark, |
| 209 reorderChildren: reorderChildren, |
| 197 selectFolder: selectFolder, | 210 selectFolder: selectFolder, |
| 198 selectItem: selectItem, | 211 selectItem: selectItem, |
| 199 setSearchResults: setSearchResults, | 212 setSearchResults: setSearchResults, |
| 200 setSearchTerm: setSearchTerm, | 213 setSearchTerm: setSearchTerm, |
| 201 }; | 214 }; |
| 202 }); | 215 }); |
| OLD | NEW |