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

Unified Diff: chrome/browser/resources/settings/passwords_and_forms_page/passwords_private_api.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: Feedback 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_private_api.js
diff --git a/chrome/browser/resources/settings/passwords_and_forms_page/passwords_private_api.js b/chrome/browser/resources/settings/passwords_and_forms_page/passwords_private_api.js
new file mode 100644
index 0000000000000000000000000000000000000000..27528ce29c281cdcdf3b80aee85b3a61c96048da
--- /dev/null
+++ b/chrome/browser/resources/settings/passwords_and_forms_page/passwords_private_api.js
@@ -0,0 +1,50 @@
+// Copyright 2016 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+cr.define('settings.PasswordsPrivateApi', function() {
+ /**
+ * Encapsulates the calls between JS and C++ to update the list of passwords.
+ * @param {function(!Array<!Object>)} passwordListCallback Called with the
+ * list of passwords.
+ * @param {function(!Array<!Object>)} exceptionListCallback Called with the
+ * list of exceptions.
+ */
+ updatePasswordLists = function(passwordListCallback,
michaelpg 2016/01/20 21:20:56 missing "var" here and elsewhere or, just "functio
hcarmona 2016/01/20 23:13:53 Done.
+ exceptionListCallback) {
+ settings.PasswordsPrivateApi.setSavedPasswordsList = passwordListCallback;
+ settings.PasswordsPrivateApi.setPasswordExceptionsList =
+ exceptionListCallback;
+ chrome.send('updatePasswordLists');
+ };
+
+ /**
+ * Callback for displaying a password.
+ * @param {number} index
+ * @param {string} password
+ */
+ showPassword = function(index, password) {
+ // TODO(hcarmona): Add function that will set this and call chrome.send to
+ // show the password when requested.
+ };
+
+ /**
+ * Callback for updating the list of passwords.
+ * @param {!Array<!Object>} passwordList The list of passwords that was
+ * retrieved by calling the private APIs.
+ */
+ setSavedPasswordsList = function(passwordList) {};
+
+
+ /**
+ * Callback for updating the list of site exceptions.
+ * @param {!Array<!Object>} exceptionList The list of sites that passwords
+ * will not be saved for.
+ */
+ setPasswordExceptionsList = function(exceptionList) {};
+
+ return { updatePasswordLists: updatePasswordLists,
+ showPassword: showPassword,
+ setSavedPasswordsList: setSavedPasswordsList,
+ setPasswordExceptionsList: setPasswordExceptionsList, };
+});

Powered by Google App Engine
This is Rietveld 408576698