| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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 // TODO(tsergeant): Add tests for cr-toolbar-search-field. | 5 // TODO(tsergeant): Add tests for cr-toolbar-search-field. |
| 6 Polymer({ | 6 Polymer({ |
| 7 is: 'cr-toolbar-search-field', | 7 is: 'cr-toolbar-search-field', |
| 8 | 8 |
| 9 behaviors: [CrSearchFieldBehavior], | 9 behaviors: [CrSearchFieldBehavior], |
| 10 | 10 |
| (...skipping 29 matching lines...) Expand all Loading... |
| 40 }, | 40 }, |
| 41 | 41 |
| 42 /** @private */ | 42 /** @private */ |
| 43 searchFocused_: { | 43 searchFocused_: { |
| 44 type: Boolean, | 44 type: Boolean, |
| 45 value: false | 45 value: false |
| 46 }, | 46 }, |
| 47 }, | 47 }, |
| 48 | 48 |
| 49 listeners: { | 49 listeners: { |
| 50 'tap': 'showSearch_', | 50 // Deliberately uses 'click' instead of 'tap' to fix crbug.com/624356. |
| 51 'click': 'showSearch_', |
| 51 }, | 52 }, |
| 52 | 53 |
| 53 /** @return {!HTMLInputElement} */ | 54 /** @return {!HTMLInputElement} */ |
| 54 getSearchInput: function() { | 55 getSearchInput: function() { |
| 55 return this.$.searchInput; | 56 return this.$.searchInput; |
| 56 }, | 57 }, |
| 57 | 58 |
| 58 /** | 59 /** |
| 59 * Sets the value of the search field. Overridden from CrSearchFieldBehavior. | 60 * Sets the value of the search field. Overridden from CrSearchFieldBehavior. |
| 60 * @param {string} value | 61 * @param {string} value |
| (...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 124 | 125 |
| 125 /** | 126 /** |
| 126 * @param {Event} e | 127 * @param {Event} e |
| 127 * @private | 128 * @private |
| 128 */ | 129 */ |
| 129 clearSearch_: function(e) { | 130 clearSearch_: function(e) { |
| 130 this.setValue(''); | 131 this.setValue(''); |
| 131 this.getSearchInput().focus(); | 132 this.getSearchInput().focus(); |
| 132 } | 133 } |
| 133 }); | 134 }); |
| OLD | NEW |