#include "components/autofill/core/browser/form_parsing/address_field_parser.h"
#include <stddef.h>
#include <memory>
#include <string>
#include <string_view>
#include <utility>
#include "base/check.h"
#include "components/autofill/core/browser/autofill_field.h"
#include "components/autofill/core/browser/data_model/autofill_i18n_api.h"
#include "components/autofill/core/browser/field_types.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) { … }
base::span<const MatchPatternRef> GetMatchPatterns(FieldType type,
ParsingContext& context) { … }
bool SetFieldAndAdvanceCursor(AutofillScanner* scanner,
raw_ptr<AutofillField>* field) { … }
MatchParams WithoutAttribute(MatchParams p, MatchAttribute attribute) { … }
MatchParams WithFieldType(MatchParams p, FormControlType field_type) { … }
}
std::unique_ptr<FormFieldParser> AddressFieldParser::Parse(
ParsingContext& context,
AutofillScanner* scanner) { … }
bool AddressFieldParser::IsStandaloneZipSupported(
const GeoIpCountryCode& client_country) { … }
std::unique_ptr<FormFieldParser> AddressFieldParser::ParseStandaloneZip(
ParsingContext& context,
AutofillScanner* scanner) { … }
AddressFieldParser::AddressFieldParser() = default;
void AddressFieldParser::AddClassifications(
FieldCandidatesMap& field_candidates) const { … }
bool AddressFieldParser::ParseCompany(ParsingContext& context,
AutofillScanner* scanner) { … }
bool AddressFieldParser::ParseAddressFieldSequence(ParsingContext& context,
AutofillScanner* scanner) { … }
bool AddressFieldParser::ParseAddress(ParsingContext& context,
AutofillScanner* scanner) { … }
bool AddressFieldParser::ParseAddressLines(ParsingContext& context,
AutofillScanner* scanner) { … }
bool AddressFieldParser::ParseZipCode(ParsingContext& context,
AutofillScanner* scanner) { … }
bool AddressFieldParser::ParseCity(ParsingContext& context,
AutofillScanner* scanner) { … }
bool AddressFieldParser::ParseState(ParsingContext& context,
AutofillScanner* scanner) { … }
AddressFieldParser::ParseNameLabelResult
AddressFieldParser::ParseNameAndLabelSeparately(
ParsingContext& context,
AutofillScanner* scanner,
base::span<const MatchPatternRef> patterns,
raw_ptr<AutofillField>* match,
const char* regex_name) { … }
bool AddressFieldParser::ParseAddressField(ParsingContext& context,
AutofillScanner* scanner) { … }
AddressFieldParser::ParseNameLabelResult
AddressFieldParser::ParseNameAndLabelForZipCode(ParsingContext& context,
AutofillScanner* scanner) { … }
AddressFieldParser::ParseNameLabelResult
AddressFieldParser::ParseNameAndLabelForDependentLocality(
ParsingContext& context,
AutofillScanner* scanner) { … }
AddressFieldParser::ParseNameLabelResult
AddressFieldParser::ParseNameAndLabelForCity(ParsingContext& context,
AutofillScanner* scanner) { … }
AddressFieldParser::ParseNameLabelResult
AddressFieldParser::ParseNameAndLabelForState(ParsingContext& context,
AutofillScanner* scanner) { … }
AddressFieldParser::ParseNameLabelResult
AddressFieldParser::ParseNameAndLabelForCountry(ParsingContext& context,
AutofillScanner* scanner) { … }
AddressFieldParser::ParseNameLabelResult
AddressFieldParser::ParseNameAndLabelForBetweenStreetsOrLandmark(
ParsingContext& context,
AutofillScanner* scanner) { … }
AddressFieldParser::ParseNameLabelResult
AddressFieldParser::ParseNameAndLabelForOverflowAndLandmark(
ParsingContext& context,
AutofillScanner* scanner) { … }
AddressFieldParser::ParseNameLabelResult
AddressFieldParser::ParseNameAndLabelForOverflow(ParsingContext& context,
AutofillScanner* scanner) { … }
AddressFieldParser::ParseNameLabelResult
AddressFieldParser::ParseNameAndLabelForLandmark(ParsingContext& context,
AutofillScanner* scanner) { … }
AddressFieldParser::ParseNameLabelResult
AddressFieldParser::ParseNameAndLabelForBetweenStreets(
ParsingContext& context,
AutofillScanner* scanner) { … }
AddressFieldParser::ParseNameLabelResult
AddressFieldParser::ParseNameAndLabelForBetweenStreetsLines12(
ParsingContext& context,
AutofillScanner* scanner) { … }
AddressFieldParser::ParseNameLabelResult
AddressFieldParser::ParseNameAndLabelForAdminLevel2(ParsingContext& context,
AutofillScanner* scanner) { … }
bool AddressFieldParser::ParseFieldSpecificsForHouseNumberAndApt(
ParsingContext& context,
AutofillScanner* scanner) { … }
bool AddressFieldParser::PossiblyAStructuredAddressForm() const { … }
}