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

Unified Diff: components/autofill/core/browser/autofill_metrics.cc

Issue 2839063004: [Autofill] UKM for suggestions polled field. (Closed)
Patch Set: Address comments Created 3 years, 7 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 side-by-side diff with in-line comments
Download patch
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());
}
« no previous file with comments | « components/autofill/core/browser/autofill_metrics.h ('k') | components/autofill/core/browser/autofill_metrics_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698