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

Side by Side Diff: components/payments/core/journey_logger.h

Issue 2851893002: [Payments] Record CanMakePayment metrics on Desktop. (Closed)
Patch Set: Windows Fix and Rebase Fix Created 3 years, 7 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 unified diff | Download patch
OLDNEW
1 // Copyright 2017 The Chromium Authors. All rights reserved. 1 // Copyright 2017 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef COMPONENTS_PAYMENTS_CORE_JOURNEY_LOGGER_H_ 5 #ifndef COMPONENTS_PAYMENTS_CORE_JOURNEY_LOGGER_H_
6 #define COMPONENTS_PAYMENTS_CORE_JOURNEY_LOGGER_H_ 6 #define COMPONENTS_PAYMENTS_CORE_JOURNEY_LOGGER_H_
7 7
8 #include <string> 8 #include <string>
9 9
10 #include "base/macros.h" 10 #include "base/macros.h"
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after
59 }; 59 };
60 60
61 // Used to record the different events that happened during the Payment 61 // Used to record the different events that happened during the Payment
62 // Request. 62 // Request.
63 enum Event { 63 enum Event {
64 EVENT_INITIATED = 0, 64 EVENT_INITIATED = 0,
65 EVENT_SHOWN = 1 << 0, 65 EVENT_SHOWN = 1 << 0,
66 EVENT_PAY_CLICKED = 1 << 1, 66 EVENT_PAY_CLICKED = 1 << 1,
67 EVENT_RECEIVED_INSTRUMENT_DETAILS = 1 << 2, 67 EVENT_RECEIVED_INSTRUMENT_DETAILS = 1 << 2,
68 EVENT_SKIPPED_SHOW = 1 << 3, 68 EVENT_SKIPPED_SHOW = 1 << 3,
69 EVENT_MAX = 16, 69 EVENT_ENUM_MAX = 16,
70 }; 70 };
71 71
72 // Used to mesure the impact of the CanMakePayment return value on whether the 72 // Used to mesure the impact of the CanMakePayment return value on whether the
73 // Payment Request is shown to the user. 73 // Payment Request is shown to the user.
74 static const int CMP_SHOW_COULD_NOT_MAKE_PAYMENT_AND_DID_NOT_SHOW = 0; 74 static const int CMP_SHOW_COULD_NOT_MAKE_PAYMENT_AND_DID_NOT_SHOW = 0;
75 static const int CMP_SHOW_DID_SHOW = 1 << 0; 75 static const int CMP_SHOW_DID_SHOW = 1 << 0;
76 static const int CMP_SHOW_COULD_MAKE_PAYMENT = 1 << 1; 76 static const int CMP_SHOW_COULD_MAKE_PAYMENT = 1 << 1;
77 static const int CMP_SHOW_MAX = 4; 77 static const int CMP_SHOW_MAX = 4;
78 78
79 JourneyLogger(bool is_incognito, 79 JourneyLogger(bool is_incognito,
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after
150 150
151 // Records the completion status depending on the the usage and return value 151 // Records the completion status depending on the the usage and return value
152 // of the CanMakePaymentMethod. 152 // of the CanMakePaymentMethod.
153 void RecordCanMakePaymentEffectOnCompletion( 153 void RecordCanMakePaymentEffectOnCompletion(
154 CompletionStatus completion_status); 154 CompletionStatus completion_status);
155 155
156 // Records the Payment Request Url Keyed Metrics. 156 // Records the Payment Request Url Keyed Metrics.
157 void RecordUrlKeyedMetrics(CompletionStatus completion_status); 157 void RecordUrlKeyedMetrics(CompletionStatus completion_status);
158 158
159 SectionStats sections_[NUMBER_OF_SECTIONS]; 159 SectionStats sections_[NUMBER_OF_SECTIONS];
160 bool was_can_make_payments_used_; 160 bool has_recorded_ = false;
161 bool could_make_payment_; 161 bool was_can_make_payments_used_ = false;
162 bool was_show_called_; 162 bool could_make_payment_ = false;
163 bool was_show_called_ = false;
163 bool is_incognito_; 164 bool is_incognito_;
164 165
165 // Accumulates the many events that have happened during the Payment Request. 166 // Accumulates the many events that have happened during the Payment Request.
166 int events_; 167 int events_;
167 168
168 const GURL url_; 169 const GURL url_;
169 170
170 // Not owned, will outlive this object. 171 // Not owned, will outlive this object.
171 ukm::UkmService* ukm_service_; 172 ukm::UkmService* ukm_service_;
172 173
173 DISALLOW_COPY_AND_ASSIGN(JourneyLogger); 174 DISALLOW_COPY_AND_ASSIGN(JourneyLogger);
174 }; 175 };
175 176
176 } // namespace payments 177 } // namespace payments
177 178
178 #endif // COMPONENTS_PAYMENTS_CORE_JOURNEY_LOGGER_H_ 179 #endif // COMPONENTS_PAYMENTS_CORE_JOURNEY_LOGGER_H_
OLDNEW
« no previous file with comments | « components/payments/core/autofill_payment_instrument_unittest.cc ('k') | components/payments/core/journey_logger.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698