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

Unified Diff: chrome/browser/resources/options/autofill_options_list.js

Issue 1027393002: Autofill settings - Fix editing of local addresses and credit cards. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 9 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/options/autofill_options.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/options/autofill_options_list.js
diff --git a/chrome/browser/resources/options/autofill_options_list.js b/chrome/browser/resources/options/autofill_options_list.js
index 46aff21e760be1e9f848c5ae24137d3db9a714dd..004f62131cdb569ed1fb1dacf8fe0e3bc6dcd118 100644
--- a/chrome/browser/resources/options/autofill_options_list.js
+++ b/chrome/browser/resources/options/autofill_options_list.js
@@ -90,11 +90,23 @@ cr.define('options.autofillOptions', function() {
}
// The 'Edit' button.
- var guid = this.metadata_.guid;
+ var metadata = this.metadata_;
var editButtonEl = AutofillEditProfileButton(
- function() { AutofillOptions.loadAddressEditor(guid); });
+ AddressListItem.prototype.loadAddressEditor.bind(this));
this.contentElement.appendChild(editButtonEl);
},
+
+ /**
+ * For local Autofill data, this function causes the AutofillOptionsHandler
+ * to call showEditAddressOverlay(). For Wallet data, the user is
+ * redirected to the Wallet web interface.
+ */
+ loadAddressEditor: function() {
+ if (this.metadata_.isLocal)
+ chrome.send('loadAddressEditor', [this.metadata_.guid]);
+ else
+ window.open(loadTimeData.getString('manageWalletAddressesUrl'));
+ },
};
/**
@@ -151,10 +163,23 @@ cr.define('options.autofillOptions', function() {
}
// The 'Edit' button.
+ var metadata = this.metadata_;
var editButtonEl = AutofillEditProfileButton(
- function() { AutofillOptions.loadCreditCardEditor(guid); });
+ CreditCardListItem.prototype.loadCreditCardEditor.bind(this));
this.contentElement.appendChild(editButtonEl);
},
+
+ /**
+ * For local Autofill data, this function causes the AutofillOptionsHandler
+ * to call showEditCreditCardOverlay(). For Wallet data, the user is
+ * redirected to the Wallet web interface.
+ */
+ loadCreditCardEditor: function() {
+ if (this.metadata_.isLocal)
+ chrome.send('loadCreditCardEditor', [this.metadata_.guid]);
+ else
+ window.open(loadTimeData.getString('manageWalletPaymentMethodsUrl'));
+ },
};
/**
@@ -408,7 +433,7 @@ cr.define('options.autofillOptions', function() {
/** @override */
activateItemAtIndex: function(index) {
- AutofillOptions.loadAddressEditor(this.dataModel.item(index));
+ this.getListItemByIndex(index).loadAddressEditor();
},
/**
@@ -442,7 +467,7 @@ cr.define('options.autofillOptions', function() {
/** @override */
activateItemAtIndex: function(index) {
- AutofillOptions.loadCreditCardEditor(this.dataModel.item(index));
+ this.getListItemByIndex(index).loadCreditCardEditor();
},
/**
« no previous file with comments | « chrome/browser/resources/options/autofill_options.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698