| 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 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 86 | 86 |
| 87 /** | 87 /** |
| 88 * @param {NodeMap} nodeMap | 88 * @param {NodeMap} nodeMap |
| 89 * @return {!Action} | 89 * @return {!Action} |
| 90 */ | 90 */ |
| 91 function refreshNodes(nodeMap) { | 91 function refreshNodes(nodeMap) { |
| 92 return { | 92 return { |
| 93 name: 'refresh-nodes', | 93 name: 'refresh-nodes', |
| 94 nodes: nodeMap, | 94 nodes: nodeMap, |
| 95 }; | 95 }; |
| 96 }; | 96 } |
| 97 | 97 |
| 98 /** | 98 /** |
| 99 * @param {string} id | 99 * @param {string} id |
| 100 * @param {NodeMap} nodes Current node state. Can be ommitted in tests. | 100 * @param {NodeMap} nodes Current node state. Can be ommitted in tests. |
| 101 * @return {?Action} | 101 * @return {?Action} |
| 102 */ | 102 */ |
| 103 function selectFolder(id, nodes) { | 103 function selectFolder(id, nodes) { |
| 104 if (nodes && (id == ROOT_NODE_ID || !nodes[id] || nodes[id].url)) { | 104 if (nodes && (id == ROOT_NODE_ID || !nodes[id] || nodes[id].url)) { |
| 105 console.warn('Tried to select invalid folder: ' + id); | 105 console.warn('Tried to select invalid folder: ' + id); |
| 106 return null; | 106 return null; |
| (...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 224 moveBookmark: moveBookmark, | 224 moveBookmark: moveBookmark, |
| 225 refreshNodes: refreshNodes, | 225 refreshNodes: refreshNodes, |
| 226 removeBookmark: removeBookmark, | 226 removeBookmark: removeBookmark, |
| 227 reorderChildren: reorderChildren, | 227 reorderChildren: reorderChildren, |
| 228 selectFolder: selectFolder, | 228 selectFolder: selectFolder, |
| 229 selectItem: selectItem, | 229 selectItem: selectItem, |
| 230 setSearchResults: setSearchResults, | 230 setSearchResults: setSearchResults, |
| 231 setSearchTerm: setSearchTerm, | 231 setSearchTerm: setSearchTerm, |
| 232 }; | 232 }; |
| 233 }); | 233 }); |
| OLD | NEW |