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

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

Issue 2839063004: [Autofill] UKM for suggestions polled field. (Closed)
Patch Set: Added ukm.xml and resolved conflict 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..6b67118a3549745d92f94a732d1c33490cb2b879 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;
@@ -1075,6 +1077,12 @@ void AutofillMetrics::FormInteractionsUkmLogger::LogSuggestionsShown() {
internal::kUKMSuggestionsShownEntryName);
builder->AddMetric(internal::kUKMMillisecondsSinceFormParsedMetricName,
MillisecondsSinceFormParsed());
csashi 2017/05/25 08:40:33 Move this metric to the end to be consistent with
jiahuiguo 2017/05/25 19:02:35 Done.
+ 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()));
}
void AutofillMetrics::FormInteractionsUkmLogger::LogSelectedMaskedServerCard() {

Powered by Google App Engine
This is Rietveld 408576698