Chromium Code Reviews| Index: chrome/browser/resources/options/extension_list.js |
| =================================================================== |
| --- chrome/browser/resources/options/extension_list.js (revision 105946) |
| +++ chrome/browser/resources/options/extension_list.js (working copy) |
| @@ -59,12 +59,11 @@ |
| toggleSection.classList.add('dev-closed'); |
| } |
| - // Install handler for key presses. |
| + // Install handler for search changes. |
| if (!handleInstalled) { |
| - this.ownerDocument.addEventListener('keyup', |
| - this.upEventHandler_.bind(this)); |
| - this.ownerDocument.addEventListener('mouseup', |
| - this.upEventHandler_.bind(this)); |
| + var searchPage = SearchPage.getInstance(); |
| + searchPage.addEventListener('searchChanged', |
| + this.searchChangedHandler_.bind(this)); |
|
Finnur
2011/10/20 10:00:59
Ooh, me like.
|
| handleInstalled = true; |
| } |
| }, |
| @@ -594,18 +593,18 @@ |
| }, |
| /** |
| - * Handles the mouse-up and keyboard-up events. This is used to limit the |
| - * number of items to show in the list, when the user is searching for items |
| - * with the search box. Otherwise, if one match is found, the whole list of |
| + * Handles the 'searchChanged' event. This is used to limit the number of |
| + * items to show in the list, when the user is searching for items with the |
| + * search box. Otherwise, if one match is found, the whole list of |
| * extensions would be shown when we only want the matching items to be |
| * found. |
| * @param {Event} e Change event. |
| * @private |
| */ |
| - upEventHandler_: function(e) { |
| - var searchString = $('search-field').value.toLowerCase(); |
| + searchChangedHandler_: function(e) { |
| + var searchString = e.searchText; |
| var child = this.firstChild; |
| - while (child){ |
| + while (child) { |
| var extension = this.getExtensionWithId_(child.id); |
| if (searchString.length == 0) { |
| // Show all. |