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

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

Issue 2904083003: [Payments] Use C++ metric enums in Java. (Closed)
Patch Set: Enum rename for Windows 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 #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 224 matching lines...) Expand 10 before | Expand all | Expand 10 after
235 RecordCanMakePaymentEffectOnShow(); 235 RecordCanMakePaymentEffectOnShow();
236 RecordCanMakePaymentEffectOnCompletion(completion_status); 236 RecordCanMakePaymentEffectOnCompletion(completion_status);
237 } 237 }
238 238
239 void JourneyLogger::RecordCanMakePaymentEffectOnShow() { 239 void JourneyLogger::RecordCanMakePaymentEffectOnShow() {
240 if (!was_can_make_payments_used_) 240 if (!was_can_make_payments_used_)
241 return; 241 return;
242 242
243 int effect_on_show = 0; 243 int effect_on_show = 0;
244 if (was_show_called_) 244 if (was_show_called_)
245 effect_on_show |= CMP_SHOW_DID_SHOW; 245 effect_on_show |= CMP_EFFECT_ON_SHOW_DID_SHOW;
246 if (could_make_payment_) 246 if (could_make_payment_)
247 effect_on_show |= CMP_SHOW_COULD_MAKE_PAYMENT; 247 effect_on_show |= CMP_EFFECT_ON_SHOW_COULD_MAKE_PAYMENT;
248 248
249 UMA_HISTOGRAM_ENUMERATION("PaymentRequest.CanMakePayment.Used.EffectOnShow", 249 UMA_HISTOGRAM_ENUMERATION("PaymentRequest.CanMakePayment.Used.EffectOnShow",
250 effect_on_show, CMP_SHOW_MAX); 250 effect_on_show, CMP_EFFECT_ON_SHOW_MAX);
251 } 251 }
252 252
253 void JourneyLogger::RecordCanMakePaymentEffectOnCompletion( 253 void JourneyLogger::RecordCanMakePaymentEffectOnCompletion(
254 CompletionStatus completion_status) { 254 CompletionStatus completion_status) {
255 if (!was_show_called_) 255 if (!was_show_called_)
256 return; 256 return;
257 257
258 std::string histogram_name = "PaymentRequest.CanMakePayment."; 258 std::string histogram_name = "PaymentRequest.CanMakePayment.";
259 if (!was_can_make_payments_used_) { 259 if (!was_can_make_payments_used_) {
260 histogram_name += "NotUsed.WithShowEffectOnCompletion"; 260 histogram_name += "NotUsed.WithShowEffectOnCompletion";
(...skipping 16 matching lines...) Expand all
277 ukm_recorder_->UpdateSourceURL(source_id, url_); 277 ukm_recorder_->UpdateSourceURL(source_id, url_);
278 std::unique_ptr<ukm::UkmEntryBuilder> builder = 278 std::unique_ptr<ukm::UkmEntryBuilder> builder =
279 ukm_recorder_->GetEntryBuilder(source_id, 279 ukm_recorder_->GetEntryBuilder(source_id,
280 internal::kUKMCheckoutEventsEntryName); 280 internal::kUKMCheckoutEventsEntryName);
281 builder->AddMetric(internal::kUKMCompletionStatusMetricName, 281 builder->AddMetric(internal::kUKMCompletionStatusMetricName,
282 completion_status); 282 completion_status);
283 builder->AddMetric(internal::kUKMEventsMetricName, events_); 283 builder->AddMetric(internal::kUKMEventsMetricName, events_);
284 } 284 }
285 285
286 } // namespace payments 286 } // namespace payments
OLDNEW
« no previous file with comments | « components/payments/core/journey_logger.h ('k') | components/payments/core/journey_logger_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698