Chromium Code Reviews| 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; |