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

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

Issue 2561373002: [Payment Request] Keep selection for edited item when canceling editors (Closed)
Patch Set: now handling the + ADD ITEM case Created 4 years 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/AddressEditor.java
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/payments/AddressEditor.java b/chrome/android/java/src/org/chromium/chrome/browser/payments/AddressEditor.java
index 99b835a2b4ea9610e1547827f5c7dd38ebffe688..88451397215d285dbb4625a11953913989de16ec 100644
--- a/chrome/android/java/src/org/chromium/chrome/browser/payments/AddressEditor.java
+++ b/chrome/android/java/src/org/chromium/chrome/browser/payments/AddressEditor.java
@@ -62,7 +62,8 @@ public class AddressEditor extends EditorBase<AutofillAddress> {
* [ phone number field ] <----- phone is always present and required.
*/
@Override
- public void edit(@Nullable AutofillAddress toEdit, final Callback<AutofillAddress> callback) {
+ public void edit(
+ @Nullable final AutofillAddress toEdit, final Callback<AutofillAddress> callback) {
super.edit(toEdit, callback);
if (mAutofillProfileBridge == null) mAutofillProfileBridge = new AutofillProfileBridge();
@@ -167,11 +168,12 @@ public class AddressEditor extends EditorBase<AutofillAddress> {
mPhoneField.setValue(profile.getPhoneNumber());
editor.addField(mPhoneField);
- // If the user clicks [Cancel], send a null address back to the caller.
+ // If the user clicks [Cancel], send |toEdit| address back to the caller, which was the
+ // original state (could be null, a complete address, a partial address).
editor.setCancelCallback(new Runnable() {
@Override
public void run() {
- callback.onResult(null);
+ callback.onResult(toEdit);
}
});

Powered by Google App Engine
This is Rietveld 408576698