Index: chrome/browser/resources/settings/settings_page/settings_subpage_search.js |
diff --git a/chrome/browser/resources/settings/settings_page/settings_subpage.js b/chrome/browser/resources/settings/settings_page/settings_subpage_search.js |
similarity index 50% |
copy from chrome/browser/resources/settings/settings_page/settings_subpage.js |
copy to chrome/browser/resources/settings/settings_page/settings_subpage_search.js |
index 397e89addb82ae525d02da1d5539b4da745a95d3..df67b174df2d3f20357674266657f257b66adb68 100644 |
--- a/chrome/browser/resources/settings/settings_page/settings_subpage.js |
+++ b/chrome/browser/resources/settings/settings_page/settings_subpage_search.js |
@@ -10,21 +10,25 @@ |
*/ |
Polymer({ |
- is: 'settings-subpage', |
+ is: 'settings-subpage-search', |
- behaviors: [ |
- // TODO(michaelpg): phase out NeonAnimatableBehavior. |
- Polymer.NeonAnimatableBehavior, |
- Polymer.IronResizableBehavior, |
- ], |
+ behaviors: [CrSearchFieldBehavior], |
- properties: { |
- pageTitle: String, |
+ /** @private */ |
+ onTapClear_: function() { |
+ this.$.searchInput.value = ''; |
dpapad
2016/07/20 19:34:51
Can we avoid having to fire any events manually by
hcarmona
2016/07/20 21:06:07
Done.
|
+ |
+ // Fire events to update the UI. These are fired when the user changes the |
+ // input, but not when value is set. |
+ this.$.searchInput.fire('input'); |
+ this.$.searchInput.fire('search'); |
}, |
- /** @private */ |
- onTapBack_: function() { |
- // Event is caught by settings-animated-pages. |
- this.fire('subpage-back'); |
+ /** |
+ * @param {string} lastValue_ |
dpapad
2016/07/20 19:34:51
Nit: Parameter names don't usually have underscore
hcarmona
2016/07/20 21:06:07
On second look, this entire method is unnecessary,
|
+ * @return {boolean} |
+ */ |
+ hasSearchTerm_: function(lastValue_) { |
+ return !!lastValue_; |
}, |
}); |