#include "components/autofill/core/browser/autofill_data_util.h"
#include <array>
#include <iterator>
#include <string_view>
#include <vector>
#include "base/containers/contains.h"
#include "base/i18n/char_iterator.h"
#include "base/no_destructor.h"
#include "base/strings/string_split.h"
#include "base/strings/string_util.h"
#include "base/strings/utf_string_conversions.h"
#include "build/branding_buildflags.h"
#include "components/autofill/core/browser/autofill_type.h"
#include "components/autofill/core/browser/data_model/autofill_profile.h"
#include "components/autofill/core/browser/field_types.h"
#include "components/autofill/core/browser/form_structure.h"
#include "components/autofill/core/browser/geo/autofill_country.h"
#include "components/autofill/core/browser/webdata/autofill_table_utils.h"
#include "components/autofill/core/common/autofill_payments_features.h"
#include "components/autofill/core/common/credit_card_network_identifiers.h"
#include "components/grit/components_scaled_resources.h"
#include "components/strings/grit/components_strings.h"
#include "third_party/icu/source/common/unicode/uscript.h"
#include "third_party/re2/src/re2/re2.h"
namespace autofill::data_util {
kAddress;
kEmail;
kName;
kPhone;
namespace {
constexpr PaymentRequestData kPaymentRequestData[]{ … };
constexpr PaymentRequestData kPaymentRequestDataForNewNetworkImages[]{ … };
constexpr PaymentRequestData kGenericPaymentRequestData = …;
constexpr PaymentRequestData kGenericPaymentRequestDataForNewNetworkImages = …;
constexpr auto kNamePrefixes = …;
constexpr auto kNameSuffixes = …;
constexpr auto kFamilyNamePrefixes = …;
constexpr auto kCommonCjkMultiCharSurnames = …;
constexpr auto kKoreanMultiCharSurnames = …;
bool ContainsString(base::span<const std::string_view> set,
std::u16string_view element) { … }
void StripPrefixes(std::vector<std::u16string_view>* name_tokens) { … }
void StripSuffixes(std::vector<std::u16string_view>* name_tokens) { … }
size_t StartsWithAny(std::u16string_view name,
base::span<const std::u16string_view> prefixes) { … }
bool IsCJKCharacter(UChar32 c) { … }
bool IsHangulCharacter(UChar32 c) { … }
bool IsHangulName(std::u16string_view name) { … }
bool SplitCJKName(const std::vector<std::u16string_view>& name_tokens,
NameParts* parts) { … }
void AddGroupToBitmask(uint32_t* group_bitmask, FieldType type) { … }
}
bool ContainsName(uint32_t groups) { … }
bool ContainsAddress(uint32_t groups) { … }
bool ContainsEmail(uint32_t groups) { … }
bool ContainsPhone(uint32_t groups) { … }
uint32_t DetermineGroups(const FormStructure& form) { … }
uint32_t DetermineGroups(const FieldTypeSet& types) { … }
bool IsSupportedFormType(uint32_t groups) { … }
std::string GetSuffixForProfileFormType(uint32_t bitmask) { … }
std::string TruncateUTF8(const std::string& data) { … }
bool IsCreditCardExpirationType(FieldType type) { … }
bool IsCJKName(std::u16string_view name) { … }
NameParts SplitName(std::u16string_view name) { … }
std::u16string JoinNameParts(std::u16string_view given,
std::u16string_view middle,
std::u16string_view family) { … }
const PaymentRequestData& GetPaymentRequestData(
const std::string& issuer_network) { … }
const char* GetIssuerNetworkForBasicCardIssuerNetwork(
const std::string& basic_card_issuer_network) { … }
bool IsValidBasicCardIssuerNetwork(
const std::string& basic_card_issuer_network) { … }
bool IsValidCountryCode(const std::string& country_code) { … }
bool IsValidCountryCode(const std::u16string& country_code) { … }
std::string GetCountryCodeWithFallback(const autofill::AutofillProfile& profile,
const std::string& app_locale) { … }
}