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

Unified Diff: chrome/browser/resources/settings/settings_page/settings_subpage_search.js

Issue 2092763004: [MD Settings] Implement search in material design passwords. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Feedback and Rebase 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 side-by-side diff with in-line comments
Download patch
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_;
},
});

Powered by Google App Engine
This is Rietveld 408576698