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

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

Issue 1874493002: [Autofill] Add user actions for checkout flow. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 8 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 f39d393a73fc0a47faab845d64e2d99abb724560..b6390e5083df96b4c39151001f00a8e606cc70f8 100644
--- a/components/autofill/core/browser/autofill_metrics.cc
+++ b/components/autofill/core/browser/autofill_metrics.cc
@@ -9,6 +9,7 @@
#include "base/logging.h"
#include "base/metrics/histogram_macros.h"
#include "base/metrics/sparse_histogram.h"
+#include "base/metrics/user_metrics.h"
#include "base/time/time.h"
#include "components/autofill/core/browser/autofill_type.h"
#include "components/autofill/core/browser/form_structure.h"
@@ -650,6 +651,8 @@ void AutofillMetrics::LogAutofillSuggestionAcceptedIndex(int index) {
// A maximum of 50 is enforced to minimize the number of buckets generated.
UMA_HISTOGRAM_SPARSE_SLOWLY("Autofill.SuggestionAcceptedIndex",
std::min(index, 50));
+
+ base::RecordAction(base::UserMetricsAction("Autofill_SelectedSuggestion"));
}
// static
@@ -725,11 +728,20 @@ void AutofillMetrics::FormEventLogger::OnDidInteractWithAutofillableForm() {
}
}
-void AutofillMetrics::FormEventLogger::OnDidShowSuggestions() {
+void AutofillMetrics::FormEventLogger::OnDidShowSuggestions(
+ bool is_credit_card) {
Log(AutofillMetrics::FORM_EVENT_SUGGESTIONS_SHOWN);
if (!has_logged_suggestions_shown_) {
Mathieu 2016/04/11 16:45:45 I'm wondering if the action log should be put in t
sebsg 2016/04/12 14:40:59 Done.
has_logged_suggestions_shown_ = true;
Log(AutofillMetrics::FORM_EVENT_SUGGESTIONS_SHOWN_ONCE);
+
+ if (is_credit_card) {
+ base::RecordAction(
+ base::UserMetricsAction("Autofill_ShowedCreditCardSuggestions"));
+ } else {
+ base::RecordAction(
+ base::UserMetricsAction("Autofill_ShowedProfileSuggestions"));
+ }
}
}
@@ -769,6 +781,9 @@ void AutofillMetrics::FormEventLogger::OnDidFillSuggestion(
Log(AutofillMetrics::FORM_EVENT_LOCAL_SUGGESTION_FILLED_ONCE);
}
}
+
+ base::RecordAction(
+ base::UserMetricsAction("Autofill_FilledCreditCardSuggestion"));
}
void AutofillMetrics::FormEventLogger::OnDidFillSuggestion(
@@ -787,6 +802,9 @@ void AutofillMetrics::FormEventLogger::OnDidFillSuggestion(
? AutofillMetrics::FORM_EVENT_SERVER_SUGGESTION_FILLED_ONCE
: AutofillMetrics::FORM_EVENT_LOCAL_SUGGESTION_FILLED_ONCE);
}
+
+ base::RecordAction(
+ base::UserMetricsAction("Autofill_FilledProfileSuggestion"));
}
void AutofillMetrics::FormEventLogger::OnWillSubmitForm() {
@@ -831,6 +849,8 @@ void AutofillMetrics::FormEventLogger::OnFormSubmitted() {
} else {
Log(AutofillMetrics::FORM_EVENT_LOCAL_SUGGESTION_SUBMITTED_ONCE);
}
+
+ base::RecordAction(base::UserMetricsAction("Autofill_FormSubmitted"));
}
void AutofillMetrics::FormEventLogger::Log(FormEvent event) const {

Powered by Google App Engine
This is Rietveld 408576698