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

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

Issue 2111863002: [Autofill] Debounce suggestions poll user actions for the same field. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 6 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 be8e8ef8513b0bbbeaedf265f55f1f731155c01e..9fd4a5f4302027ef0d8e2452c89b43e76de10b0d 100644
--- a/components/autofill/core/browser/autofill_metrics.cc
+++ b/components/autofill/core/browser/autofill_metrics.cc
@@ -631,13 +631,22 @@ void AutofillMetrics::FormEventLogger::OnDidInteractWithAutofillableForm() {
}
}
-void AutofillMetrics::FormEventLogger::OnDidPollSuggestions() {
- if (is_for_credit_card_) {
- base::RecordAction(
- base::UserMetricsAction("Autofill_PolledCreditCardSuggestions"));
- } else {
- base::RecordAction(
- base::UserMetricsAction("Autofill_PolledProfileSuggestions"));
+void AutofillMetrics::FormEventLogger::OnDidPollSuggestions(
+ const FormFieldData& field) {
+ // Record only one poll user action for consecutive polls of the same field.
+ // This is to avoid recording too many poll actions (for example when a user
+ // types in a field, triggering multiple queries) to make the analysis more
+ // simple.
+ if (!field.SameFieldAs(last_polled_field_)) {
+ if (is_for_credit_card_) {
+ base::RecordAction(
+ base::UserMetricsAction("Autofill_PolledCreditCardSuggestions"));
+ } else {
+ base::RecordAction(
+ base::UserMetricsAction("Autofill_PolledProfileSuggestions"));
+ }
+
+ last_polled_field_ = field;
}
}
« 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