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

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

Issue 2917343003: Merge-60 [Payments] Move the SelectedPaymentMethod 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 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 147 matching lines...) Expand 10 before | Expand all | Expand 10 after
158 // Records the fact that the merchant called CanMakePayment and records it's 158 // Records the fact that the merchant called CanMakePayment and records it's
159 // return value. 159 // return value.
160 void SetCanMakePaymentValue(bool value); 160 void SetCanMakePaymentValue(bool value);
161 161
162 // Records the fact that the Payment Request was shown to the user. 162 // Records the fact that the Payment Request was shown to the user.
163 void SetShowCalled(); 163 void SetShowCalled();
164 164
165 // Records that an event occurred. 165 // Records that an event occurred.
166 void SetEventOccurred(Event event); 166 void SetEventOccurred(Event event);
167 167
168 // Records the payment method that was used to complete the Payment Request.
169 void SetSelectedPaymentMethod(SelectedPaymentMethod payment_method);
170
168 // Records that the Payment Request was completed successfully, and starts the 171 // Records that the Payment Request was completed successfully, and starts the
169 // logging of all the journey metrics. 172 // logging of all the journey metrics.
170 void SetCompleted(); 173 void SetCompleted();
171 174
172 // Records that the Payment Request was aborted along with the reason. Also 175 // Records that the Payment Request was aborted along with the reason. Also
173 // starts the logging of all the journey metrics. 176 // starts the logging of all the journey metrics.
174 void SetAborted(AbortReason reason); 177 void SetAborted(AbortReason reason);
175 178
176 #ifdef OS_ANDROID 179 #ifdef OS_ANDROID
177 // Records that the Payment Request was not shown to the user, along with the 180 // Records that the Payment Request was not shown to the user, along with the
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
209 // Records the histograms for all the sections that were requested by the 212 // Records the histograms for all the sections that were requested by the
210 // merchant and for the usage of the CanMakePayment method and its effect on 213 // merchant and for the usage of the CanMakePayment method and its effect on
211 // the transaction. This method should be called when the Payment Request has 214 // the transaction. This method should be called when the Payment Request has
212 // either been completed or aborted. 215 // either been completed or aborted.
213 void RecordJourneyStatsHistograms(CompletionStatus completion_status); 216 void RecordJourneyStatsHistograms(CompletionStatus completion_status);
214 217
215 // Records the histograms for all the steps of a complete checkout flow that 218 // Records the histograms for all the steps of a complete checkout flow that
216 // were reached. 219 // were reached.
217 void RecordCheckoutFlowMetrics(); 220 void RecordCheckoutFlowMetrics();
218 221
222 // Records the metric about the selected payment method.
223 void RecordPaymentMethodMetric();
224
219 // Records the histograms for all the sections that were requested by the 225 // Records the histograms for all the sections that were requested by the
220 // merchant. 226 // merchant.
221 void RecordSectionSpecificStats(CompletionStatus completion_status); 227 void RecordSectionSpecificStats(CompletionStatus completion_status);
222 228
223 // Records the metrics related the the CanMakePayment method unless in 229 // Records the metrics related the the CanMakePayment method unless in
224 // incognito mode. 230 // incognito mode.
225 void RecordCanMakePaymentStats(CompletionStatus completion_status); 231 void RecordCanMakePaymentStats(CompletionStatus completion_status);
226 232
227 // Records CanMakePayment's return value effect on whether the Payment Request 233 // Records CanMakePayment's return value effect on whether the Payment Request
228 // was shown or not. 234 // was shown or not.
(...skipping 10 matching lines...) Expand all
239 SectionStats sections_[NUMBER_OF_SECTIONS]; 245 SectionStats sections_[NUMBER_OF_SECTIONS];
240 bool has_recorded_ = false; 246 bool has_recorded_ = false;
241 bool was_can_make_payments_used_ = false; 247 bool was_can_make_payments_used_ = false;
242 bool could_make_payment_ = false; 248 bool could_make_payment_ = false;
243 bool was_show_called_ = false; 249 bool was_show_called_ = false;
244 bool is_incognito_; 250 bool is_incognito_;
245 251
246 // Accumulates the many events that have happened during the Payment Request. 252 // Accumulates the many events that have happened during the Payment Request.
247 int events_; 253 int events_;
248 254
255 // To keep track of the selected payment method.
256 SelectedPaymentMethod payment_method_ = SELECTED_PAYMENT_METHOD_MAX;
257
249 const GURL url_; 258 const GURL url_;
250 259
251 // Not owned, will outlive this object. 260 // Not owned, will outlive this object.
252 ukm::UkmRecorder* ukm_recorder_; 261 ukm::UkmRecorder* ukm_recorder_;
253 262
254 DISALLOW_COPY_AND_ASSIGN(JourneyLogger); 263 DISALLOW_COPY_AND_ASSIGN(JourneyLogger);
255 }; 264 };
256 265
257 } // namespace payments 266 } // namespace payments
258 267
259 #endif // COMPONENTS_PAYMENTS_CORE_JOURNEY_LOGGER_H_ 268 #endif // COMPONENTS_PAYMENTS_CORE_JOURNEY_LOGGER_H_
OLDNEW
« no previous file with comments | « chrome/browser/payments/android/journey_logger_android.cc ('k') | components/payments/core/journey_logger.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698