Skip to content

Commit

Permalink
Merge pull request #23481 from brave/payment-p3a-cr-fix
Browse files Browse the repository at this point in the history
Fix for payment method metric in preparation for CR126
  • Loading branch information
DJAndries authored May 8, 2024
2 parents f2adb96 + 64be68f commit 9d31cc1
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion components/misc_metrics/autofill_metrics.cc
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
#include "brave/components/misc_metrics/autofill_metrics.h"

#include "base/metrics/histogram_macros.h"
#include "components/autofill/core/browser/payments_data_manager.h"
#include "components/autofill/core/browser/personal_data_manager.h"

namespace misc_metrics {
Expand All @@ -25,7 +26,10 @@ void AutofillMetrics::OnPersonalDataChanged() {
}

void AutofillMetrics::ReportMetric() {
auto cards = personal_data_manager_->GetCreditCards();
if (!personal_data_manager_->IsDataLoaded()) {
return;
}
auto cards = personal_data_manager_->payments_data_manager().GetCreditCards();
UMA_HISTOGRAM_BOOLEAN(kPaymentMethodPresentHistogramName, !cards.empty());
}

Expand Down

0 comments on commit 9d31cc1

Please sign in to comment.