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

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

Issue 2883563002: Refactor UKM interface for mojo-ification (Closed)
Patch Set: Fix uma_session_stats.cc 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"
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
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 70 matching lines...) Expand 10 before | Expand all | Expand 10 after
162 bool could_make_payment_ = false; 162 bool could_make_payment_ = false;
163 bool was_show_called_ = false; 163 bool was_show_called_ = false;
164 bool is_incognito_; 164 bool is_incognito_;
165 165
166 // Accumulates the many events that have happened during the Payment Request. 166 // Accumulates the many events that have happened during the Payment Request.
167 int events_; 167 int events_;
168 168
169 const GURL url_; 169 const GURL url_;
170 170
171 // Not owned, will outlive this object. 171 // Not owned, will outlive this object.
172 ukm::UkmService* ukm_service_; 172 ukm::UkmRecorder* ukm_recorder_;
173 173
174 DISALLOW_COPY_AND_ASSIGN(JourneyLogger); 174 DISALLOW_COPY_AND_ASSIGN(JourneyLogger);
175 }; 175 };
176 176
177 } // namespace payments 177 } // namespace payments
178 178
179 #endif // COMPONENTS_PAYMENTS_CORE_JOURNEY_LOGGER_H_ 179 #endif // COMPONENTS_PAYMENTS_CORE_JOURNEY_LOGGER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698