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

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

Issue 1010263002: [Autofill] Add FormEvent logging for "will submit form". (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: split Created 5 years, 9 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 57716f24441c8b656d00eb22bfc6184f468f26ab..0280961952922de0cfe60f2474f6473bf9807f92 100644
--- a/components/autofill/core/browser/autofill_metrics.cc
+++ b/components/autofill/core/browser/autofill_metrics.cc
@@ -522,9 +522,11 @@ AutofillMetrics::FormEventLogger::FormEventLogger(bool is_for_credit_card)
has_logged_suggestions_shown_(false),
has_logged_masked_server_card_suggestion_selected_(false),
has_logged_suggestion_filled_(false),
+ has_logged_will_submit_(false),
has_logged_submitted_(false),
logged_suggestion_filled_was_server_data_(false),
- logged_suggestion_filled_was_masked_server_card_(false) {};
+ logged_suggestion_filled_was_masked_server_card_(false) {
+}
void AutofillMetrics::FormEventLogger::OnDidInteractWithAutofillableForm() {
if (!has_logged_interacted_) {
@@ -597,7 +599,29 @@ void AutofillMetrics::FormEventLogger::OnDidFillSuggestion(
}
}
-void AutofillMetrics::FormEventLogger::OnDidSubmitForm() {
+void AutofillMetrics::FormEventLogger::OnWillSubmitForm() {
+ // Not logging this kind of form if we haven't logged a user interaction.
+ if (!has_logged_interacted_)
+ return;
+
+ // Not logging twice.
+ if (has_logged_will_submit_)
+ return;
+ has_logged_will_submit_ = true;
+
+ if (!has_logged_suggestion_filled_) {
+ Log(AutofillMetrics::FORM_EVENT_NO_SUGGESTION_WILL_SUBMIT_ONCE);
+ } else if (logged_suggestion_filled_was_masked_server_card_) {
+ Log(AutofillMetrics::
+ FORM_EVENT_MASKED_SERVER_CARD_SUGGESTION_WILL_SUBMIT_ONCE);
+ } else if (logged_suggestion_filled_was_server_data_) {
+ Log(AutofillMetrics::FORM_EVENT_SERVER_SUGGESTION_WILL_SUBMIT_ONCE);
+ } else {
+ Log(AutofillMetrics::FORM_EVENT_LOCAL_SUGGESTION_WILL_SUBMIT_ONCE);
+ }
+}
+
+void AutofillMetrics::FormEventLogger::OnFormSubmitted() {
// Not logging this kind of form if we haven't logged a user interaction.
if (!has_logged_interacted_)
return;
« 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