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

Unified Diff: chrome/android/java/src/org/chromium/chrome/browser/payments/PaymentRequestImpl.java

Issue 2492243002: [Payments] Allow for editing of local cards, addresses and contacts (add pencil icon) (Closed)
Patch Set: address comments Created 4 years, 1 month 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/android/java/src/org/chromium/chrome/browser/payments/PaymentRequestImpl.java
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/payments/PaymentRequestImpl.java b/chrome/android/java/src/org/chromium/chrome/browser/payments/PaymentRequestImpl.java
index 5069a737c5cfe6cd6329fad4052970fb026eb6e7..257ba0c2886ed0720304559fe2ca11b65d2c9514 100644
--- a/chrome/android/java/src/org/chromium/chrome/browser/payments/PaymentRequestImpl.java
+++ b/chrome/android/java/src/org/chromium/chrome/browser/payments/PaymentRequestImpl.java
@@ -687,9 +687,9 @@ public class PaymentRequestImpl implements PaymentRequest, PaymentRequestUI.Clie
}
@Override
- @PaymentRequestUI.SelectionResult public int onSectionOptionSelected(
- @PaymentRequestUI.DataType int optionType, PaymentOption option,
- Callback<PaymentInformation> callback) {
+ @PaymentRequestUI.SelectionResult
+ public int onSectionOptionSelected(@PaymentRequestUI.DataType int optionType,
+ PaymentOption option, Callback<PaymentInformation> callback) {
if (optionType == PaymentRequestUI.TYPE_SHIPPING_ADDRESSES) {
assert option instanceof AutofillAddress;
// Log the change of shipping address.
@@ -745,7 +745,35 @@ public class PaymentRequestImpl implements PaymentRequest, PaymentRequestUI.Clie
}
@Override
- @PaymentRequestUI.SelectionResult public int onSectionAddOption(
+ @PaymentRequestUI.SelectionResult
+ public int onSectionEditOption(@PaymentRequestUI.DataType int optionType, PaymentOption option,
+ Callback<PaymentInformation> callback) {
+ if (optionType == PaymentRequestUI.TYPE_SHIPPING_ADDRESSES) {
+ assert option instanceof AutofillAddress;
+ editAddress((AutofillAddress) option);
+ mPaymentInformationCallback = callback;
+ return PaymentRequestUI.SELECTION_RESULT_ASYNCHRONOUS_VALIDATION;
+ }
+
+ if (optionType == PaymentRequestUI.TYPE_CONTACT_DETAILS) {
+ assert option instanceof AutofillContact;
+ editContact((AutofillContact) option);
+ return PaymentRequestUI.SELECTION_RESULT_EDITOR_LAUNCH;
+ }
+
+ if (optionType == PaymentRequestUI.TYPE_PAYMENT_METHODS) {
+ assert option instanceof AutofillPaymentInstrument;
+ editCard((AutofillPaymentInstrument) option);
+ return PaymentRequestUI.SELECTION_RESULT_EDITOR_LAUNCH;
+ }
+
+ assert false;
+ return PaymentRequestUI.SELECTION_RESULT_NONE;
+ }
+
+ @Override
+ @PaymentRequestUI.SelectionResult
+ public int onSectionAddOption(
@PaymentRequestUI.DataType int optionType, Callback<PaymentInformation> callback) {
if (optionType == PaymentRequestUI.TYPE_SHIPPING_ADDRESSES) {
editAddress(null);

Powered by Google App Engine
This is Rietveld 408576698