| Index: chrome/browser/resources/settings/passwords_and_forms_page/passwords_section.js
|
| diff --git a/chrome/browser/resources/settings/passwords_and_forms_page/passwords_section.js b/chrome/browser/resources/settings/passwords_and_forms_page/passwords_section.js
|
| index cecb4a55d5a33c2cd7d0857af52609fc3c155ab2..42344e69b78952d335ef3a24fd5489a97ae1f5c3 100644
|
| --- a/chrome/browser/resources/settings/passwords_and_forms_page/passwords_section.js
|
| +++ b/chrome/browser/resources/settings/passwords_and_forms_page/passwords_section.js
|
| @@ -53,6 +53,12 @@ Polymer({
|
| * @private {?chrome.passwordsPrivate.PasswordUiEntry}
|
| */
|
| activePassword: Object,
|
| +
|
| + /** Filter on the saved passwords and exceptions. */
|
| + filter: {
|
| + type: String,
|
| + value: '',
|
| + },
|
| },
|
|
|
| listeners: {
|
| @@ -91,6 +97,37 @@ Polymer({
|
| },
|
|
|
| /**
|
| + * @param {!Array<!chrome.passwordsPrivate.PasswordUiEntry>} savedPasswords
|
| + * @param {string} filter
|
| + * @return {!Array<!chrome.passwordsPrivate.PasswordUiEntry>}
|
| + * @private
|
| + */
|
| + getFilteredPasswords_: function(savedPasswords, filter) {
|
| + if (!filter)
|
| + return savedPasswords;
|
| +
|
| + return savedPasswords.filter(function(password) {
|
| + return password.loginPair.originUrl.includes(filter) ||
|
| + password.loginPair.username.includes(filter);
|
| + });
|
| + },
|
| +
|
| + /**
|
| + * @param {!Array<!chrome.passwordsPrivate.ExceptionPair>} passwordExceptions
|
| + * @param {string} filter
|
| + * @return {!Array<!chrome.passwordsPrivate.ExceptionPair>}
|
| + * @private
|
| + */
|
| + getFilteredExceptions_: function(passwordExceptions, filter) {
|
| + if (!filter)
|
| + return passwordExceptions;
|
| +
|
| + return passwordExceptions.filter(function(exception) {
|
| + return exception.exceptionUrl.includes(filter);
|
| + });
|
| + },
|
| +
|
| + /**
|
| * Fires an event that should delete the saved password.
|
| * @private
|
| */
|
|
|