Index: components/autofill/core/browser/form_structure.cc |
diff --git a/components/autofill/core/browser/form_structure.cc b/components/autofill/core/browser/form_structure.cc |
index fb32f01eb21ab5215ee82447679a7949546208c1..ce92faf4442646c3a250c06ac9befdbfd5bf0dff 100644 |
--- a/components/autofill/core/browser/form_structure.cc |
+++ b/components/autofill/core/browser/form_structure.cc |
@@ -680,12 +680,13 @@ void FormStructure::UpdateFromCache(const FormStructure& cached_form, |
form_signature_ = cached_form.form_signature_; |
} |
-void FormStructure::LogQualityMetrics(const base::TimeTicks& load_time, |
- const base::TimeTicks& interaction_time, |
- const base::TimeTicks& submission_time, |
- rappor::RapporServiceImpl* rappor_service, |
- bool did_show_suggestions, |
- bool observed_submission) const { |
+AutofillMetrics::AutofillFormSubmittedState FormStructure::LogQualityMetrics( |
+ const base::TimeTicks& load_time, |
+ const base::TimeTicks& interaction_time, |
+ const base::TimeTicks& submission_time, |
+ rappor::RapporServiceImpl* rappor_service, |
+ bool did_show_suggestions, |
+ bool observed_submission) const { |
size_t num_detected_field_types = 0; |
size_t num_server_mismatches = 0; |
size_t num_heuristic_mismatches = 0; |
@@ -790,25 +791,22 @@ void FormStructure::LogQualityMetrics(const base::TimeTicks& load_time, |
// We log "submission" and duration metrics if we are here after observing a |
// submission event. |
+ AutofillMetrics::AutofillFormSubmittedState state = |
sebsg
2017/04/10 19:20:19
I find it weird to return this value, but the func
csashi
2017/04/10 20:15:58
I noticed that LogQualityMetrics was already takin
|
+ AutofillMetrics::AUTOFILL_FORM_SUBMITTED_STATE_ENUM_SIZE; |
if (observed_submission) { |
if (num_detected_field_types < kRequiredFieldsForPredictionRoutines) { |
- AutofillMetrics::LogAutofillFormSubmittedState( |
- AutofillMetrics::NON_FILLABLE_FORM_OR_NEW_DATA); |
+ state = AutofillMetrics::NON_FILLABLE_FORM_OR_NEW_DATA; |
} else { |
if (did_autofill_all_possible_fields) { |
- AutofillMetrics::LogAutofillFormSubmittedState( |
- AutofillMetrics::FILLABLE_FORM_AUTOFILLED_ALL); |
+ state = AutofillMetrics::FILLABLE_FORM_AUTOFILLED_ALL; |
} else if (did_autofill_some_possible_fields) { |
- AutofillMetrics::LogAutofillFormSubmittedState( |
- AutofillMetrics::FILLABLE_FORM_AUTOFILLED_SOME); |
+ state = AutofillMetrics::FILLABLE_FORM_AUTOFILLED_SOME; |
} else if (!did_show_suggestions) { |
- AutofillMetrics::LogAutofillFormSubmittedState( |
- AutofillMetrics:: |
- FILLABLE_FORM_AUTOFILLED_NONE_DID_NOT_SHOW_SUGGESTIONS); |
+ state = AutofillMetrics:: |
+ FILLABLE_FORM_AUTOFILLED_NONE_DID_NOT_SHOW_SUGGESTIONS; |
} else { |
- AutofillMetrics::LogAutofillFormSubmittedState( |
- AutofillMetrics:: |
- FILLABLE_FORM_AUTOFILLED_NONE_DID_SHOW_SUGGESTIONS); |
+ state = |
+ AutofillMetrics::FILLABLE_FORM_AUTOFILLED_NONE_DID_SHOW_SUGGESTIONS; |
} |
// Log some RAPPOR metrics for problematic cases. |
@@ -856,6 +854,7 @@ void FormStructure::LogQualityMetrics(const base::TimeTicks& load_time, |
} |
} |
} |
+ return state; |
} |
void FormStructure::LogQualityMetricsBasedOnAutocomplete() const { |