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

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: logged once 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..1cdb877917e5d8ed0bafa7a3481ff602dc47388a 100644
--- a/components/autofill/core/browser/autofill_metrics.cc
+++ b/components/autofill/core/browser/autofill_metrics.cc
@@ -522,9 +522,10 @@ 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){};
Ilya Sherman 2015/03/23 20:58:16 nit: Please revert the diff on this line. Also, w
Mathieu 2015/03/23 21:11:28 This is the work of "git cl format" but removing t
void AutofillMetrics::FormEventLogger::OnDidInteractWithAutofillableForm() {
if (!has_logged_interacted_) {
@@ -597,7 +598,20 @@ 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;
+
+ Log(AutofillMetrics::FORM_EVENT_WILL_SUBMIT_ONCE);
Ilya Sherman 2015/03/23 20:58:16 Do we want to split up the WILL_SUBMIT_* metrics t
Mathieu 2015/03/23 21:11:28 Yes some forms will only emit WILL_SUBMIT_ONCE. I
Ilya Sherman 2015/03/23 23:58:17 I defer to Walter and Evan, but it does seem likel
+}
+
+void AutofillMetrics::FormEventLogger::OnFormSubmitted() {
// Not logging this kind of form if we haven't logged a user interaction.
if (!has_logged_interacted_)
return;

Powered by Google App Engine
This is Rietveld 408576698