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

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

Issue 2015463003: Add dialog to edit and save credit cards. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 7 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 d38235f03cc5fe51c68c306687d8e6c69ee1ec4d..af46188480ceed05488681f3521eb510e1234db1 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
@@ -71,7 +71,7 @@ PasswordManager.prototype = {
/**
* Should remove the password exception and notify that the list has changed.
- * @param {!string} exception The exception that should be removed from the
+ * @param {string} exception The exception that should be removed from the
* list. No-op if |exception| is not in the list.
*/
removeException: assertNotReached,
@@ -133,6 +133,12 @@ AutofillManager.prototype = {
* @param {function(!Array<!AutofillManager.CreditCardEntry>):void} callback
*/
getCreditCardList: assertNotReached,
+
+ /**
+ * Saves the given credit card.
+ * @param {!AutofillManager.CreditCardEntry} creditCard
+ */
+ saveCreditCard: assertNotReached,
};
/**
@@ -245,6 +251,11 @@ AutofillManagerImpl.prototype = {
getCreditCardList: function(callback) {
chrome.autofillPrivate.getCreditCardList(callback);
},
+
+ /** @override */
+ saveCreditCard: function(creditCard) {
+ chrome.autofillPrivate.saveCreditCard(creditCard);
+ }
};
(function() {
@@ -306,6 +317,7 @@ Polymer({
listeners: {
'remove-password-exception': 'removePasswordException_',
'remove-saved-password': 'removeSavedPassword_',
+ 'save-credit-card': 'saveCreditCard_',
'show-password': 'showPassword_',
},
@@ -419,6 +431,15 @@ Polymer({
},
/**
+ * Listens for the save-credit-card event, and calls the private API.
+ * @param {!Event} event
+ * @private
+ */
+ saveCreditCard_: function(event) {
+ this.autofillManager_.saveCreditCard(event.detail);
+ },
+
+ /**
* Listens for the show-password event, and calls the private API.
* @param {!Event} event
* @private

Powered by Google App Engine
This is Rietveld 408576698