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 175 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
186 clear: config.clear, | 186 clear: config.clear, |
187 toggle: config.toggle, | 187 toggle: config.toggle, |
188 anchor: newAnchor, | 188 anchor: newAnchor, |
189 items: toSelect, | 189 items: toSelect, |
190 }; | 190 }; |
191 } | 191 } |
192 | 192 |
193 /** | 193 /** |
194 * @param {Array<string>} ids | 194 * @param {Array<string>} ids |
195 * @param {BookmarksPageState} state | 195 * @param {BookmarksPageState} state |
| 196 * @param {string=} anchor |
196 * @return {!Action} | 197 * @return {!Action} |
197 */ | 198 */ |
198 function selectAll(ids, state) { | 199 function selectAll(ids, state, anchor) { |
199 return { | 200 return { |
200 name: 'select-items', | 201 name: 'select-items', |
201 clear: true, | 202 clear: true, |
202 toggle: false, | 203 toggle: false, |
203 anchor: state.selection.anchor, | 204 anchor: anchor ? anchor : state.selection.anchor, |
204 items: ids, | 205 items: ids, |
205 }; | 206 }; |
206 } | 207 } |
207 | 208 |
208 /** | 209 /** |
209 * @param {string} id | 210 * @param {string} id |
210 * @return {!Action} | 211 * @return {!Action} |
211 */ | 212 */ |
212 function updateAnchor(id) { | 213 function updateAnchor(id) { |
213 return { | 214 return { |
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
277 selectAll: selectAll, | 278 selectAll: selectAll, |
278 selectFolder: selectFolder, | 279 selectFolder: selectFolder, |
279 selectItem: selectItem, | 280 selectItem: selectItem, |
280 setCanEditBookmarks: setCanEditBookmarks, | 281 setCanEditBookmarks: setCanEditBookmarks, |
281 setIncognitoAvailability: setIncognitoAvailability, | 282 setIncognitoAvailability: setIncognitoAvailability, |
282 setSearchResults: setSearchResults, | 283 setSearchResults: setSearchResults, |
283 setSearchTerm: setSearchTerm, | 284 setSearchTerm: setSearchTerm, |
284 updateAnchor: updateAnchor, | 285 updateAnchor: updateAnchor, |
285 }; | 286 }; |
286 }); | 287 }); |
OLD | NEW |