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

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

Issue 2198433002: [Merge M-53] Implemented metrics to log the normal successful checkout flow in Payment Request: (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
« no previous file with comments | « no previous file | chrome/android/java_sources.gni » ('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 7b9f5cab47ecaf3c7e4627cb5b06d92a6024f2ce..5c595464c448ff709e9b4ef74308a2fd717c3903 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
@@ -12,6 +12,7 @@ import android.text.TextUtils;
import org.chromium.base.Callback;
import org.chromium.base.Log;
import org.chromium.base.VisibleForTesting;
+import org.chromium.base.metrics.RecordHistogram;
import org.chromium.chrome.R;
import org.chromium.chrome.browser.ChromeFeatureList;
import org.chromium.chrome.browser.autofill.PersonalDataManager;
@@ -192,6 +193,8 @@ public class PaymentRequestImpl implements PaymentRequest, PaymentRequestUI.Clie
mAddressEditor = new AddressEditor();
mCardEditor = new CardEditor(webContents, mAddressEditor, sObserverForTest);
+
+ recordSuccessFunnelHistograms("Initiated");
}
/**
@@ -342,6 +345,8 @@ public class PaymentRequestImpl implements PaymentRequest, PaymentRequestUI.Clie
mAddressEditor.setEditorView(mUI.getEditorView());
mCardEditor.setEditorView(mUI.getCardEditorView());
if (mContactEditor != null) mContactEditor.setEditorView(mUI.getEditorView());
+
+ recordSuccessFunnelHistograms("Shown");
}
private static Map<String, JSONObject> getValidatedMethodData(
@@ -804,6 +809,7 @@ public class PaymentRequestImpl implements PaymentRequest, PaymentRequestUI.Clie
mPaymentAppRunning = true;
instrument.getDetails(mMerchantName, mOrigin, mRawTotal, mRawLineItems,
mMethodData.get(instrument.getMethodName()), this);
+ recordSuccessFunnelHistograms("PayClicked");
return !(instrument instanceof AutofillPaymentInstrument);
}
@@ -849,6 +855,7 @@ public class PaymentRequestImpl implements PaymentRequest, PaymentRequestUI.Clie
@Override
public void complete(int result) {
if (mClient == null) return;
+ recordSuccessFunnelHistograms("Completed");
closeUI(PaymentComplete.FAIL != result);
}
@@ -1009,6 +1016,8 @@ public class PaymentRequestImpl implements PaymentRequest, PaymentRequestUI.Clie
mUI.showProcessingMessage();
mClient.onPaymentResponse(response);
+
+ recordSuccessFunnelHistograms("ReceivedInstrumentDetails");
}
/**
@@ -1054,4 +1063,12 @@ public class PaymentRequestImpl implements PaymentRequest, PaymentRequestUI.Clie
public static void setObserverForTest(PaymentRequestServiceObserverForTest observerForTest) {
sObserverForTest = observerForTest;
}
+
+ /**
+ * Records specific histograms related to the different steps of a successful checkout.
+ */
+ private void recordSuccessFunnelHistograms(String funnelPart) {
+ RecordHistogram.recordBooleanHistogram(
+ "PaymentRequest.CheckoutFunnel." + funnelPart, true);
+ }
}
« no previous file with comments | « no previous file | chrome/android/java_sources.gni » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698