| Index: components/autofill/core/browser/form_field.cc
|
| diff --git a/components/autofill/core/browser/form_field.cc b/components/autofill/core/browser/form_field.cc
|
| index 3d31c0bd59fee0bdbc150e8960e66cb4ec0ceaac..747e8f708998d304f5cf3f06df4710613bd4f938 100644
|
| --- a/components/autofill/core/browser/form_field.cc
|
| +++ b/components/autofill/core/browser/form_field.cc
|
| @@ -27,19 +27,6 @@
|
| #include "components/autofill/core/common/autofill_util.h"
|
|
|
| namespace autofill {
|
| -namespace {
|
| -
|
| -bool ShouldBeProcessed(const AutofillField* field) {
|
| - // Ignore checkable fields as they interfere with parsers assuming context.
|
| - // Eg., while parsing address, "Is PO box" checkbox after ADDRESS_LINE1
|
| - // interferes with correctly understanding ADDRESS_LINE2.
|
| - // Ignore fields marked as presentational. See
|
| - // http://www.w3.org/TR/wai-aria/roles#presentation
|
| - return !(IsCheckable(field->check_status) ||
|
| - field->role == FormFieldData::ROLE_ATTRIBUTE_PRESENTATION);
|
| -}
|
| -
|
| -} // namespace
|
|
|
| // There's an implicit precedence determined by the values assigned here. Email
|
| // is currently the most important followed by Phone, Address, Credit Card and
|
| @@ -52,12 +39,21 @@ const float FormField::kBaseNameParserScore = 1.0f;
|
|
|
| // static
|
| FieldCandidatesMap FormField::ParseFormFields(
|
| - const std::vector<AutofillField*>& fields,
|
| + const std::vector<std::unique_ptr<AutofillField>>& fields,
|
| bool is_form_tag) {
|
| // Set up a working copy of the fields to be processed.
|
| std::vector<AutofillField*> processed_fields;
|
| - std::copy_if(fields.begin(), fields.end(),
|
| - std::back_inserter(processed_fields), ShouldBeProcessed);
|
| + for (const auto& field : fields) {
|
| + // Ignore checkable fields as they interfere with parsers assuming context.
|
| + // Eg., while parsing address, "Is PO box" checkbox after ADDRESS_LINE1
|
| + // interferes with correctly understanding ADDRESS_LINE2.
|
| + // Ignore fields marked as presentational. See
|
| + // http://www.w3.org/TR/wai-aria/roles#presentation
|
| + if (!(IsCheckable(field->check_status) ||
|
| + field->role == FormFieldData::ROLE_ATTRIBUTE_PRESENTATION)) {
|
| + processed_fields.push_back(field.get());
|
| + }
|
| + }
|
|
|
| FieldCandidatesMap field_candidates;
|
|
|
|
|