Chromium Code Reviews| Index: chrome/browser/resources/md_downloads/toolbar.js |
| diff --git a/chrome/browser/resources/md_downloads/toolbar.js b/chrome/browser/resources/md_downloads/toolbar.js |
| index c23364b3a9fcb446d468ea8711be89a81473d5ce..3bd53df84dde92d9bf7f83f47fe429450560f339 100644 |
| --- a/chrome/browser/resources/md_downloads/toolbar.js |
| +++ b/chrome/browser/resources/md_downloads/toolbar.js |
| @@ -9,10 +9,6 @@ cr.define('downloads', function() { |
| attached: function() { |
| // isRTL() only works after i18n_template.js runs to set <html dir>. |
| this.overflowAlign_ = isRTL() ? 'left' : 'right'; |
| - |
| - /** @private {!SearchFieldDelegate} */ |
| - this.searchFieldDelegate_ = new ToolbarSearchFieldDelegate(this); |
| - this.$['search-input'].setDelegate(this.searchFieldDelegate_); |
| }, |
| properties: { |
| @@ -54,9 +50,12 @@ cr.define('downloads', function() { |
| this.updateClearAll_(); |
| }, |
| - /** @param {string} searchTerm */ |
| - onSearchTermSearch: function(searchTerm) { |
| - downloads.ActionService.getInstance().search(searchTerm); |
| + /** |
| + * @param {!Event} event |
|
Dan Beam
2016/06/14 18:52:01
nit: CustomEvent
dpapad
2016/06/14 19:17:35
Done.
|
| + * @private |
| + */ |
| + onSearch_: function(event) { |
| + downloads.ActionService.getInstance().search(event.detail); |
| this.updateClearAll_(); |
| }, |
| @@ -72,24 +71,6 @@ cr.define('downloads', function() { |
| }, |
| }); |
| - /** |
| - * @constructor |
| - * @implements {SearchFieldDelegate} |
| - */ |
| - // TODO(devlin): This is a bit excessive, and it would be better to just have |
| - // Toolbar implement SearchFieldDelegate. But for now, we don't know how to |
| - // make that happen with closure compiler. |
| - function ToolbarSearchFieldDelegate(toolbar) { |
| - this.toolbar_ = toolbar; |
| - } |
| - |
| - ToolbarSearchFieldDelegate.prototype = { |
| - /** @override */ |
| - onSearchTermSearch: function(searchTerm) { |
| - this.toolbar_.onSearchTermSearch(searchTerm); |
| - } |
| - }; |
| - |
| return {Toolbar: Toolbar}; |
| }); |