| Index: chrome/browser/autofill/form_structure.cc
|
| diff --git a/chrome/browser/autofill/form_structure.cc b/chrome/browser/autofill/form_structure.cc
|
| index 67f05fdf467c460ac6500027af5d2bc47ba18342..6bf227d382647d97f840fa2247f3965e661cfe29 100644
|
| --- a/chrome/browser/autofill/form_structure.cc
|
| +++ b/chrome/browser/autofill/form_structure.cc
|
| @@ -635,6 +635,7 @@ void FormStructure::LogQualityMetrics(
|
| std::string experiment_id = server_experiment_id();
|
| metric_logger.LogServerExperimentIdForUpload(experiment_id);
|
|
|
| + size_t num_detected_field_types = 0;
|
| for (size_t i = 0; i < field_count(); ++i) {
|
| const AutofillField* field = this->field(i);
|
| metric_logger.LogQualityMetric(AutofillMetrics::FIELD_SUBMITTED,
|
| @@ -647,6 +648,8 @@ void FormStructure::LogQualityMetrics(
|
| if (field_types.count(EMPTY_TYPE) || field_types.count(UNKNOWN_TYPE))
|
| continue;
|
|
|
| + ++num_detected_field_types;
|
| +
|
| // Collapse field types that Chrome treats as identical, e.g. home and
|
| // billing address fields.
|
| FieldTypeSet collapsed_field_types;
|
| @@ -750,16 +753,11 @@ void FormStructure::LogQualityMetrics(
|
| }
|
| }
|
| }
|
| -}
|
|
|
| -void FormStructure::set_possible_types(size_t index,
|
| - const FieldTypeSet& types) {
|
| - if (index >= fields_.size()) {
|
| - NOTREACHED();
|
| - return;
|
| + if (num_detected_field_types >= kRequiredFillableFields) {
|
| + metric_logger.LogUserHappinessMetric(
|
| + AutofillMetrics::SUBMITTED_FORM_COULD_HAVE_BEEN_AUTOFILLED);
|
| }
|
| -
|
| - fields_[index]->set_possible_types(types);
|
| }
|
|
|
| const AutofillField* FormStructure::field(size_t index) const {
|
| @@ -771,6 +769,11 @@ const AutofillField* FormStructure::field(size_t index) const {
|
| return fields_[index];
|
| }
|
|
|
| +AutofillField* FormStructure::field(size_t index) {
|
| + return const_cast<AutofillField*>(
|
| + static_cast<const FormStructure*>(this)->field(index));
|
| +}
|
| +
|
| size_t FormStructure::field_count() const {
|
| return fields_.size();
|
| }
|
|
|