Chromium Code Reviews| Index: chrome/browser/resources/md_downloads/action_service.js |
| diff --git a/chrome/browser/resources/md_downloads/action_service.js b/chrome/browser/resources/md_downloads/action_service.js |
| index ee0a1b4a9fdc7384cfca8c7a120ddc7f6f18bf3b..e46350ce9faa468340ff02fa2eb45dc304c616bc 100644 |
| --- a/chrome/browser/resources/md_downloads/action_service.js |
| +++ b/chrome/browser/resources/md_downloads/action_service.js |
| @@ -61,15 +61,17 @@ cr.define('downloads', function() { |
| /** @param {string} id ID of the download that the user started dragging. */ |
| drag: chromeSendWithId('drag'), |
| - /** @private {boolean} */ |
| - isSearching_: false, |
| + /** Loads more downloads with the current search terms. */ |
| + loadMore: function() { |
| + chrome.send('getDownloads', this.searchTerms_); |
| + }, |
| /** |
| * @return {boolean} Whether the user is currently searching for downloads |
| * (i.e. has a non-empty search term). |
| */ |
| isSearching: function() { |
| - return this.isSearching_; |
| + return this.searchTerms_.length > 0; |
| }, |
| /** Opens the current local destination for downloads. */ |
| @@ -101,12 +103,15 @@ cr.define('downloads', function() { |
| return; |
| this.searchText_ = searchText; |
| + this.searchTerms_ = ActionService.splitTerms(this.searchText_); |
| + this.loadMore(); |
| + }, |
| - var terms = ActionService.splitTerms(searchText); |
| - this.isSearching_ = terms.length > 0; |
| + /** @private {Array<string>} */ |
| + searchTerms_: [], |
| - chrome.send('getDownloads', terms); |
| - }, |
| + /** @private {string} */ |
| + searchText_: '', |
|
asanka
2015/12/07 20:31:50
Why do you keep this around?
asanka
2015/12/08 17:50:31
To clarity, I meant: "Isn't this redundant since w
Dan Beam
2015/12/09 06:55:21
Done.
|
| /** |
| * Shows the local folder a finished download resides in. |