OLD | NEW |
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" |
11 #include "url/gurl.h" | 11 #include "url/gurl.h" |
12 | 12 |
13 namespace ukm { | 13 namespace ukm { |
14 class UkmService; | 14 class UkmRecorder; |
15 } | 15 } |
16 | 16 |
17 namespace payments { | 17 namespace payments { |
18 | 18 |
19 namespace internal { | 19 namespace internal { |
20 // Name constants are exposed here so they can be referenced from tests. | 20 // Name constants are exposed here so they can be referenced from tests. |
21 extern const char kUKMCheckoutEventsEntryName[]; | 21 extern const char kUKMCheckoutEventsEntryName[]; |
22 extern const char kUKMCompletionStatusMetricName[]; | 22 extern const char kUKMCompletionStatusMetricName[]; |
23 extern const char kUKMEventsMetricName[]; | 23 extern const char kUKMEventsMetricName[]; |
24 } // namespace internal | 24 } // namespace internal |
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
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, |
80 const GURL& url, | 80 const GURL& url, |
81 ukm::UkmService* ukm_service); | 81 ukm::UkmRecorder* ukm_recorder); |
82 ~JourneyLogger(); | 82 ~JourneyLogger(); |
83 | 83 |
84 // Increments the number of selection adds for the specified section. | 84 // Increments the number of selection adds for the specified section. |
85 void IncrementSelectionAdds(Section section); | 85 void IncrementSelectionAdds(Section section); |
86 | 86 |
87 // Increments the number of selection changes for the specified section. | 87 // Increments the number of selection changes for the specified section. |
88 void IncrementSelectionChanges(Section section); | 88 void IncrementSelectionChanges(Section section); |
89 | 89 |
90 // Increments the number of selection edits for the specified section. | 90 // Increments the number of selection edits for the specified section. |
91 void IncrementSelectionEdits(Section section); | 91 void IncrementSelectionEdits(Section section); |
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
166 bool could_make_payment_ = false; | 166 bool could_make_payment_ = false; |
167 bool was_show_called_ = false; | 167 bool was_show_called_ = false; |
168 bool is_incognito_; | 168 bool is_incognito_; |
169 | 169 |
170 // Accumulates the many events that have happened during the Payment Request. | 170 // Accumulates the many events that have happened during the Payment Request. |
171 int events_; | 171 int events_; |
172 | 172 |
173 const GURL url_; | 173 const GURL url_; |
174 | 174 |
175 // Not owned, will outlive this object. | 175 // Not owned, will outlive this object. |
176 ukm::UkmService* ukm_service_; | 176 ukm::UkmRecorder* ukm_recorder_; |
177 | 177 |
178 DISALLOW_COPY_AND_ASSIGN(JourneyLogger); | 178 DISALLOW_COPY_AND_ASSIGN(JourneyLogger); |
179 }; | 179 }; |
180 | 180 |
181 } // namespace payments | 181 } // namespace payments |
182 | 182 |
183 #endif // COMPONENTS_PAYMENTS_CORE_JOURNEY_LOGGER_H_ | 183 #endif // COMPONENTS_PAYMENTS_CORE_JOURNEY_LOGGER_H_ |
OLD | NEW |