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

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

Issue 996973003: Revamp Autofill Wallet settings (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: mac compiles 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
Index: chrome/browser/resources/options/autofill_options.js
diff --git a/chrome/browser/resources/options/autofill_options.js b/chrome/browser/resources/options/autofill_options.js
index ce9775dca6772294bc1ea954549094d4e81623d0..098053254808e6750f18a8ba91ef98188a4c5255 100644
--- a/chrome/browser/resources/options/autofill_options.js
+++ b/chrome/browser/resources/options/autofill_options.js
@@ -181,25 +181,31 @@ cr.define('options', function() {
},
/**
- * Requests profile data for the address represented by |guid| from the
- * PersonalDataManager. Once the data is loaded, the AutofillOptionsHandler
- * calls showEditAddressOverlay().
- * @param {string} guid The GUID of the address to edit.
+ * For local Autofill data, this function causes the AutofillOptionsHandler
+ * to call showEditAddressOverlay(). For Wallet data, the user is
+ * redirected to the Wallet web interface.
+ * @param {Object} entry The relevant entry in data model.
* @private
*/
- loadAddressEditor_: function(guid) {
- chrome.send('loadAddressEditor', [guid]);
+ loadAddressEditor_: function(entry) {
+ if (entry.isLocal)
+ chrome.send('loadAddressEditor', [entry.guid]);
+ else
+ window.open(loadTimeData.getString('manageWalletAddressesUrl'));
},
/**
- * Requests profile data for the credit card represented by |guid| from the
- * PersonalDataManager. Once the data is loaded, the AutofillOptionsHandler
- * calls showEditCreditCardOverlay().
- * @param {string} guid The GUID of the credit card to edit.
+ * For local Autofill data, this function causes the AutofillOptionsHandler
+ * to call showEditCreditCardOverlay(). For Wallet data, the user is
+ * redirected to the Wallet web interface.
+ * @param {Object} entry The relevant entry in data model.
* @private
*/
- loadCreditCardEditor_: function(guid) {
- chrome.send('loadCreditCardEditor', [guid]);
+ loadCreditCardEditor_: function(entry) {
+ if (entry.isLocal)
+ chrome.send('loadCreditCardEditor', [entry.guid]);
+ else
+ window.open(loadTimeData.getString('manageWalletPaymentMethodsUrl'));
},
/**
@@ -242,12 +248,12 @@ cr.define('options', function() {
AutofillOptions.getInstance().removeData_(guid, metricsAction);
};
- AutofillOptions.loadAddressEditor = function(guid) {
- AutofillOptions.getInstance().loadAddressEditor_(guid);
+ AutofillOptions.loadAddressEditor = function(entry) {
+ AutofillOptions.getInstance().loadAddressEditor_(entry);
};
- AutofillOptions.loadCreditCardEditor = function(guid) {
- AutofillOptions.getInstance().loadCreditCardEditor_(guid);
+ AutofillOptions.loadCreditCardEditor = function(entry) {
+ AutofillOptions.getInstance().loadCreditCardEditor_(entry);
};
AutofillOptions.editAddress = function(address) {
« no previous file with comments | « chrome/browser/resources/options/autofill_options.html ('k') | chrome/browser/resources/options/autofill_options_list.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698