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 ac590e2122a5f837cdffe4857db02a58fb5de130..863a592b7a9487500fe27f9b3f4dd333cb7d4028 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 |
@@ -884,8 +884,13 @@ public class PaymentRequestImpl implements PaymentRequest, PaymentRequestUI.Clie |
// Shipping addresses are created in show(). These should all be instances of |
// AutofillAddress. |
assert selectedShippingAddress instanceof AutofillAddress; |
- response.shippingAddress = |
- ((AutofillAddress) selectedShippingAddress).toPaymentAddress(); |
+ AutofillAddress selectedAutofillAddress = (AutofillAddress) selectedShippingAddress; |
+ |
+ // Record the use of the profile. |
+ PersonalDataManager.getInstance().recordAndLogProfileUse( |
+ selectedAutofillAddress.getProfile().getGUID()); |
+ |
+ response.shippingAddress = selectedAutofillAddress.toPaymentAddress(); |
} |
} |
@@ -896,6 +901,13 @@ public class PaymentRequestImpl implements PaymentRequest, PaymentRequestUI.Clie |
} |
} |
+ // If the payment method was an Autofill credit card with an identifier, record its use. |
+ if (mPaymentMethodsSection.getSelectedItem() instanceof AutofillPaymentInstrument |
+ && !mPaymentMethodsSection.getSelectedItem().getIdentifier().isEmpty()) { |
+ PersonalDataManager.getInstance().recordAndLogCreditCardUse( |
+ mPaymentMethodsSection.getSelectedItem().getIdentifier()); |
+ } |
+ |
mUI.showProcessingMessage(); |
mClient.onPaymentResponse(response); |
} |