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

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

Issue 2083903002: [MD Settings] Allow editing autofill items from Google Payments. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix margin and color Created 4 years, 6 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/autofill_section.js
diff --git a/chrome/browser/resources/settings/passwords_and_forms_page/autofill_section.js b/chrome/browser/resources/settings/passwords_and_forms_page/autofill_section.js
index 4d3b0f5d9bd953f3cf909aae987316c7d2ff6b03..4807235331338b639f5131c48160fe078a2fcec7 100644
--- a/chrome/browser/resources/settings/passwords_and_forms_page/autofill_section.js
+++ b/chrome/browser/resources/settings/passwords_and_forms_page/autofill_section.js
@@ -12,6 +12,8 @@
Polymer({
is: 'settings-autofill-section',
+ behaviors: [I18nBehavior],
+
properties: {
/**
* An array of saved addresses.
@@ -62,6 +64,7 @@
var menuEvent = /** @type {!{model: !{item: !Object}}} */(e);
var address = /** @type {!chrome.autofillPrivate.AddressEntry} */(
menuEvent.model.item);
+ this.$.menuRemoveAddress.hidden = !address.metadata.isLocal;
this.$.addressSharedMenu.toggleMenu(Polymer.dom(e).localTarget, address);
e.stopPropagation(); // Prevent the tap event from closing the menu.
},
@@ -81,8 +84,16 @@
* @private
*/
onMenuEditAddressTap_: function() {
- // TODO(hcarmona): implement editing an address.
- this.$.addressSharedMenu.closeMenu();
+ var menu = this.$.addressSharedMenu;
+ /** @type {chrome.autofillPrivate.AddressEntry} */
+ var address = menu.itemData;
+
+ // TODO(hcarmona): implement editing a local address.
+
+ if (!address.metadata.isLocal)
+ window.open(this.i18n('manageAddressesUrl'));
+
+ menu.closeMenu();
},
/**
@@ -107,6 +118,7 @@
var menuEvent = /** @type {!{model: !{item: !Object}}} */(e);
var creditCard = /** @type {!chrome.autofillPrivate.CreditCardEntry} */(
menuEvent.model.item);
+ this.$.menuRemoveCreditCard.hidden = !creditCard.metadata.isLocal;
this.$.creditCardSharedMenu.toggleMenu(
Polymer.dom(e).localTarget, creditCard);
e.stopPropagation(); // Prevent the tap event from closing the menu.
@@ -134,8 +146,14 @@
*/
onMenuEditCreditCardTap_: function() {
var menu = this.$.creditCardSharedMenu;
- this.$.editCreditCardDialog.open(
- /** @type {chrome.autofillPrivate.CreditCardEntry} */(menu.itemData));
+ /** @type {chrome.autofillPrivate.CreditCardEntry} */
+ var creditCard = menu.itemData;
+
+ if (creditCard.metadata.isLocal)
+ this.$.editCreditCardDialog.open(creditCard);
+ else
+ window.open(this.i18n('manageCreditCardsUrl'));
+
menu.closeMenu();
},

Powered by Google App Engine
This is Rietveld 408576698