Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(706)

Side by Side Diff: ui/webui/resources/cr_elements/cr_toolbar/cr_toolbar_search_field.js

Issue 2180843006: MD WebUI: Remove local DOM access from CrSearchFieldBehavior (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@cr_search_field_clear
Patch Set: Vulcanize Created 4 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « ui/webui/resources/cr_elements/cr_search_field/cr_search_field_behavior.js ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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 });
OLDNEW
« no previous file with comments | « ui/webui/resources/cr_elements/cr_search_field/cr_search_field_behavior.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698