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

Unified Diff: chrome/android/java/src/org/chromium/chrome/browser/payments/ui/PaymentRequestUI.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
« no previous file with comments | « chrome/android/java/src/org/chromium/chrome/browser/payments/ui/PaymentRequestSection.java ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/android/java/src/org/chromium/chrome/browser/payments/ui/PaymentRequestUI.java
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/payments/ui/PaymentRequestUI.java b/chrome/android/java/src/org/chromium/chrome/browser/payments/ui/PaymentRequestUI.java
index 0fb25772e98927a58ff1608173b615ce0ecdc049..5e4a5be274ef884df46fb51b38437c6f5d302d2c 100644
--- a/chrome/android/java/src/org/chromium/chrome/browser/payments/ui/PaymentRequestUI.java
+++ b/chrome/android/java/src/org/chromium/chrome/browser/payments/ui/PaymentRequestUI.java
@@ -135,7 +135,30 @@ public class PaymentRequestUI implements DialogInterface.OnDismissListener, View
* @param checkedCallback The callback after an asynchronous check has completed.
* @return The result of the selection.
*/
- @SelectionResult int onSectionOptionSelected(@DataType int optionType, PaymentOption option,
+ @SelectionResult
+ int onSectionOptionSelected(@DataType int optionType, PaymentOption option,
+ Callback<PaymentInformation> checkedCallback);
+
+ /**
+ * Called when the user clicks edit icon (pencil icon) on the payment option in a section.
+ *
+ * If this method returns {@link SELECTION_RESULT_ASYNCHRONOUS_VALIDATION}, then:
+ * + The edited option should be asynchronously verified.
+ * + The section should be disabled and a progress spinny should be shown while the option
+ * is being verified.
+ * + The checkedCallback will be invoked with the results of the check and updated
+ * information.
+ *
+ * If this method returns {@link SELECTION_RESULT_EDITOR_LAUNCH}, then:
+ * + Interaction with UI should be disabled until updateSection() is called.
+ *
+ * @param optionType Data being updated.
+ * @param option The option to be edited.
+ * @param checkedCallback The callback after an asynchronous check has completed.
+ * @return The result of the edit request.
+ */
+ @SelectionResult
+ int onSectionEditOption(@DataType int optionType, PaymentOption option,
Callback<PaymentInformation> checkedCallback);
/**
@@ -671,6 +694,31 @@ public class PaymentRequestUI implements DialogInterface.OnDismissListener, View
}
@Override
+ public void onEditPaymentOption(final PaymentRequestSection section, PaymentOption option) {
+ @SelectionResult int result = SELECTION_RESULT_NONE;
+
+ assert section != mOrderSummarySection;
+ assert section != mShippingOptionSection;
+ if (section == mShippingAddressSection) {
+ assert mShippingAddressSectionInformation.getSelectedItem() == option;
+ result = mClient.onSectionEditOption(
+ TYPE_SHIPPING_ADDRESSES, option, mUpdateSectionsCallback);
+ }
+
+ if (section == mContactDetailsSection) {
+ assert mContactDetailsSectionInformation.getSelectedItem() == option;
+ result = mClient.onSectionEditOption(TYPE_CONTACT_DETAILS, option, null);
+ }
+
+ if (section == mPaymentMethodSection) {
+ assert mPaymentMethodSectionInformation.getSelectedItem() == option;
+ result = mClient.onSectionEditOption(TYPE_PAYMENT_METHODS, option, null);
+ }
+
+ updateStateFromResult(section, result);
+ }
+
+ @Override
public void onAddPaymentOption(PaymentRequestSection section) {
assert section != mShippingOptionSection;
« no previous file with comments | « chrome/android/java/src/org/chromium/chrome/browser/payments/ui/PaymentRequestSection.java ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698