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

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

Issue 2808513002: [Payments] Add PaymentRequest checkout funnel UKMs. (Closed)
Patch Set: Created 3 years, 8 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/JourneyLogger.java
diff --git a/components/payments/content/android/java/src/org/chromium/components/payments/JourneyLogger.java b/chrome/android/java/src/org/chromium/chrome/browser/payments/JourneyLogger.java
similarity index 88%
rename from components/payments/content/android/java/src/org/chromium/components/payments/JourneyLogger.java
rename to chrome/android/java/src/org/chromium/chrome/browser/payments/JourneyLogger.java
index d8408df288bc29d5ea078a26353049c72660ebc6..b1857140e964d41b106ed706be585b4d14c8c1a3 100644
--- a/components/payments/content/android/java/src/org/chromium/components/payments/JourneyLogger.java
+++ b/chrome/android/java/src/org/chromium/chrome/browser/payments/JourneyLogger.java
@@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-package org.chromium.components.payments;
+package org.chromium.chrome.browser.payments;
import org.chromium.base.annotations.JNINamespace;
@@ -43,15 +43,22 @@ public class JourneyLogger {
private static final int MAX_EXPECTED_SAMPLE = 49;
private static final int NUMBER_BUCKETS = 50;
+ // The steps of a successful Payment Request.
+ private static final int STEP_INITIATED = 0;
+ private static final int STEP_SHOWN = 1;
+ private static final int STEP_PAY_CLICKED = 2;
+ private static final int STEP_RECEIVED_INSTRUMENT_DETAILS = 3;
+ private static final int STEP_MAX = 4;
+
/**
* Pointer to the native implementation.
*/
private long mJourneyLoggerAndroid;
- public JourneyLogger(boolean isIncognito) {
+ public JourneyLogger(boolean isIncognito, String url) {
// Note that this pointer could leak the native object. The called must call destroy() to
// ensure that the native object is destroyed.
- mJourneyLoggerAndroid = nativeInitJourneyLoggerAndroid(isIncognito);
+ mJourneyLoggerAndroid = nativeInitJourneyLoggerAndroid(isIncognito, url);
}
/** Will destroy the native object. This class shouldn't be used afterwards. */
@@ -119,6 +126,14 @@ public class JourneyLogger {
nativeSetShowCalled(mJourneyLoggerAndroid);
}
+ /**
+ * Records the steps as they are done.
+ */
+ public void setCurrentStep(int step) {
+ assert step < STEP_MAX;
+ nativeSetCurrentStep(mJourneyLoggerAndroid, step);
+ }
+
/*
* Records the histograms for all the sections that were requested by the merchant and for the
* usage of the CanMakePayment method and its effect on the transaction. This method should be
@@ -130,7 +145,7 @@ public class JourneyLogger {
nativeRecordJourneyStatsHistograms(mJourneyLoggerAndroid, completionStatus);
}
- private native long nativeInitJourneyLoggerAndroid(boolean isIncognito);
+ private native long nativeInitJourneyLoggerAndroid(boolean isIncognito, String url);
private native void nativeDestroy(long nativeJourneyLoggerAndroid);
private native void nativeSetNumberOfSuggestionsShown(
long nativeJourneyLoggerAndroid, int section, int number);
@@ -141,6 +156,7 @@ public class JourneyLogger {
private native void nativeSetCanMakePaymentValue(
long nativeJourneyLoggerAndroid, boolean value);
private native void nativeSetShowCalled(long nativeJourneyLoggerAndroid);
+ private native void nativeSetCurrentStep(long nativeJourneyLoggerAndroid, int step);
private native void nativeRecordJourneyStatsHistograms(
long nativeJourneyLoggerAndroid, int completionStatus);
}

Powered by Google App Engine
This is Rietveld 408576698