Commit 08161a3b authored by Dominic Battre's avatar Dominic Battre Committed by Commit Bot

Fix form type classification

Unfillable form fields should not label a form as an "Address form".

Bug: 1043150
Change-Id: I47916142f32eb36df0c08d6897f2d36de3b86df5
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2007811
Commit-Queue: Dominic Battré <battre@chromium.org>
Commit-Queue: Vadym Doroshenko <dvadym@chromium.org>
Auto-Submit: Dominic Battré <battre@chromium.org>
Reviewed-by: default avatarVadym Doroshenko <dvadym@chromium.org>
Cr-Commit-Position: refs/heads/master@{#732926}
parent 7f0c7c09
...@@ -10,6 +10,15 @@ namespace autofill { ...@@ -10,6 +10,15 @@ namespace autofill {
// static // static
FormType FormTypes::FieldTypeGroupToFormType(FieldTypeGroup field_type_group) { FormType FormTypes::FieldTypeGroupToFormType(FieldTypeGroup field_type_group) {
switch (field_type_group) { switch (field_type_group) {
case NAME:
case NAME_BILLING:
case EMAIL:
case COMPANY:
case ADDRESS_HOME:
case ADDRESS_BILLING:
case PHONE_HOME:
case PHONE_BILLING:
return ADDRESS_FORM;
case CREDIT_CARD: case CREDIT_CARD:
return CREDIT_CARD_FORM; return CREDIT_CARD_FORM;
case USERNAME_FIELD: case USERNAME_FIELD:
...@@ -17,10 +26,8 @@ FormType FormTypes::FieldTypeGroupToFormType(FieldTypeGroup field_type_group) { ...@@ -17,10 +26,8 @@ FormType FormTypes::FieldTypeGroupToFormType(FieldTypeGroup field_type_group) {
return PASSWORD_FORM; return PASSWORD_FORM;
case NO_GROUP: case NO_GROUP:
case TRANSACTION: case TRANSACTION:
case UNFILLABLE:
return UNKNOWN_FORM_TYPE; return UNKNOWN_FORM_TYPE;
default:
// Assuming it's an address form by process of elimination.
return ADDRESS_FORM;
} }
} }
} // namespace autofill } // namespace autofill
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