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

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

Issue 2220713002: [Payments] Add Payment Request metrics for selected payment method. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Addressed comments Created 4 years, 4 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
« no previous file with comments | « no previous file | chrome/android/java/src/org/chromium/chrome/browser/payments/PaymentRequestMetrics.java » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 653f20b90c4aca3229ce8bd8f88e471b424def1e..9c411e36ccda9f859cf2a34c49dfd5d4f95e910f 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
@@ -97,6 +97,7 @@ public class PaymentRequestImpl implements PaymentRequest, PaymentRequestUI.Clie
}
private static final String TAG = "cr_PaymentRequest";
+ private static final String ANDROID_PAY_METHOD_NAME = "https://android.com/pay";
private static final int SUGGESTIONS_LIMIT = 4;
private static final Comparator<Completable> COMPLETENESS_COMPARATOR =
new Comparator<Completable>() {
@@ -1032,11 +1033,22 @@ 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());
+ // Record the payment method used to complete the transaction. If the payment method was an
+ // Autofill credit card with an identifier, record its use.
+ PaymentOption selectedPaymentMethod = mPaymentMethodsSection.getSelectedItem();
+ if (selectedPaymentMethod instanceof AutofillPaymentInstrument) {
+ if (!selectedPaymentMethod.getIdentifier().isEmpty()) {
+ PersonalDataManager.getInstance().recordAndLogCreditCardUse(
+ selectedPaymentMethod.getIdentifier());
+ }
+ PaymentRequestMetrics.recordSelectedPaymentMethodHistogram(
+ PaymentRequestMetrics.SELECTED_METHOD_CREDIT_CARD);
+ } else if (methodName.equals(ANDROID_PAY_METHOD_NAME)) {
+ PaymentRequestMetrics.recordSelectedPaymentMethodHistogram(
+ PaymentRequestMetrics.SELECTED_METHOD_ANDROID_PAY);
+ } else {
+ PaymentRequestMetrics.recordSelectedPaymentMethodHistogram(
+ PaymentRequestMetrics.SELECTED_METHOD_OTHER_PAYMENT_APP);
}
mUI.showProcessingMessage();
« no previous file with comments | « no previous file | chrome/android/java/src/org/chromium/chrome/browser/payments/PaymentRequestMetrics.java » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698