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

Unified Diff: components/payments/core/journey_logger.cc

Issue 2923243003: Merge-60 [Payments] Move the RequestedInformation metric to native. (Closed)
Patch Set: Created 3 years, 6 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 | « components/payments/core/journey_logger.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/payments/core/journey_logger.cc
diff --git a/components/payments/core/journey_logger.cc b/components/payments/core/journey_logger.cc
index 66344a896fb2f10733ae34e0be2e6e4fe474b62f..0ec4e3df51e08728840f521cee4f101529e71cfc 100644
--- a/components/payments/core/journey_logger.cc
+++ b/components/payments/core/journey_logger.cc
@@ -142,6 +142,20 @@ void JourneyLogger::SetSelectedPaymentMethod(
payment_method_ = payment_method;
}
+void JourneyLogger::SetRequestedInformation(bool requested_shipping,
+ bool requested_email,
+ bool requested_phone,
+ bool requested_name) {
+ // This method should only be called once per Payment Request.
+ DCHECK(requested_information_ == REQUESTED_INFORMATION_MAX);
+
+ requested_information_ =
+ (requested_shipping ? REQUESTED_INFORMATION_SHIPPING : 0) |
+ (requested_email ? REQUESTED_INFORMATION_EMAIL : 0) |
+ (requested_phone ? REQUESTED_INFORMATION_PHONE : 0) |
+ (requested_name ? REQUESTED_INFORMATION_NAME : 0);
+}
+
void JourneyLogger::RecordJourneyStatsHistograms(
CompletionStatus completion_status) {
DCHECK(!has_recorded_);
@@ -151,6 +165,8 @@ void JourneyLogger::RecordJourneyStatsHistograms(
RecordPaymentMethodMetric();
+ RecordRequestedInformationMetrics();
+
RecordSectionSpecificStats(completion_status);
// Record the CanMakePayment metrics based on whether the transaction was
@@ -182,6 +198,11 @@ void JourneyLogger::RecordPaymentMethodMetric() {
payment_method_, SELECTED_PAYMENT_METHOD_MAX);
}
+void JourneyLogger::RecordRequestedInformationMetrics() {
+ UMA_HISTOGRAM_ENUMERATION("PaymentRequest.RequestedInformation",
+ requested_information_, REQUESTED_INFORMATION_MAX);
+}
+
void JourneyLogger::RecordSectionSpecificStats(
CompletionStatus completion_status) {
// Record whether the user had suggestions for each requested information.
« no previous file with comments | « components/payments/core/journey_logger.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698