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

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

Issue 2008273003: Saved addresses and credit cards can be removed from md-settings. (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
« no previous file with comments | « chrome/browser/resources/settings/passwords_and_forms_page/autofill_section.js ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..bc1045dcff8c8bb1538d4a412ed87c73e73ddb97 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
@@ -116,6 +116,9 @@ AutofillManager.prototype = {
*/
getAddressList: assertNotReached,
+ /** @param {!AutofillManager.AddressEntry} address The address to remove. */
+ removeAddress: assertNotReached,
+
/**
* Add an observer to the list of credit cards.
* @param {function(!Array<!AutofillManager.CreditCardEntry>):void} listener
@@ -133,6 +136,12 @@ AutofillManager.prototype = {
* @param {function(!Array<!AutofillManager.CreditCardEntry>):void} callback
*/
getCreditCardList: assertNotReached,
+
+ /**
+ * @param {!AutofillManager.CreditCardEntry} creditCard The credit card to
+ * remove.
+ */
+ removeCreditCard: assertNotReached,
};
/**
@@ -232,6 +241,11 @@ AutofillManagerImpl.prototype = {
},
/** @override */
+ removeAddress: function(address) {
+ chrome.autofillPrivate.removeEntry(/** @type {string} */(address.guid));
+ },
+
+ /** @override */
addCreditCardListChangedListener: function(listener) {
chrome.autofillPrivate.onCreditCardListChanged.addListener(listener);
},
@@ -245,6 +259,11 @@ AutofillManagerImpl.prototype = {
getCreditCardList: function(callback) {
chrome.autofillPrivate.getCreditCardList(callback);
},
+
+ /** @override */
+ removeCreditCard: function(creditCard) {
+ chrome.autofillPrivate.removeEntry(/** @type {string} */(creditCard.guid));
+ },
};
(function() {
@@ -304,6 +323,8 @@ Polymer({
},
listeners: {
+ 'remove-address': 'removeAddress_',
+ 'remove-credit-card': 'removeCreditCard_',
'remove-password-exception': 'removePasswordException_',
'remove-saved-password': 'removeSavedPassword_',
'show-password': 'showPassword_',
@@ -392,6 +413,24 @@ Polymer({
},
/**
+ * Listens for the remove-address event, and calls the private API.
+ * @param {!Event} event
+ * @private
+ */
+ removeAddress_: function(event) {
+ this.autofillManager_.removeAddress(event.detail);
+ },
+
+ /**
+ * Listens for the remove-credit-card event, and calls the private API.
+ * @param {!Event} event
+ * @private
+ */
+ removeCreditCard_: function(event) {
+ this.autofillManager_.removeCreditCard(event.detail);
+ },
+
+ /**
* Shows the manage autofill sub page.
* @param {!Event} event
* @private
« no previous file with comments | « chrome/browser/resources/settings/passwords_and_forms_page/autofill_section.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698