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

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

Issue 2092763004: [MD Settings] Implement search in material design passwords. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Update to better match mocks 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.js
diff --git a/chrome/browser/resources/settings/settings_page/settings_subpage.js b/chrome/browser/resources/settings/settings_page/settings_subpage.js
index 397e89addb82ae525d02da1d5539b4da745a95d3..3c21604ecf65c62b21e59027ebf5675e2a6931a9 100644
--- a/chrome/browser/resources/settings/settings_page/settings_subpage.js
+++ b/chrome/browser/resources/settings/settings_page/settings_subpage.js
@@ -20,6 +20,18 @@ Polymer({
properties: {
pageTitle: String,
+
+ /** Setting a |searchLabel| will enable search. */
+ searchLabel: {
+ type: String,
+ observer: 'onSearchLabelSet_',
+ },
+
+ searchTerm: {
+ type: String,
+ notify: true,
+ value: '',
+ },
},
/** @private */
@@ -27,4 +39,35 @@ Polymer({
// Event is caught by settings-animated-pages.
this.fire('subpage-back');
},
+
+ /** @private */
+ onTapClear_: function() {
+ this.$.searchInput.value = '';
+
+ // 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 */
+ onSearchTermSearch_: function() {
+ this.searchTerm = this.$.searchInput.value;
+ },
+
+ /**
+ * @param {string} searchTerm
+ * @return {boolean}
+ */
+ hasSearchTerm_: function(searchTerm) {
+ return !!searchTerm;
+ },
+
+ /**
+ * Shows the search container when a search label is set.
+ * @param {string} searchLabel
+ */
+ onSearchLabelSet_: function(searchLabel) {
+ this.$.searchContainer.hidden = !searchLabel;
+ },
});

Powered by Google App Engine
This is Rietveld 408576698