#include "components/autofill/core/browser/form_parsing/name_field_parser.h"
#include <memory>
#include <string_view>
#include "base/feature_list.h"
#include "base/memory/ptr_util.h"
#include "base/memory/raw_ptr.h"
#include "base/memory/raw_ptr_exclusion.h"
#include "base/strings/string_util.h"
#include "components/autofill/core/browser/autofill_type.h"
#include "components/autofill/core/browser/form_parsing/autofill_scanner.h"
#include "components/autofill/core/browser/form_parsing/regex_patterns.h"
#include "components/autofill/core/common/autofill_features.h"
#include "components/autofill/core/common/autofill_regex_constants.h"
namespace autofill {
namespace {
base::span<const MatchPatternRef> GetMatchPatterns(std::string_view name,
ParsingContext& context) { … }
class FullNameField : public NameFieldParser { … };
class FirstTwoLastNamesField : public NameFieldParser { … };
class FirstLastNameField : public NameFieldParser { … };
}
std::unique_ptr<FormFieldParser> NameFieldParser::Parse(
ParsingContext& context,
AutofillScanner* scanner) { … }
void NameFieldParser::AddClassifications(
FieldCandidatesMap& field_candidates) const { … }
std::unique_ptr<FullNameField> FullNameField::Parse(ParsingContext& context,
AutofillScanner* scanner) { … }
void FullNameField::AddClassifications(
FieldCandidatesMap& field_candidates) const { … }
FullNameField::FullNameField(AutofillField* field) : … { … }
FirstTwoLastNamesField::FirstTwoLastNamesField() = default;
std::unique_ptr<FirstTwoLastNamesField> FirstTwoLastNamesField::Parse(
ParsingContext& context,
AutofillScanner* scanner) { … }
std::unique_ptr<FirstTwoLastNamesField>
FirstTwoLastNamesField::ParseComponentNames(ParsingContext& context,
AutofillScanner* scanner) { … }
void FirstTwoLastNamesField::AddClassifications(
FieldCandidatesMap& field_candidates) const { … }
std::unique_ptr<FirstLastNameField>
FirstLastNameField::ParseNameSurnameLabelSequence(ParsingContext& context,
AutofillScanner* scanner) { … }
std::unique_ptr<FirstLastNameField>
FirstLastNameField::ParseSharedNameLabelSequence(ParsingContext& context,
AutofillScanner* scanner) { … }
std::unique_ptr<FirstLastNameField>
FirstLastNameField::ParseSpecificComponentSequence(ParsingContext& context,
AutofillScanner* scanner) { … }
std::unique_ptr<FirstLastNameField> FirstLastNameField::Parse(
ParsingContext& context,
AutofillScanner* scanner) { … }
FirstLastNameField::FirstLastNameField() = default;
void FirstLastNameField::AddClassifications(
FieldCandidatesMap& field_candidates) const { … }
}