#include "components/autofill/core/browser/form_parsing/credit_card_field_parser.h"
#include <stddef.h>
#include <memory>
#include <string>
#include <string_view>
#include <utility>
#include <vector>
#include "base/containers/contains.h"
#include "base/strings/string_number_conversions.h"
#include "base/strings/string_util.h"
#include "base/strings/utf_string_conversions.h"
#include "base/time/time.h"
#include "components/autofill/core/browser/autofill_field.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/form_field_parser.h"
#include "components/autofill/core/browser/form_parsing/regex_patterns.h"
#include "components/autofill/core/browser/select_control_util.h"
#include "components/autofill/core/common/autofill_clock.h"
#include "components/autofill/core/common/autofill_features.h"
#include "components/autofill/core/common/autofill_regex_constants.h"
#include "components/autofill/core/common/autofill_regexes.h"
#include "components/strings/grit/components_strings.h"
#include "ui/base/l10n/l10n_util.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 FieldCanFitDataForFieldType(uint64_t max_length, FieldType type) { … }
}
std::unique_ptr<FormFieldParser> CreditCardFieldParser::Parse(
ParsingContext& context,
AutofillScanner* scanner) { … }
bool CreditCardFieldParser::LikelyCardMonthSelectField(
AutofillScanner* scanner) { … }
bool CreditCardFieldParser::LikelyCardYearSelectField(
ParsingContext* context,
AutofillScanner* scanner) { … }
bool CreditCardFieldParser::LikelyCardTypeSelectField(
AutofillScanner* scanner) { … }
bool CreditCardFieldParser::IsGiftCardField(ParsingContext& context,
AutofillScanner* scanner) { … }
CreditCardFieldParser::CreditCardFieldParser()
: … { … }
CreditCardFieldParser::~CreditCardFieldParser() = default;
void CreditCardFieldParser::AddClassifications(
FieldCandidatesMap& field_candidates) const { … }
bool CreditCardFieldParser::ParseExpirationDate(ParsingContext& context,
AutofillScanner* scanner) { … }
FieldType CreditCardFieldParser::DetermineExpirationYearType(
const AutofillField& field,
FieldType fallback_type,
FieldType server_hint,
FieldType forced_field_type) { … }
FieldType CreditCardFieldParser::GetExpirationYearType() const { … }
bool CreditCardFieldParser::HasExpiration() const { … }
CreditCardFieldParser::ExpirationDateFormat
CreditCardFieldParser::DetermineExpirationDateFormat(
const AutofillField& field,
FieldType fallback_type,
FieldType server_hint,
FieldType forced_field_type) { … }
}