Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(395)

Unified Diff: components/autofill/core/browser/form_structure.cc

Issue 2773433002: Log observations of explicit UPI-VPA autocomplete hints. (Closed)
Patch Set: fix a nit Created 3 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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..282a59aa9324e4f94d2de78a8899e081c005b4c7 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_) {
+ 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;
« no previous file with comments | « components/autofill/core/browser/form_structure.h ('k') | components/autofill/core/browser/form_structure_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698