diff options
author | jhawkins@chromium.org <jhawkins@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-07-01 00:57:33 +0000 |
---|---|---|
committer | jhawkins@chromium.org <jhawkins@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-07-01 00:57:33 +0000 |
commit | cea1d11b9375368e29906255b7f865f78045200b (patch) | |
tree | b8cde41281263b22a948510933ee5e82c6ffa9b9 /chrome/browser/autofill/phone_number.cc | |
parent | e7c3784d1fb8d5f1862409fe62feab2112b70af0 (diff) | |
download | chromium_src-cea1d11b9375368e29906255b7f865f78045200b.zip chromium_src-cea1d11b9375368e29906255b7f865f78045200b.tar.gz chromium_src-cea1d11b9375368e29906255b7f865f78045200b.tar.bz2 |
AutoFill: Aggregate profile data. Remove the AutoFill InfoBar. Remove more remnants of shipping address and CVV.
BUG=47426,47423
TEST=PersonalDataManager.*
Review URL: http://codereview.chromium.org/2818033
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@51322 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/autofill/phone_number.cc')
-rw-r--r-- | chrome/browser/autofill/phone_number.cc | 24 |
1 files changed, 22 insertions, 2 deletions
diff --git a/chrome/browser/autofill/phone_number.cc b/chrome/browser/autofill/phone_number.cc index 9605d1d..997edd9 100644 --- a/chrome/browser/autofill/phone_number.cc +++ b/chrome/browser/autofill/phone_number.cc @@ -55,6 +55,25 @@ void PhoneNumber::GetPossibleFieldTypes(const string16& text, possible_types->insert(GetWholeNumberType()); } +void PhoneNumber::GetAvailableFieldTypes(FieldTypeSet* available_types) const { + DCHECK(available_types); + + if (!number().empty()) + available_types->insert(GetNumberType()); + + if (!city_code().empty()) + available_types->insert(GetCityCodeType()); + + if (!country_code().empty()) + available_types->insert(GetCountryCodeType()); + + if (!CityAndNumber().empty()) + available_types->insert(GetCityAndNumberType()); + + if (!WholeNumber().empty()) + available_types->insert(GetWholeNumberType()); +} + string16 PhoneNumber::GetFieldText(const AutoFillType& type) const { AutoFillFieldType field_type = type.field_type(); if (field_type == GetNumberType()) @@ -72,7 +91,7 @@ string16 PhoneNumber::GetFieldText(const AutoFillType& type) const { if (field_type == GetWholeNumberType()) return WholeNumber(); - return EmptyString16(); + return string16(); } void PhoneNumber::FindInfoMatches(const AutoFillType& type, @@ -113,7 +132,8 @@ void PhoneNumber::SetInfo(const AutoFillType& type, const string16& value) { set_city_code(number); else if (subgroup == AutoFillType::PHONE_COUNTRY_CODE) set_country_code(number); - else if (subgroup == AutoFillType::PHONE_WHOLE_NUMBER) + else if (subgroup == AutoFillType::PHONE_CITY_AND_NUMBER || + subgroup == AutoFillType::PHONE_WHOLE_NUMBER) set_whole_number(number); else NOTREACHED(); |