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/address.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/address.cc')
-rw-r--r-- | chrome/browser/autofill/address.cc | 29 |
1 files changed, 25 insertions, 4 deletions
diff --git a/chrome/browser/autofill/address.cc b/chrome/browser/autofill/address.cc index e84e3e2..cd5358e 100644 --- a/chrome/browser/autofill/address.cc +++ b/chrome/browser/autofill/address.cc @@ -30,8 +30,6 @@ const int kAutoFillAddressLength = arraysize(kAutoFillAddressTypes); void Address::GetPossibleFieldTypes(const string16& text, FieldTypeSet* possible_types) const { DCHECK(possible_types); - if (!possible_types) - return; // If the text to match against the field types is empty, then no results will // match. @@ -60,12 +58,35 @@ void Address::GetPossibleFieldTypes(const string16& text, possible_types->insert(GetCountryType()); } +void Address::GetAvailableFieldTypes(FieldTypeSet* available_types) const { + DCHECK(available_types); + + if (!line1().empty()) + available_types->insert(GetLine1Type()); + + if (!line2().empty()) + available_types->insert(GetLine2Type()); + + if (!apt_num().empty()) + available_types->insert(GetAptNumType()); + + if (!city().empty()) + available_types->insert(GetCityType()); + + if (!state().empty()) + available_types->insert(GetStateType()); + + if (!zip_code().empty()) + available_types->insert(GetZipCodeType()); + + if (!country().empty()) + available_types->insert(GetCountryType()); +} + void Address::FindInfoMatches(const AutoFillType& type, const string16& info, std::vector<string16>* matched_text) const { DCHECK(matched_text); - if (!matched_text) - return; string16 match; if (type.field_type() == UNKNOWN_TYPE) { |