Commit 2b10d833 authored by Maxim Kolosovskiy's avatar Maxim Kolosovskiy Committed by Commit Bot

[Autofill] Add |is_form_tag| to the server proto

Whether an uploaded form is a <form> tag or a list of unowned <input>s may be useful for server side analysis.
In particular, the list of unowned <input>s can contain several semantic forms (e.g. a search field,  sign-in form, sign-up form). The server side classifiers may apply special heuristics for the <form>less forms.

Bug: 552420, 910546
Change-Id: If4a5ec04eb1c0d87ec3a8cd399d84e3f5c31a692
Reviewed-on: https://chromium-review.googlesource.com/c/1394583
Commit-Queue: Maxim Kolosovskiy <kolos@chromium.org>
Reviewed-by: default avatarVadym Doroshenko <dvadym@chromium.org>
Cr-Commit-Position: refs/heads/master@{#619772}
parent 652ff752
...@@ -216,6 +216,7 @@ IN_PROC_BROWSER_TEST_F(AutofillServerTest, ...@@ -216,6 +216,7 @@ IN_PROC_BROWSER_TEST_F(AutofillServerTest,
upload.set_passwords_revealed(false); upload.set_passwords_revealed(false);
upload.set_submission_event( upload.set_submission_event(
AutofillUploadContents_SubmissionIndicatorEvent_HTML_FORM_SUBMISSION); AutofillUploadContents_SubmissionIndicatorEvent_HTML_FORM_SUBMISSION);
upload.set_has_form_tag(true);
test::FillUploadField(upload.add_field(), 2594484045U, "one", "text", nullptr, test::FillUploadField(upload.add_field(), 2594484045U, "one", "text", nullptr,
2U); 2U);
......
...@@ -575,6 +575,7 @@ bool FormStructure::EncodeUploadRequest( ...@@ -575,6 +575,7 @@ bool FormStructure::EncodeUploadRequest(
upload->set_autofill_used(form_was_autofilled); upload->set_autofill_used(form_was_autofilled);
upload->set_data_present(EncodeFieldTypes(available_field_types)); upload->set_data_present(EncodeFieldTypes(available_field_types));
upload->set_passwords_revealed(passwords_were_revealed_); upload->set_passwords_revealed(passwords_were_revealed_);
upload->set_has_form_tag(is_form_tag_);
if (!page_language_.empty() && randomized_encoder_ != nullptr) { if (!page_language_.empty() && randomized_encoder_ != nullptr) {
upload->set_language(page_language_); upload->set_language(page_language_);
} }
......
...@@ -185,7 +185,7 @@ message AutofillRandomizedFieldMetadata { ...@@ -185,7 +185,7 @@ message AutofillRandomizedFieldMetadata {
// This message contains information about the field types in a single form. // This message contains information about the field types in a single form.
// It is sent by the toolbar to contribute to the field type statistics. // It is sent by the toolbar to contribute to the field type statistics.
// Next available id: 37 // Next available id: 38
message AutofillUploadContents { message AutofillUploadContents {
required string client_version = 1; required string client_version = 1;
required fixed64 form_signature = 2; required fixed64 form_signature = 2;
...@@ -393,6 +393,9 @@ message AutofillUploadContents { ...@@ -393,6 +393,9 @@ message AutofillUploadContents {
// Titles of form's buttons. // Titles of form's buttons.
// TODO(850606): Deprecate once randomized metadata is launched. // TODO(850606): Deprecate once randomized metadata is launched.
repeated ButtonTitle button_title = 36; repeated ButtonTitle button_title = 36;
// Whether the fields are enclosed by a <form> tag or are unowned elements.
optional bool has_form_tag = 37;
} }
// This proto contains information about the validity of each field in an // This proto contains information about the validity of each field in an
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment