Index: components/autofill/core/browser/autofill_metrics.cc |
diff --git a/components/autofill/core/browser/autofill_metrics.cc b/components/autofill/core/browser/autofill_metrics.cc |
index e631f1dfd66e84505ebb6d5659c2ea3614b73846..670ec072207bac90de1d27fa5dd92690fa8af54b 100644 |
--- a/components/autofill/core/browser/autofill_metrics.cc |
+++ b/components/autofill/core/browser/autofill_metrics.cc |
@@ -856,8 +856,9 @@ void AutofillMetrics::FormEventLogger::OnDidPollSuggestions( |
} |
} |
-void AutofillMetrics::FormEventLogger::OnDidShowSuggestions() { |
- form_interactions_ukm_logger_->LogSuggestionsShown(); |
+void AutofillMetrics::FormEventLogger::OnDidShowSuggestions( |
+ const AutofillField& field) { |
+ form_interactions_ukm_logger_->LogSuggestionsShown(field); |
Log(AutofillMetrics::FORM_EVENT_SUGGESTIONS_SHOWN); |
if (!has_logged_suggestions_shown_) { |
@@ -1063,7 +1064,8 @@ void AutofillMetrics::FormInteractionsUkmLogger::LogInteractedWithForm( |
server_record_type_count); |
} |
-void AutofillMetrics::FormInteractionsUkmLogger::LogSuggestionsShown() { |
+void AutofillMetrics::FormInteractionsUkmLogger::LogSuggestionsShown( |
+ const AutofillField& field) { |
if (!CanLog()) |
return; |
@@ -1073,6 +1075,12 @@ void AutofillMetrics::FormInteractionsUkmLogger::LogSuggestionsShown() { |
std::unique_ptr<ukm::UkmEntryBuilder> builder = |
ukm_recorder_->GetEntryBuilder(source_id_, |
internal::kUKMSuggestionsShownEntryName); |
+ builder->AddMetric(internal::kUKMHeuristicTypeMetricName, |
+ static_cast<int>(field.heuristic_type())); |
+ builder->AddMetric(internal::kUKMHtmlFieldTypeMetricName, |
+ static_cast<int>(field.html_type())); |
+ builder->AddMetric(internal::kUKMServerTypeMetricName, |
+ static_cast<int>(field.server_type())); |
builder->AddMetric(internal::kUKMMillisecondsSinceFormParsedMetricName, |
MillisecondsSinceFormParsed()); |
} |