| 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 /** @interface */ | 5 /** @interface */ |
| 6 var SearchFieldDelegate = function() {}; | 6 var SearchFieldDelegate = function() {}; |
| 7 | 7 |
| 8 SearchFieldDelegate.prototype = { | 8 SearchFieldDelegate.prototype = { |
| 9 /** | 9 /** |
| 10 * @param {string} value | 10 * @param {string} value |
| (...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 58 if (!this.showingSearch_) | 58 if (!this.showingSearch_) |
| 59 return; | 59 return; |
| 60 | 60 |
| 61 var searchInput = this.getSearchInput_(); | 61 var searchInput = this.getSearchInput_(); |
| 62 if (searchInput) | 62 if (searchInput) |
| 63 searchInput.focus(); | 63 searchInput.focus(); |
| 64 }); | 64 }); |
| 65 }, | 65 }, |
| 66 | 66 |
| 67 /** | 67 /** |
| 68 * @return {?HTMLElement} | 68 * @return {?Element} |
| 69 * @private | 69 * @private |
| 70 */ | 70 */ |
| 71 getSearchInput_: function() { | 71 getSearchInput_: function() { |
| 72 return this.$$('#search-input'); | 72 return this.$$('#search-input'); |
| 73 }, | 73 }, |
| 74 | 74 |
| 75 /** @private */ | 75 /** @private */ |
| 76 onSearchTermSearch_: function() { | 76 onSearchTermSearch_: function() { |
| 77 if (this.delegate_) | 77 if (this.delegate_) |
| 78 this.delegate_.onSearchTermSearch(this.getValue()); | 78 this.delegate_.onSearchTermSearch(this.getValue()); |
| (...skipping 18 matching lines...) Expand all Loading... |
| 97 | 97 |
| 98 searchInput.value = ''; | 98 searchInput.value = ''; |
| 99 this.onSearchTermSearch_(); | 99 this.onSearchTermSearch_(); |
| 100 }, | 100 }, |
| 101 | 101 |
| 102 /** @private */ | 102 /** @private */ |
| 103 toggleShowingSearch_: function() { | 103 toggleShowingSearch_: function() { |
| 104 this.showingSearch_ = !this.showingSearch_; | 104 this.showingSearch_ = !this.showingSearch_; |
| 105 }, | 105 }, |
| 106 }); | 106 }); |
| OLD | NEW |