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

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

Issue 2790253002: [Payments] Don't record CanMakePayment when in incognito mode. (Closed)
Patch Set: Created 3 years, 9 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: components/payments/core/journey_logger.cc
diff --git a/components/payments/core/journey_logger.cc b/components/payments/core/journey_logger.cc
index c7d08f2cf5d36bf09fa360e853b327ff09bf32e4..db1c516b87d0f3d3dc011f149c07544168afc0ed 100644
--- a/components/payments/core/journey_logger.cc
+++ b/components/payments/core/journey_logger.cc
@@ -57,7 +57,8 @@ std::string GetHistogramNameSuffix(
JourneyLogger::JourneyLogger()
: was_can_make_payments_used_(false),
could_make_payment_(false),
- was_show_called_(false) {}
+ was_show_called_(false),
+ is_incognito_(false) {}
JourneyLogger::~JourneyLogger() {}
@@ -91,6 +92,10 @@ void JourneyLogger::SetShowCalled() {
was_show_called_ = true;
}
+void JourneyLogger::SetIsIncognito() {
+ is_incognito_ = true;
+}
+
void JourneyLogger::RecordJourneyStatsHistograms(
CompletionStatus completion_status) {
RecordSectionSpecificStats(completion_status);
@@ -150,6 +155,11 @@ void JourneyLogger::RecordSectionSpecificStats(
void JourneyLogger::RecordCanMakePaymentStats(
CompletionStatus completion_status) {
+ // CanMakePayment always returns true in incognito mode. Don't log the
+ // metrics.
Mathieu 2017/04/03 20:19:30 *metric
sebsg 2017/04/03 21:04:26 There are more than one :)
+ if (is_incognito_)
+ return;
+
// Record CanMakePayment usage.
UMA_HISTOGRAM_ENUMERATION("PaymentRequest.CanMakePayment.Usage",
was_can_make_payments_used_
« components/payments/core/journey_logger.h ('K') | « components/payments/core/journey_logger.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698