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

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

Issue 2126213002: [Payments] Record use of profiles and credit cards in Payment Request. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fixed temp card bug + nits Created 4 years, 5 months 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 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);
}
« no previous file with comments | « chrome/android/java/src/org/chromium/chrome/browser/autofill/PersonalDataManager.java ('k') | chrome/android/java_sources.gni » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698