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

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

Issue 2082863002: [MD Settings] Allow saving addresses in material design settings. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@address-edit-dialog.gitbr
Patch Set: nits Created 4 years, 5 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 174b509f9cb855fb9b031261d522a5f06af7096e..620fa88006495e2cc1e7309b15c5ebd3acfc6412 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,12 @@ AutofillManager.prototype = {
*/
getAddressList: assertNotReached,
+ /**
+ * Saves the given address.
+ * @param {!AutofillManager.AddressEntry} address
+ */
+ saveAddress: assertNotReached,
+
/** @param {string} guid The guid of the address to remove. */
removeAddress: assertNotReached,
@@ -247,6 +253,11 @@ AutofillManagerImpl.prototype = {
},
/** @override */
+ saveAddress: function(address) {
+ chrome.autofillPrivate.saveAddress(address);
+ },
+
+ /** @override */
removeAddress: function(guid) {
assert(guid);
chrome.autofillPrivate.removeEntry(guid);
@@ -339,6 +350,7 @@ Polymer({
'remove-credit-card': 'removeCreditCard_',
'remove-password-exception': 'removePasswordException_',
'remove-saved-password': 'removeSavedPassword_',
+ 'save-address': 'saveAddress_',
'save-credit-card': 'saveCreditCard_',
'show-password': 'showPassword_',
},
@@ -480,6 +492,15 @@ Polymer({
},
/**
+ * Listens for the save-address event, and calls the private API.
+ * @param {!Event} event
+ * @private
+ */
+ saveAddress_: function(event) {
+ this.autofillManager_.saveAddress(event.detail);
+ },
+
+ /**
* Listens for the save-credit-card event, and calls the private API.
* @param {!Event} event
* @private

Powered by Google App Engine
This is Rietveld 408576698