| Index: components/autofill/core/browser/validation.cc
|
| diff --git a/components/autofill/core/browser/validation.cc b/components/autofill/core/browser/validation.cc
|
| index d18ccbab5cfd28477a394617fa1acf7c92210ab4..71a98fdfd958a27be72999e0043329e845f76d2a 100644
|
| --- a/components/autofill/core/browser/validation.cc
|
| +++ b/components/autofill/core/browser/validation.cc
|
| @@ -14,6 +14,7 @@
|
| #include "base/time/time.h"
|
| #include "components/autofill/core/browser/autofill_data_util.h"
|
| #include "components/autofill/core/browser/credit_card.h"
|
| +#include "components/autofill/core/browser/phone_number_i18n.h"
|
| #include "components/autofill/core/browser/state_names.h"
|
| #include "components/autofill/core/common/autofill_clock.h"
|
| #include "components/autofill/core/common/autofill_regexes.h"
|
| @@ -137,6 +138,12 @@ bool IsValidState(const base::string16& text) {
|
| !state_names::GetNameForAbbreviation(text).empty();
|
| }
|
|
|
| +bool IsValidPhoneNumber(const base::string16& text,
|
| + const std::string& country_code) {
|
| + i18n::PhoneObject phone_number(text, country_code);
|
| + return phone_number.IsValidNumber();
|
| +}
|
| +
|
| bool IsValidZip(const base::string16& text) {
|
| const base::string16 kZipPattern = base::ASCIIToUTF16("^\\d{5}(-\\d{4})?$");
|
| return MatchesPattern(text, kZipPattern);
|
|
|