Chromium Code Reviews| Index: chrome/browser/resources/print_preview/search/destination_list.js |
| diff --git a/chrome/browser/resources/print_preview/search/destination_list.js b/chrome/browser/resources/print_preview/search/destination_list.js |
| index 351d31184980cbe76ca4808d869d0e1ec89238c0..903831d9fca0782d1f69e3828eabc45ed51c0053 100644 |
| --- a/chrome/browser/resources/print_preview/search/destination_list.js |
| +++ b/chrome/browser/resources/print_preview/search/destination_list.js |
| @@ -225,6 +225,17 @@ cr.define('print_preview', function() { |
| }, |
| /** |
| + * @param {string} destinationId The ID of the destination. |
| + * @return {?print_preview.DestinationListItem} The found destination list |
| + * item or null if not found. |
| + */ |
| + getDestinationItem: function(destinationId) { |
| + return this.listItems_.find(function(listItem) { |
| + return listItem.destination.id == destinationId; |
| + }); |
|
dpapad
2017/03/30 20:56:23
find() returns undefined, if nothing is found, see
xdai1
2017/03/30 23:18:43
Thanks. Done.
|
| + }, |
| + |
| + /** |
| * @param {string} text Text to set the action link to. |
| * @protected |
| */ |