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

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

Issue 2170213003: [Merge M-53] Record and log the use of a profile and/or credit card (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@2785
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 bf5bde924677c1bba4284c0353a185a0bad81ba1..c198b8c7b85a9e1095961f4f70e6be9111d7008a 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
@@ -940,8 +940,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();
}
}
@@ -952,6 +957,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