Chromium Code Reviews| 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 02e861fe9c2a9a7076100f8dc5cd20968a3c1d6b..8c09e0ba28523885b61a480e0cc669fa7fc92243 100644 |
| --- a/components/autofill/core/browser/form_structure.cc |
| +++ b/components/autofill/core/browser/form_structure.cc |
| @@ -268,6 +268,9 @@ HtmlFieldType FieldTypeFromAutocompleteAttributeValue( |
| if (autocomplete_attribute_value == "email") |
| return HTML_TYPE_EMAIL; |
| + if (autocomplete_attribute_value == "upi-vpa") |
| + return HTML_TYPE_UPI_VPA; |
| + |
| return HTML_TYPE_UNRECOGNIZED; |
| } |
| @@ -300,6 +303,7 @@ FormStructure::FormStructure(const FormData& form) |
| upload_required_(USE_UPLOAD_RATES), |
| has_author_specified_types_(false), |
| has_author_specified_sections_(false), |
| + has_author_specified_upi_vpa_hint_(false), |
| was_parsed_for_autocomplete_attributes_(false), |
| has_password_field_(false), |
| is_form_tag_(form.is_form_tag), |
| @@ -366,6 +370,11 @@ void FormStructure::DetermineHeuristicTypes() { |
| } |
| } |
| + if (has_author_specified_upi_vpa_hint()) { |
|
Mathieu
2017/03/28 19:14:12
why not has_author_specified_upi_vpa_hint_
Roger McFarlane (Chromium)
2017/03/28 19:37:20
Done.
|
| + AutofillMetrics::LogDeveloperEngagementMetric( |
| + AutofillMetrics::FORM_CONTAINS_UPI_VPA_HINT); |
| + } |
| + |
| AutofillMetrics::LogDetermineHeuristicTypesTiming( |
| base::TimeTicks::Now() - determine_heuristic_types_start_time); |
| } |
| @@ -887,6 +896,7 @@ void FormStructure::ParseFieldTypesFromAutocompleteAttributes() { |
| has_author_specified_types_ = false; |
| has_author_specified_sections_ = false; |
| + has_author_specified_upi_vpa_hint_ = false; |
| for (const auto& field : fields_) { |
| // To prevent potential section name collisions, add a default suffix for |
| // other fields. Without this, 'autocomplete' attribute values |
| @@ -924,6 +934,11 @@ void FormStructure::ParseFieldTypesFromAutocompleteAttributes() { |
| tokens.pop_back(); |
| HtmlFieldType field_type = |
| FieldTypeFromAutocompleteAttributeValue(field_type_token, *field); |
| + if (field_type == HTML_TYPE_UPI_VPA) { |
| + has_author_specified_upi_vpa_hint_ = true; |
| + // TODO(crbug/702223): Flesh out support for UPI-VPA. |
| + field_type = HTML_TYPE_UNRECOGNIZED; |
| + } |
| if (field_type == HTML_TYPE_UNSPECIFIED) |
| continue; |