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 #include "components/payments/core/journey_logger.h" | 5 #include "components/payments/core/journey_logger.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 | 8 |
9 #include "base/metrics/histogram_functions.h" | 9 #include "base/metrics/histogram_functions.h" |
10 #include "base/metrics/histogram_macros.h" | 10 #include "base/metrics/histogram_macros.h" |
(...skipping 203 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
214 histogram_name += "Used.TrueWithShowEffectOnCompletion"; | 214 histogram_name += "Used.TrueWithShowEffectOnCompletion"; |
215 } else { | 215 } else { |
216 histogram_name += "Used.FalseWithShowEffectOnCompletion"; | 216 histogram_name += "Used.FalseWithShowEffectOnCompletion"; |
217 } | 217 } |
218 | 218 |
219 base::UmaHistogramEnumeration(histogram_name, completion_status, | 219 base::UmaHistogramEnumeration(histogram_name, completion_status, |
220 COMPLETION_STATUS_MAX); | 220 COMPLETION_STATUS_MAX); |
221 } | 221 } |
222 | 222 |
223 void JourneyLogger::RecordUrlKeyedMetrics(CompletionStatus completion_status) { | 223 void JourneyLogger::RecordUrlKeyedMetrics(CompletionStatus completion_status) { |
224 if (!autofill::IsUkmLoggingEnabled() || !ukm_service_ || !url_.is_valid()) | 224 if (!ukm_service_ || !url_.is_valid()) |
225 return; | 225 return; |
226 | 226 |
227 // Record the Checkout Funnel UKM. | 227 // Record the Checkout Funnel UKM. |
228 int32_t source_id = ukm_service_->GetNewSourceID(); | 228 int32_t source_id = ukm_service_->GetNewSourceID(); |
229 ukm_service_->UpdateSourceURL(source_id, url_); | 229 ukm_service_->UpdateSourceURL(source_id, url_); |
230 std::unique_ptr<ukm::UkmEntryBuilder> builder = ukm_service_->GetEntryBuilder( | 230 std::unique_ptr<ukm::UkmEntryBuilder> builder = ukm_service_->GetEntryBuilder( |
231 source_id, internal::kUKMCheckoutEventsEntryName); | 231 source_id, internal::kUKMCheckoutEventsEntryName); |
232 builder->AddMetric(internal::kUKMCompletionStatusMetricName, | 232 builder->AddMetric(internal::kUKMCompletionStatusMetricName, |
233 completion_status); | 233 completion_status); |
234 builder->AddMetric(internal::kUKMEventsMetricName, events_); | 234 builder->AddMetric(internal::kUKMEventsMetricName, events_); |
235 } | 235 } |
236 | 236 |
237 } // namespace payments | 237 } // namespace payments |
OLD | NEW |