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

Unified Diff: chrome/browser/resources/settings/passwords_and_forms_page/passwords_and_forms_page.js

Issue 1591053002: Add a password handler to get the list of passwords in md-settings. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Nit: inline function Created 4 years, 11 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/passwords_and_forms_page/passwords_and_forms_page.js
diff --git a/chrome/browser/resources/settings/passwords_and_forms_page/passwords_and_forms_page.js b/chrome/browser/resources/settings/passwords_and_forms_page/passwords_and_forms_page.js
index b46e9fb3b2389df1a434bc8350d6d947227cd203..07b6ac1e75f96a3336f5c9de6b33aacaf87f7191 100644
--- a/chrome/browser/resources/settings/passwords_and_forms_page/passwords_and_forms_page.js
+++ b/chrome/browser/resources/settings/passwords_and_forms_page/passwords_and_forms_page.js
@@ -27,6 +27,7 @@ Polymer({
/**
* An array of passwords to display.
* Lazy loaded when the password section is expanded.
+ * @type {!Array<!chrome.passwordsPrivate.PasswordUiEntry>}
*/
savedPasswords: {
type: Array,
@@ -39,29 +40,16 @@ Polymer({
passwordsOpened: {
type: Boolean,
value: false,
- observer: 'loadPasswords_',
},
},
- /**
- * Called when the section is expanded. This will load the list of passwords
- * only when needed.
- * @param {boolean} passwordSectionOpened
- */
- loadPasswords_: function(passwordSectionOpened) {
- if (passwordSectionOpened) {
- // TODO(hcarmona): Get real data.
- this.savedPasswords =
- [{origin: 'otherwebsite.com',
- username: 'bowser',
- password: '************'},
- {origin: 'otherlongwebsite.com',
- username: 'koopa',
- password: '*********'},
- {origin: 'otherverylongwebsite.com',
- username: 'goomba',
- password: '******'}];
- }
+ /** @override */
+ ready: function() {
+ // Triggers a callback after the listener is added.
+ chrome.passwordsPrivate.onSavedPasswordsListChanged.addListener(
+ function(passwordList) {
+ this.savedPasswords = passwordList;
+ }.bind(this));
},
});
})();

Powered by Google App Engine
This is Rietveld 408576698