#include "components/autofill/core/browser/geo/phone_number_i18n.h"
#include <memory>
#include <string_view>
#include <utility>
#include "base/check_op.h"
#include "base/notreached.h"
#include "base/strings/string_number_conversions.h"
#include "base/strings/string_util.h"
#include "base/strings/utf_string_conversions.h"
#include "components/autofill/core/browser/autofill_data_util.h"
#include "components/autofill/core/browser/data_model/autofill_profile.h"
#include "components/autofill/core/browser/geo/autofill_country.h"
#include "third_party/libphonenumber/phonenumber_api.h"
namespace autofill {
namespace {
PhoneNumberUtil;
std::string FormatPhoneNumber(const std::string& phone_number,
const std::string& country_code,
PhoneNumberUtil::PhoneNumberFormat format) { … }
std::string SanitizeRegion(const std::string& region,
const std::string& app_locale) { … }
void FormatValidatedNumber(const ::i18n::phonenumbers::PhoneNumber& number,
const std::u16string& country_code,
std::u16string* formatted_number,
std::u16string* normalized_number) { … }
bool IsPrintable(std::string_view str) { … }
}
namespace i18n {
const size_t kMaxPhoneNumberSize = …;
bool IsPossiblePhoneNumber(
const ::i18n::phonenumbers::PhoneNumber& phone_number) { … }
bool IsPossiblePhoneNumber(const std::string& phone_number,
const std::string& country_code) { … }
bool IsValidPhoneNumber(const std::string& phone_number,
const std::string& country_code) { … }
bool ParsePhoneNumber(const std::u16string& value,
const std::string& default_region,
std::u16string* country_code,
std::u16string* city_code,
std::u16string* number,
std::string* inferred_region,
::i18n::phonenumbers::PhoneNumber* i18n_number) { … }
std::u16string NormalizePhoneNumber(const std::u16string& value,
const std::string& region) { … }
bool ConstructPhoneNumber(const std::u16string& input_whole_number,
const std::string& region,
std::u16string* output_whole_number) { … }
bool PhoneNumbersMatch(const std::u16string& number_a,
const std::u16string& number_b,
const std::string& raw_region,
const std::string& app_locale) { … }
std::u16string GetFormattedPhoneNumberForDisplay(const AutofillProfile& profile,
const std::string& locale) { … }
std::string FormatPhoneNationallyForDisplay(const std::string& phone_number,
const std::string& country_code) { … }
std::string FormatPhoneForDisplay(const std::string& phone_number,
const std::string& country_code) { … }
std::string FormatPhoneForResponse(const std::string& phone_number,
const std::string& country_code) { … }
PhoneObject::PhoneObject(const std::u16string& number,
const std::string& region,
bool infer_country_code) { … }
PhoneObject::PhoneObject(const PhoneObject& other) { … }
PhoneObject::PhoneObject() = default;
PhoneObject::~PhoneObject() = default;
const std::u16string& PhoneObject::GetFormattedNumber() const { … }
std::u16string PhoneObject::GetNationallyFormattedNumber() const { … }
const std::u16string& PhoneObject::GetWholeNumber() const { … }
PhoneObject& PhoneObject::operator=(const PhoneObject& other) { … }
}
}