| 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..745504367d37659133da037244015d924a2b115a 100644
|
| --- a/components/autofill/core/browser/form_structure.cc
|
| +++ b/components/autofill/core/browser/form_structure.cc
|
| @@ -680,12 +680,14 @@ 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 {
|
| +void FormStructure::LogQualityMetrics(
|
| + const base::TimeTicks& load_time,
|
| + const base::TimeTicks& interaction_time,
|
| + const base::TimeTicks& submission_time,
|
| + rappor::RapporServiceImpl* rappor_service,
|
| + AutofillMetrics::FormInteractionsUkmLogger* form_interactions_ukm_logger,
|
| + 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;
|
| @@ -791,24 +793,20 @@ void FormStructure::LogQualityMetrics(const base::TimeTicks& load_time,
|
| // We log "submission" and duration metrics if we are here after observing a
|
| // submission event.
|
| if (observed_submission) {
|
| + AutofillMetrics::AutofillFormSubmittedState state;
|
| 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.
|
| @@ -855,6 +853,10 @@ void FormStructure::LogQualityMetrics(const base::TimeTicks& load_time,
|
| }
|
| }
|
| }
|
| + if (form_interactions_ukm_logger->url() != source_url())
|
| + form_interactions_ukm_logger->set_url(source_url());
|
| + AutofillMetrics::LogAutofillFormSubmittedState(
|
| + state, form_interactions_ukm_logger);
|
| }
|
| }
|
|
|
|
|