| 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 18 matching lines...) Expand all Loading... |
| 29 | 29 |
| 30 /** @private */ | 30 /** @private */ |
| 31 hasSearchText_: Boolean, | 31 hasSearchText_: Boolean, |
| 32 }, | 32 }, |
| 33 | 33 |
| 34 listeners: { | 34 listeners: { |
| 35 'tap': 'showSearch_', | 35 'tap': 'showSearch_', |
| 36 'searchInput.bind-value-changed': 'onBindValueChanged_', | 36 'searchInput.bind-value-changed': 'onBindValueChanged_', |
| 37 }, | 37 }, |
| 38 | 38 |
| 39 /** @return {!HTMLInputElement} */ |
| 40 getSearchInput: function() { |
| 41 return this.$.searchInput; |
| 42 }, |
| 43 |
| 44 /** @return {boolean} */ |
| 45 isSearchFocused: function() { |
| 46 return this.$.searchTerm.focused; |
| 47 }, |
| 48 |
| 39 /** | 49 /** |
| 40 * @param {boolean} narrow | 50 * @param {boolean} narrow |
| 41 * @return {number} | 51 * @return {number} |
| 42 * @private | 52 * @private |
| 43 */ | 53 */ |
| 44 computeIconTabIndex_: function(narrow) { | 54 computeIconTabIndex_: function(narrow) { |
| 45 return narrow ? 0 : -1; | 55 return narrow ? 0 : -1; |
| 46 }, | 56 }, |
| 47 | 57 |
| 48 /** | 58 /** |
| (...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 85 | 95 |
| 86 /** | 96 /** |
| 87 * @param {Event} e | 97 * @param {Event} e |
| 88 * @private | 98 * @private |
| 89 */ | 99 */ |
| 90 hideSearch_: function(e) { | 100 hideSearch_: function(e) { |
| 91 this.showingSearch = false; | 101 this.showingSearch = false; |
| 92 e.stopPropagation(); | 102 e.stopPropagation(); |
| 93 } | 103 } |
| 94 }); | 104 }); |
| OLD | NEW |