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

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: 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 360ab4ad67ee38eef702f31cb2ffa1f82a82e97e..4a8baf3261f8ab7fbb5cd0d8d8b2526e50aff1cd 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
@@ -804,8 +804,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();
}
}
@@ -816,6 +821,13 @@ public class PaymentRequestImpl implements PaymentRequest, PaymentRequestUI.Clie
}
}
+ // If the payment method was an Autofill credit card, record its use.
+ if (mPaymentMethodsSection.getSelectedItem() instanceof AutofillPaymentInstrument) {
+ PersonalDataManager.getInstance().recordAndLogCreditCardUse(
+ ((AutofillPaymentInstrument) mPaymentMethodsSection.getSelectedItem())
please use gerrit instead 2016/07/12 15:41:58 Remove the cast to AutofillPaymentInstrument on th
sebsg 2016/07/13 18:49:19 Done.
+ .getCardGUID());
please use gerrit instead 2016/07/12 15:41:58 getIdentifier()
sebsg 2016/07/13 18:49:19 Done.
+ }
+
mClient.onPaymentResponse(response);
}

Powered by Google App Engine
This is Rietveld 408576698