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

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

Issue 2790253002: [Payments] Don't record CanMakePayment when in incognito mode. (Closed)
Patch Set: Addressed comments 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
« 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 c7d08f2cf5d36bf09fa360e853b327ff09bf32e4..a62e2e23fcb22b4e8b01eb175516670b203857d8 100644
--- a/components/payments/core/journey_logger.cc
+++ b/components/payments/core/journey_logger.cc
@@ -54,10 +54,11 @@ std::string GetHistogramNameSuffix(
} // namespace
-JourneyLogger::JourneyLogger()
+JourneyLogger::JourneyLogger(bool is_incognito)
: was_can_make_payments_used_(false),
could_make_payment_(false),
- was_show_called_(false) {}
+ was_show_called_(false),
+ is_incognito_(is_incognito) {}
JourneyLogger::~JourneyLogger() {}
@@ -150,6 +151,11 @@ void JourneyLogger::RecordSectionSpecificStats(
void JourneyLogger::RecordCanMakePaymentStats(
CompletionStatus completion_status) {
+ // CanMakePayment always returns true in incognito mode. Don't log the
+ // metrics.
+ if (is_incognito_)
+ return;
+
// Record CanMakePayment usage.
UMA_HISTOGRAM_ENUMERATION("PaymentRequest.CanMakePayment.Usage",
was_can_make_payments_used_
« 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