| Index: ui/webui/resources/cr_elements/cr_toolbar/cr_toolbar_search_field.js
|
| diff --git a/ui/webui/resources/cr_elements/cr_toolbar/cr_toolbar_search_field.js b/ui/webui/resources/cr_elements/cr_toolbar/cr_toolbar_search_field.js
|
| index 3de204caa0e8a73008efac0bb36d4b15b9a4fbfb..6ebc105e84bca5c392fc6f530b257671deaa863d 100644
|
| --- a/ui/webui/resources/cr_elements/cr_toolbar/cr_toolbar_search_field.js
|
| +++ b/ui/webui/resources/cr_elements/cr_toolbar/cr_toolbar_search_field.js
|
| @@ -32,9 +32,6 @@ Polymer({
|
| spinnerActive: {type: Boolean, reflectToAttribute: true},
|
|
|
| /** @private */
|
| - hasSearchText_: {type: Boolean, reflectToAttribute: true},
|
| -
|
| - /** @private */
|
| isSpinnerShown_: {
|
| type: Boolean,
|
| computed: 'computeIsSpinnerShown_(spinnerActive, showingSearch)'
|
| @@ -54,17 +51,6 @@ Polymer({
|
| return this.$.searchInput;
|
| },
|
|
|
| - /**
|
| - * Sets the value of the search field. Overridden from CrSearchFieldBehavior.
|
| - * @param {string} value
|
| - * @param {boolean=} opt_noEvent Whether to prevent a 'search-changed' event
|
| - * firing for this change.
|
| - */
|
| - setValue: function(value, opt_noEvent) {
|
| - CrSearchFieldBehavior.setValue.call(this, value, opt_noEvent);
|
| - this.onSearchInput_();
|
| - },
|
| -
|
| /** @return {boolean} */
|
| isSearchFocused: function() {
|
| return this.searchFocused_;
|
| @@ -75,6 +61,11 @@ Polymer({
|
| this.focus_();
|
| },
|
|
|
| + onSearchTermInput: function() {
|
| + CrSearchFieldBehavior.onSearchTermInput.call(this);
|
| + this.showingSearch = this.hasSearchText || this.isSearchFocused();
|
| + },
|
| +
|
| /** @private */
|
| focus_: function() {
|
| this.getSearchInput().focus();
|
| @@ -105,23 +96,10 @@ Polymer({
|
| /** @private */
|
| onInputBlur_: function() {
|
| this.searchFocused_ = false;
|
| - if (!this.hasSearchText_)
|
| + if (!this.hasSearchText)
|
| this.showingSearch = false;
|
| },
|
|
|
| - /**
|
| - * Update the state of the search field whenever the underlying input value
|
| - * changes. Unlike onsearch or onkeypress, this is reliably called immediately
|
| - * after any change, whether the result of user input or JS modification.
|
| - * @private
|
| - */
|
| - onSearchInput_: function() {
|
| - var newValue = this.$.searchInput.value;
|
| - this.hasSearchText_ = newValue != '';
|
| - if (newValue != '')
|
| - this.showingSearch = true;
|
| - },
|
| -
|
| /** @private */
|
| onSearchTermKeydown_: function(e) {
|
| if (e.key == 'Escape')
|
|
|