Chromium Code Reviews| Index: chrome/android/java/src/org/chromium/chrome/browser/payments/PaymentResponseHelper.java |
| diff --git a/chrome/android/java/src/org/chromium/chrome/browser/payments/PaymentResponseHelper.java b/chrome/android/java/src/org/chromium/chrome/browser/payments/PaymentResponseHelper.java |
| index e84b29f63f38c2f3e3dc9fb5b5bf8e6fbbdaa793..0afb208e91cdc7dc667a103faf9c979a276aa8b2 100644 |
| --- a/chrome/android/java/src/org/chromium/chrome/browser/payments/PaymentResponseHelper.java |
| +++ b/chrome/android/java/src/org/chromium/chrome/browser/payments/PaymentResponseHelper.java |
| @@ -28,6 +28,7 @@ public class PaymentResponseHelper implements NormalizedAddressRequestDelegate { |
| void onPaymentResponseReady(PaymentResponse response); |
| } |
| + private AutofillAddress mSelectedShippingAddress; |
| private PaymentResponse mPaymentResponse; |
| private PaymentResponseRequesterDelegate mDelegate; |
| private boolean mIsWaitingForShippingNormalization; |
| @@ -68,23 +69,23 @@ public class PaymentResponseHelper implements NormalizedAddressRequestDelegate { |
| // Shipping addresses are created in PaymentRequestImpl.init(). These should all be |
| // instances of AutofillAddress. |
| assert selectedShippingAddress instanceof AutofillAddress; |
| - AutofillAddress selectedAutofillAddress = (AutofillAddress) selectedShippingAddress; |
| + AutofillAddress mSelectedShippingAddress = (AutofillAddress) selectedShippingAddress; |
|
please use gerrit instead
2016/11/07 22:41:28
That's a redeclaration of the member variable, so
gogerald1
2016/11/08 20:50:17
Done.
|
| // Addresses to be sent to the merchant should always be complete. |
| - assert selectedAutofillAddress.isComplete(); |
| + assert mSelectedShippingAddress.isComplete(); |
| // Record the use of the profile. |
| PersonalDataManager.getInstance().recordAndLogProfileUse( |
| - selectedAutofillAddress.getProfile().getGUID()); |
| + mSelectedShippingAddress.getProfile().getGUID()); |
| - mPaymentResponse.shippingAddress = selectedAutofillAddress.toPaymentAddress(); |
| + mPaymentResponse.shippingAddress = mSelectedShippingAddress.toPaymentAddress(); |
| // The shipping address needs to be normalized before sending the response to the |
| // merchant. |
| mIsWaitingForShippingNormalization = true; |
| PersonalDataManager.getInstance().normalizeAddress( |
| - selectedAutofillAddress.getProfile().getGUID(), |
| - AutofillAddress.getCountryCode(selectedAutofillAddress.getProfile()), this); |
| + mSelectedShippingAddress.getProfile().getGUID(), |
| + AutofillAddress.getCountryCode(mSelectedShippingAddress.getProfile()), this); |
| } |
| } |
| @@ -130,8 +131,8 @@ public class PaymentResponseHelper implements NormalizedAddressRequestDelegate { |
| if (profile != null) { |
| // The normalization finished first: use the normalized address. |
| - mPaymentResponse.shippingAddress = |
| - new AutofillAddress(profile, true /* isComplete */).toPaymentAddress(); |
| + mSelectedShippingAddress.completeAddress(profile); |
| + mPaymentResponse.shippingAddress = mSelectedShippingAddress.toPaymentAddress(); |
| } |
| // Wait for the payment details before sending the response. |