| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 cr.define('downloads', function() { | 5 cr.define('downloads', function() { |
| 6 /** | 6 /** |
| 7 * @param {string} chromeSendName | 7 * @param {string} chromeSendName |
| 8 * @return {function(string):void} A chrome.send() callback with curried name. | 8 * @return {function(string):void} A chrome.send() callback with curried name. |
| 9 */ | 9 */ |
| 10 function chromeSendWithId(chromeSendName) { | 10 function chromeSendWithId(chromeSendName) { |
| (...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 72 | 72 |
| 73 // Split quoted terms (e.g., 'The "lazy" dog' => ['The', 'lazy', 'dog']). | 73 // Split quoted terms (e.g., 'The "lazy" dog' => ['The', 'lazy', 'dog']). |
| 74 function trim(s) { return s.trim(); } | 74 function trim(s) { return s.trim(); } |
| 75 chrome.send('getDownloads', searchText.split(/"([^"]*)"/).map(trim)); | 75 chrome.send('getDownloads', searchText.split(/"([^"]*)"/).map(trim)); |
| 76 }, | 76 }, |
| 77 | 77 |
| 78 /** | 78 /** |
| 79 * Shows the local folder a finished download resides in. | 79 * Shows the local folder a finished download resides in. |
| 80 * @param {string} id ID of the download to show. | 80 * @param {string} id ID of the download to show. |
| 81 */ | 81 */ |
| 82 show: chromeSendWithId('show'), | 82 showInFolder: chromeSendWithId('showInFolder'), |
| 83 | 83 |
| 84 /** Undo download removal. */ | 84 /** Undo download removal. */ |
| 85 undo: chrome.send.bind(chrome, 'undo'), | 85 undo: chrome.send.bind(chrome, 'undo'), |
| 86 }; | 86 }; |
| 87 | 87 |
| 88 return {ActionService: ActionService}; | 88 return {ActionService: ActionService}; |
| 89 }); | 89 }); |
| OLD | NEW |