Commit ba6a56c0 authored by Parastoo Geranmayeh's avatar Parastoo Geranmayeh Committed by Commit Bot

[AF] Sift company names

If a company name is in the format of a brithyear,
such as 1987, don't use it, unless it's a verified one.
(Verified: created through autofill settings.)

go/autofill-company-1987

Bug: 956560
Change-Id: Ibc0f8d19eb8acefe1f1328345e37f0db9a91ea18
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1579520Reviewed-by: default avatarParastoo Geranmayeh <parastoog@google.com>
Reviewed-by: default avatarFabio Tirelo <ftirelo@chromium.org>
Commit-Queue: Parastoo Geranmayeh <parastoog@google.com>
Cr-Commit-Position: refs/heads/master@{#654765}
parent c1ad813c
...@@ -2249,6 +2249,57 @@ TEST_F(AutofillManagerTest, FillAddressForm_AutocompleteOffNotRespected) { ...@@ -2249,6 +2249,57 @@ TEST_F(AutofillManagerTest, FillAddressForm_AutocompleteOffNotRespected) {
"text", response_data.fields[3]); "text", response_data.fields[3]);
} }
// Test that if a company is of a format of a birthyear and the relevant feature
// is enabled, we would not fill it.
TEST_F(AutofillManagerTest, FillAddressForm_CompanyBirthyear) {
base::test::ScopedFeatureList scoped_feature_list;
scoped_feature_list.InitAndEnableFeature(
features::kAutofillRejectCompanyBirthyear);
// Set up our form data.
FormData address_form;
address_form.name = ASCIIToUTF16("MyForm");
address_form.url = GURL("https://myform.com/form.html");
address_form.action = GURL("https://myform.com/submit.html");
FormFieldData field;
test::CreateTestFormField("First name", "firstname", "", "text", &field);
address_form.fields.push_back(field);
test::CreateTestFormField("Middle name", "middle", "", "text", &field);
address_form.fields.push_back(field);
test::CreateTestFormField("Last name", "lastname", "", "text", &field);
address_form.fields.push_back(field);
test::CreateTestFormField("Company", "company", "", "text", &field);
address_form.fields.push_back(field);
std::vector<FormData> address_forms(1, address_form);
FormsSeen(address_forms);
AutofillProfile profile;
const char guid[] = "00000000-0000-0000-0000-000000000123";
test::SetProfileInfo(&profile, "Elvis", "Aaron", "Presley",
"theking@gmail.com", "1987", "3734 Elvis Presley Blvd.",
"Apt. 10", "Memphis", "Tennessee", "38116", "US",
"12345678901");
profile.set_guid(guid);
personal_data_.AddProfile(profile);
int response_page_id = 0;
FormData response_data;
FillAutofillFormDataAndSaveResults(
kDefaultPageID, address_form, *address_form.fields.begin(),
MakeFrontendID(std::string(), guid), &response_page_id, &response_data);
// All the fields should be filled except the company.
ExpectFilledField("First name", "firstname", "Elvis", "text",
response_data.fields[0]);
ExpectFilledField("Middle name", "middle", "Aaron", "text",
response_data.fields[1]);
ExpectFilledField("Last name", "lastname", "Presley", "text",
response_data.fields[2]);
ExpectFilledField("Company", "company", "", "text", response_data.fields[3]);
}
// Test that a field with a value equal to it's placeholder attribute is filled. // Test that a field with a value equal to it's placeholder attribute is filled.
TEST_F(AutofillManagerTest, FillAddressForm_PlaceholderEqualsValue) { TEST_F(AutofillManagerTest, FillAddressForm_PlaceholderEqualsValue) {
FormData address_form; FormData address_form;
......
...@@ -228,6 +228,7 @@ ServerFieldType NormalizeTypeForValidityCheck(ServerFieldType type) { ...@@ -228,6 +228,7 @@ ServerFieldType NormalizeTypeForValidityCheck(ServerFieldType type) {
AutofillProfile::AutofillProfile(const std::string& guid, AutofillProfile::AutofillProfile(const std::string& guid,
const std::string& origin) const std::string& origin)
: AutofillDataModel(guid, origin), : AutofillDataModel(guid, origin),
company_(this),
phone_number_(this), phone_number_(this),
record_type_(LOCAL_PROFILE), record_type_(LOCAL_PROFILE),
has_converted_(false), has_converted_(false),
...@@ -235,6 +236,7 @@ AutofillProfile::AutofillProfile(const std::string& guid, ...@@ -235,6 +236,7 @@ AutofillProfile::AutofillProfile(const std::string& guid,
AutofillProfile::AutofillProfile(RecordType type, const std::string& server_id) AutofillProfile::AutofillProfile(RecordType type, const std::string& server_id)
: AutofillDataModel(base::GenerateGUID(), std::string()), : AutofillDataModel(base::GenerateGUID(), std::string()),
company_(this),
phone_number_(this), phone_number_(this),
server_id_(server_id), server_id_(server_id),
record_type_(type), record_type_(type),
...@@ -245,6 +247,7 @@ AutofillProfile::AutofillProfile(RecordType type, const std::string& server_id) ...@@ -245,6 +247,7 @@ AutofillProfile::AutofillProfile(RecordType type, const std::string& server_id)
AutofillProfile::AutofillProfile() AutofillProfile::AutofillProfile()
: AutofillDataModel(base::GenerateGUID(), std::string()), : AutofillDataModel(base::GenerateGUID(), std::string()),
company_(this),
phone_number_(this), phone_number_(this),
record_type_(LOCAL_PROFILE), record_type_(LOCAL_PROFILE),
has_converted_(false), has_converted_(false),
...@@ -252,6 +255,7 @@ AutofillProfile::AutofillProfile() ...@@ -252,6 +255,7 @@ AutofillProfile::AutofillProfile()
AutofillProfile::AutofillProfile(const AutofillProfile& profile) AutofillProfile::AutofillProfile(const AutofillProfile& profile)
: AutofillDataModel(std::string(), std::string()), : AutofillDataModel(std::string(), std::string()),
company_(this),
phone_number_(this), phone_number_(this),
weak_ptr_factory_(this) { weak_ptr_factory_(this) {
operator=(profile); operator=(profile);
...@@ -277,6 +281,7 @@ AutofillProfile& AutofillProfile::operator=(const AutofillProfile& profile) { ...@@ -277,6 +281,7 @@ AutofillProfile& AutofillProfile::operator=(const AutofillProfile& profile) {
name_ = profile.name_; name_ = profile.name_;
email_ = profile.email_; email_ = profile.email_;
company_ = profile.company_; company_ = profile.company_;
company_.set_profile(this);
phone_number_ = profile.phone_number_; phone_number_ = profile.phone_number_;
phone_number_.set_profile(this); phone_number_.set_profile(this);
...@@ -561,7 +566,7 @@ bool AutofillProfile::MergeDataFrom(const AutofillProfile& profile, ...@@ -561,7 +566,7 @@ bool AutofillProfile::MergeDataFrom(const AutofillProfile& profile,
NameInfo name; NameInfo name;
EmailInfo email; EmailInfo email;
CompanyInfo company; CompanyInfo company(this);
PhoneNumber phone_number(this); PhoneNumber phone_number(this);
Address address; Address address;
......
...@@ -6,11 +6,13 @@ ...@@ -6,11 +6,13 @@
#include "base/guid.h" #include "base/guid.h"
#include "base/strings/utf_string_conversions.h" #include "base/strings/utf_string_conversions.h"
#include "base/test/scoped_feature_list.h"
#include "components/autofill/core/browser/autofill_profile.h" #include "components/autofill/core/browser/autofill_profile.h"
#include "components/autofill/core/browser/autofill_test_utils.h" #include "components/autofill/core/browser/autofill_test_utils.h"
#include "components/autofill/core/browser/contact_info.h" #include "components/autofill/core/browser/contact_info.h"
#include "components/autofill/core/browser/country_names.h" #include "components/autofill/core/browser/country_names.h"
#include "components/autofill/core/browser/field_types.h" #include "components/autofill/core/browser/field_types.h"
#include "components/autofill/core/common/autofill_features.h"
#include "testing/gtest/include/gtest/gtest.h" #include "testing/gtest/include/gtest/gtest.h"
// Field Type Constants // Field Type Constants
...@@ -758,9 +760,16 @@ TEST_F(AutofillProfileComparatorTest, MergeEmailAddresses) { ...@@ -758,9 +760,16 @@ TEST_F(AutofillProfileComparatorTest, MergeEmailAddresses) {
} }
TEST_F(AutofillProfileComparatorTest, MergeCompanyNames) { TEST_F(AutofillProfileComparatorTest, MergeCompanyNames) {
base::test::ScopedFeatureList scoped_features;
scoped_features.InitWithFeatures(
/*enabled_features=*/{autofill::features::
kAutofillRejectCompanyBirthyear},
/*disabled_features=*/{});
static const char kCompanyA[] = "Some Company"; static const char kCompanyA[] = "Some Company";
static const char kCompanyB[] = "SÔMÈ ÇÖMPÁÑÝ"; static const char kCompanyB[] = "SÔMÈ ÇÖMPÁÑÝ";
static const char kCompanyC[] = "SÔMÈ ÇÖMPÁÑÝ A.G."; static const char kCompanyC[] = "SÔMÈ ÇÖMPÁÑÝ A.G.";
static const char kCompanyD[] = "1987";
CompanyInfo company_a; CompanyInfo company_a;
company_a.SetRawInfo(COMPANY_NAME, UTF8ToUTF16(kCompanyA)); company_a.SetRawInfo(COMPANY_NAME, UTF8ToUTF16(kCompanyA));
...@@ -781,15 +790,31 @@ TEST_F(AutofillProfileComparatorTest, MergeCompanyNames) { ...@@ -781,15 +790,31 @@ TEST_F(AutofillProfileComparatorTest, MergeCompanyNames) {
AutofillProfile profile_c = CreateProfileWithCompanyName(kCompanyC); AutofillProfile profile_c = CreateProfileWithCompanyName(kCompanyC);
profile_c.set_use_date(profile_a.use_date() - base::TimeDelta::FromDays(1)); profile_c.set_use_date(profile_a.use_date() - base::TimeDelta::FromDays(1));
// Company Name D is in the format of a birthyear, invalid and non-verified.
CompanyInfo company_d;
company_d.SetRawInfo(COMPANY_NAME, UTF8ToUTF16(kCompanyD));
AutofillProfile profile_d = CreateProfileWithCompanyName(kCompanyD);
profile_a.set_use_date(base::Time::Now());
MergeCompanyNamesAndExpect(profile_a, profile_a, company_a); MergeCompanyNamesAndExpect(profile_a, profile_a, company_a);
MergeCompanyNamesAndExpect(profile_a, profile_b, company_b); MergeCompanyNamesAndExpect(profile_a, profile_b, company_b);
MergeCompanyNamesAndExpect(profile_a, profile_c, company_c); MergeCompanyNamesAndExpect(profile_a, profile_c, company_c);
MergeCompanyNamesAndExpect(profile_a, profile_d, company_a);
MergeCompanyNamesAndExpect(profile_b, profile_a, company_b); MergeCompanyNamesAndExpect(profile_b, profile_a, company_b);
MergeCompanyNamesAndExpect(profile_b, profile_b, company_b); MergeCompanyNamesAndExpect(profile_b, profile_b, company_b);
MergeCompanyNamesAndExpect(profile_b, profile_c, company_c); MergeCompanyNamesAndExpect(profile_b, profile_c, company_c);
MergeCompanyNamesAndExpect(profile_b, profile_d, company_b);
MergeCompanyNamesAndExpect(profile_c, profile_a, company_c); MergeCompanyNamesAndExpect(profile_c, profile_a, company_c);
MergeCompanyNamesAndExpect(profile_c, profile_b, company_c); MergeCompanyNamesAndExpect(profile_c, profile_b, company_c);
MergeCompanyNamesAndExpect(profile_c, profile_c, company_c); MergeCompanyNamesAndExpect(profile_c, profile_c, company_c);
MergeCompanyNamesAndExpect(profile_c, profile_d, company_c);
MergeCompanyNamesAndExpect(profile_d, profile_a, company_a);
MergeCompanyNamesAndExpect(profile_d, profile_b, company_b);
MergeCompanyNamesAndExpect(profile_d, profile_c, company_c);
MergeCompanyNamesAndExpect(profile_d, profile_d, company_d);
} }
TEST_F(AutofillProfileComparatorTest, MergePhoneNumbers_NA) { TEST_F(AutofillProfileComparatorTest, MergePhoneNumbers_NA) {
......
...@@ -13,9 +13,11 @@ ...@@ -13,9 +13,11 @@
#include "base/strings/string_util.h" #include "base/strings/string_util.h"
#include "base/strings/utf_string_conversions.h" #include "base/strings/utf_string_conversions.h"
#include "components/autofill/core/browser/autofill_data_util.h" #include "components/autofill/core/browser/autofill_data_util.h"
#include "components/autofill/core/browser/autofill_profile.h"
#include "components/autofill/core/browser/autofill_type.h" #include "components/autofill/core/browser/autofill_type.h"
#include "components/autofill/core/common/autofill_features.h" #include "components/autofill/core/common/autofill_features.h"
#include "components/autofill/core/common/autofill_l10n_util.h" #include "components/autofill/core/common/autofill_l10n_util.h"
#include "components/autofill/core/common/autofill_regexes.h"
namespace autofill { namespace autofill {
...@@ -218,6 +220,8 @@ void EmailInfo::SetRawInfo(ServerFieldType type, const base::string16& value) { ...@@ -218,6 +220,8 @@ void EmailInfo::SetRawInfo(ServerFieldType type, const base::string16& value) {
CompanyInfo::CompanyInfo() {} CompanyInfo::CompanyInfo() {}
CompanyInfo::CompanyInfo(const AutofillProfile* profile) : profile_(profile) {}
CompanyInfo::CompanyInfo(const CompanyInfo& info) { CompanyInfo::CompanyInfo(const CompanyInfo& info) {
*this = info; *this = info;
} }
...@@ -228,12 +232,13 @@ CompanyInfo& CompanyInfo::operator=(const CompanyInfo& info) { ...@@ -228,12 +232,13 @@ CompanyInfo& CompanyInfo::operator=(const CompanyInfo& info) {
if (this == &info) if (this == &info)
return *this; return *this;
company_name_ = info.company_name_; company_name_ = info.GetRawInfo(COMPANY_NAME);
return *this; return *this;
} }
bool CompanyInfo::operator==(const CompanyInfo& other) const { bool CompanyInfo::operator==(const CompanyInfo& other) const {
return this == &other || company_name_ == other.company_name_; return this == &other ||
GetRawInfo(COMPANY_NAME) == other.GetRawInfo(COMPANY_NAME);
} }
void CompanyInfo::GetSupportedTypes(ServerFieldTypeSet* supported_types) const { void CompanyInfo::GetSupportedTypes(ServerFieldTypeSet* supported_types) const {
...@@ -241,7 +246,7 @@ void CompanyInfo::GetSupportedTypes(ServerFieldTypeSet* supported_types) const { ...@@ -241,7 +246,7 @@ void CompanyInfo::GetSupportedTypes(ServerFieldTypeSet* supported_types) const {
} }
base::string16 CompanyInfo::GetRawInfo(ServerFieldType type) const { base::string16 CompanyInfo::GetRawInfo(ServerFieldType type) const {
return company_name_; return IsValidOrVerified(company_name_) ? company_name_ : base::string16();
} }
void CompanyInfo::SetRawInfo(ServerFieldType type, void CompanyInfo::SetRawInfo(ServerFieldType type,
...@@ -250,4 +255,16 @@ void CompanyInfo::SetRawInfo(ServerFieldType type, ...@@ -250,4 +255,16 @@ void CompanyInfo::SetRawInfo(ServerFieldType type,
company_name_ = value; company_name_ = value;
} }
bool CompanyInfo::IsValidOrVerified(const base::string16& value) const {
if (!base::FeatureList::IsEnabled(
autofill::features::kAutofillRejectCompanyBirthyear))
return true;
if (profile_ && profile_->IsVerified())
return true;
// Companies that are of the format of a four digit birth year are not valid.
return !MatchesPattern(value, base::UTF8ToUTF16("^(19|20)\\d{2}$"));
}
} // namespace autofill } // namespace autofill
...@@ -13,6 +13,8 @@ ...@@ -13,6 +13,8 @@
namespace autofill { namespace autofill {
class AutofillProfile;
// A form group that stores name information. // A form group that stores name information.
class NameInfo : public FormGroup { class NameInfo : public FormGroup {
public: public:
...@@ -91,6 +93,7 @@ class CompanyInfo : public FormGroup { ...@@ -91,6 +93,7 @@ class CompanyInfo : public FormGroup {
public: public:
CompanyInfo(); CompanyInfo();
CompanyInfo(const CompanyInfo& info); CompanyInfo(const CompanyInfo& info);
explicit CompanyInfo(const AutofillProfile* profile);
~CompanyInfo() override; ~CompanyInfo() override;
CompanyInfo& operator=(const CompanyInfo& info); CompanyInfo& operator=(const CompanyInfo& info);
...@@ -100,12 +103,15 @@ class CompanyInfo : public FormGroup { ...@@ -100,12 +103,15 @@ class CompanyInfo : public FormGroup {
// FormGroup: // FormGroup:
base::string16 GetRawInfo(ServerFieldType type) const override; base::string16 GetRawInfo(ServerFieldType type) const override;
void SetRawInfo(ServerFieldType type, const base::string16& value) override; void SetRawInfo(ServerFieldType type, const base::string16& value) override;
void set_profile(const AutofillProfile* profile) { profile_ = profile; }
private: private:
// FormGroup: // FormGroup:
void GetSupportedTypes(ServerFieldTypeSet* supported_types) const override; void GetSupportedTypes(ServerFieldTypeSet* supported_types) const override;
bool IsValidOrVerified(const base::string16& value) const;
base::string16 company_name_; base::string16 company_name_;
const AutofillProfile* profile_ = nullptr;
}; };
} // namespace autofill } // namespace autofill
......
...@@ -11,8 +11,11 @@ ...@@ -11,8 +11,11 @@
#include "base/strings/string_util.h" #include "base/strings/string_util.h"
#include "base/strings/stringprintf.h" #include "base/strings/stringprintf.h"
#include "base/strings/utf_string_conversions.h" #include "base/strings/utf_string_conversions.h"
#include "base/test/scoped_feature_list.h"
#include "components/autofill/core/browser/autofill_profile.h"
#include "components/autofill/core/browser/autofill_type.h" #include "components/autofill/core/browser/autofill_type.h"
#include "components/autofill/core/browser/field_types.h" #include "components/autofill/core/browser/field_types.h"
#include "components/autofill/core/common/autofill_features.h"
#include "testing/gtest/include/gtest/gtest.h" #include "testing/gtest/include/gtest/gtest.h"
using base::ASCIIToUTF16; using base::ASCIIToUTF16;
...@@ -397,4 +400,96 @@ INSTANTIATE_TEST_SUITE_P( ...@@ -397,4 +400,96 @@ INSTANTIATE_TEST_SUITE_P(
NamePartsAreEmptyTestCase{"", "Mitchell", "", "", false}, NamePartsAreEmptyTestCase{"", "Mitchell", "", "", false},
NamePartsAreEmptyTestCase{"", "", "Morrison", "", false})); NamePartsAreEmptyTestCase{"", "", "Morrison", "", false}));
TEST(CompanyTest, CompanyNameYear) {
base::test::ScopedFeatureList scoped_features;
scoped_features.InitWithFeatures(
/*enabled_features=*/{features::kAutofillRejectCompanyBirthyear},
/*disabled_features=*/{});
AutofillProfile profile;
CompanyInfo company(&profile);
ASSERT_FALSE(profile.IsVerified());
company.SetRawInfo(COMPANY_NAME, UTF8ToUTF16("Google"));
EXPECT_EQ(UTF8ToUTF16("Google"), company.GetRawInfo(COMPANY_NAME));
company.SetRawInfo(COMPANY_NAME, UTF8ToUTF16("1987"));
EXPECT_EQ(UTF8ToUTF16(""), company.GetRawInfo(COMPANY_NAME));
company.SetRawInfo(COMPANY_NAME, UTF8ToUTF16("It was 1987."));
EXPECT_EQ(UTF8ToUTF16("It was 1987."), company.GetRawInfo(COMPANY_NAME));
company.SetRawInfo(COMPANY_NAME, UTF8ToUTF16("1987 was the year."));
EXPECT_EQ(UTF8ToUTF16("1987 was the year."),
company.GetRawInfo(COMPANY_NAME));
company.SetRawInfo(COMPANY_NAME, UTF8ToUTF16("Yes, 1987 was the year."));
EXPECT_EQ(UTF8ToUTF16("Yes, 1987 was the year."),
company.GetRawInfo(COMPANY_NAME));
company.SetRawInfo(COMPANY_NAME, UTF8ToUTF16("2019"));
EXPECT_EQ(UTF8ToUTF16(""), company.GetRawInfo(COMPANY_NAME));
company.SetRawInfo(COMPANY_NAME, UTF8ToUTF16("1818"));
EXPECT_EQ(UTF8ToUTF16("1818"), company.GetRawInfo(COMPANY_NAME));
company.SetRawInfo(COMPANY_NAME, UTF8ToUTF16("2345"));
EXPECT_EQ(UTF8ToUTF16("2345"), company.GetRawInfo(COMPANY_NAME));
profile.set_origin("Not empty");
ASSERT_TRUE(profile.IsVerified());
company.SetRawInfo(COMPANY_NAME, UTF8ToUTF16("Google"));
EXPECT_EQ(UTF8ToUTF16("Google"), company.GetRawInfo(COMPANY_NAME));
company.SetRawInfo(COMPANY_NAME, UTF8ToUTF16("1987"));
EXPECT_EQ(UTF8ToUTF16("1987"), company.GetRawInfo(COMPANY_NAME));
company.SetRawInfo(COMPANY_NAME, UTF8ToUTF16("2019"));
EXPECT_EQ(UTF8ToUTF16("2019"), company.GetRawInfo(COMPANY_NAME));
company.SetRawInfo(COMPANY_NAME, UTF8ToUTF16("1818"));
EXPECT_EQ(UTF8ToUTF16("1818"), company.GetRawInfo(COMPANY_NAME));
company.SetRawInfo(COMPANY_NAME, UTF8ToUTF16("2345"));
EXPECT_EQ(UTF8ToUTF16("2345"), company.GetRawInfo(COMPANY_NAME));
}
TEST(CompanyTest, CompanyNameYearCopy) {
base::test::ScopedFeatureList scoped_features;
scoped_features.InitWithFeatures(
/*enabled_features=*/{features::kAutofillRejectCompanyBirthyear},
/*disabled_features=*/{});
AutofillProfile profile;
ASSERT_FALSE(profile.IsVerified());
CompanyInfo company_google(&profile);
CompanyInfo company_year(&profile);
company_google.SetRawInfo(COMPANY_NAME, UTF8ToUTF16("Google"));
company_year.SetRawInfo(COMPANY_NAME, UTF8ToUTF16("1987"));
company_google = company_year;
EXPECT_EQ(UTF8ToUTF16(""), company_google.GetRawInfo(COMPANY_NAME));
}
TEST(CompanyTest, CompanyNameYearIsEqual) {
base::test::ScopedFeatureList scoped_features;
scoped_features.InitWithFeatures(
/*enabled_features=*/{features::kAutofillRejectCompanyBirthyear},
/*disabled_features=*/{});
AutofillProfile profile;
ASSERT_FALSE(profile.IsVerified());
CompanyInfo company_old(&profile);
CompanyInfo company_young(&profile);
company_old.SetRawInfo(COMPANY_NAME, UTF8ToUTF16("2019"));
company_young.SetRawInfo(COMPANY_NAME, UTF8ToUTF16("1987"));
EXPECT_EQ(company_old, company_young);
}
} // namespace autofill } // namespace autofill
...@@ -31,7 +31,7 @@ std::string GetRegion(const AutofillProfile& profile, ...@@ -31,7 +31,7 @@ std::string GetRegion(const AutofillProfile& profile,
} // namespace } // namespace
PhoneNumber::PhoneNumber(AutofillProfile* profile) : profile_(profile) {} PhoneNumber::PhoneNumber(const AutofillProfile* profile) : profile_(profile) {}
PhoneNumber::PhoneNumber(const PhoneNumber& number) : profile_(nullptr) { PhoneNumber::PhoneNumber(const PhoneNumber& number) : profile_(nullptr) {
*this = number; *this = number;
......
...@@ -21,7 +21,7 @@ class AutofillProfile; ...@@ -21,7 +21,7 @@ class AutofillProfile;
// A form group that stores phone number information. // A form group that stores phone number information.
class PhoneNumber : public FormGroup { class PhoneNumber : public FormGroup {
public: public:
explicit PhoneNumber(AutofillProfile* profile); explicit PhoneNumber(const AutofillProfile* profile);
PhoneNumber(const PhoneNumber& number); PhoneNumber(const PhoneNumber& number);
~PhoneNumber() override; ~PhoneNumber() override;
...@@ -29,7 +29,7 @@ class PhoneNumber : public FormGroup { ...@@ -29,7 +29,7 @@ class PhoneNumber : public FormGroup {
bool operator==(const PhoneNumber& other) const; bool operator==(const PhoneNumber& other) const;
bool operator!=(const PhoneNumber& other) const { return !operator==(other); } bool operator!=(const PhoneNumber& other) const { return !operator==(other); }
void set_profile(AutofillProfile* profile) { profile_ = profile; } void set_profile(const AutofillProfile* profile) { profile_ = profile; }
// FormGroup implementation: // FormGroup implementation:
void GetMatchingTypes(const base::string16& text, void GetMatchingTypes(const base::string16& text,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment