| 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 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 65 } // namespace | 65 } // namespace |
| 66 | 66 |
| 67 JourneyLogger::JourneyLogger(bool is_incognito, | 67 JourneyLogger::JourneyLogger(bool is_incognito, |
| 68 const GURL& url, | 68 const GURL& url, |
| 69 ukm::UkmService* ukm_service) | 69 ukm::UkmService* ukm_service) |
| 70 : is_incognito_(is_incognito), | 70 : is_incognito_(is_incognito), |
| 71 events_(EVENT_INITIATED), | 71 events_(EVENT_INITIATED), |
| 72 url_(url), | 72 url_(url), |
| 73 ukm_service_(ukm_service) {} | 73 ukm_service_(ukm_service) {} |
| 74 | 74 |
| 75 JourneyLogger::~JourneyLogger() {} | 75 JourneyLogger::~JourneyLogger() { |
| 76 if (was_show_called_) |
| 77 DCHECK(has_recorded_); |
| 78 } |
| 76 | 79 |
| 77 void JourneyLogger::IncrementSelectionAdds(Section section) { | 80 void JourneyLogger::IncrementSelectionAdds(Section section) { |
| 78 DCHECK_LT(section, SECTION_MAX); | 81 DCHECK_LT(section, SECTION_MAX); |
| 79 sections_[section].number_selection_adds_++; | 82 sections_[section].number_selection_adds_++; |
| 80 } | 83 } |
| 81 | 84 |
| 82 void JourneyLogger::IncrementSelectionChanges(Section section) { | 85 void JourneyLogger::IncrementSelectionChanges(Section section) { |
| 83 DCHECK_LT(section, SECTION_MAX); | 86 DCHECK_LT(section, SECTION_MAX); |
| 84 sections_[section].number_selection_changes_++; | 87 sections_[section].number_selection_changes_++; |
| 85 } | 88 } |
| (...skipping 142 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 228 int32_t source_id = ukm_service_->GetNewSourceID(); | 231 int32_t source_id = ukm_service_->GetNewSourceID(); |
| 229 ukm_service_->UpdateSourceURL(source_id, url_); | 232 ukm_service_->UpdateSourceURL(source_id, url_); |
| 230 std::unique_ptr<ukm::UkmEntryBuilder> builder = ukm_service_->GetEntryBuilder( | 233 std::unique_ptr<ukm::UkmEntryBuilder> builder = ukm_service_->GetEntryBuilder( |
| 231 source_id, internal::kUKMCheckoutEventsEntryName); | 234 source_id, internal::kUKMCheckoutEventsEntryName); |
| 232 builder->AddMetric(internal::kUKMCompletionStatusMetricName, | 235 builder->AddMetric(internal::kUKMCompletionStatusMetricName, |
| 233 completion_status); | 236 completion_status); |
| 234 builder->AddMetric(internal::kUKMEventsMetricName, events_); | 237 builder->AddMetric(internal::kUKMEventsMetricName, events_); |
| 235 } | 238 } |
| 236 | 239 |
| 237 } // namespace payments | 240 } // namespace payments |
| OLD | NEW |