Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(591)

Unified Diff: chrome/browser/autofill/address.cc

Issue 8169009: Remove FieldTypeSubGroups from the AutofillType class. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix tests compile Created 9 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | chrome/browser/autofill/autofill_manager.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/autofill/address.cc
diff --git a/chrome/browser/autofill/address.cc b/chrome/browser/autofill/address.cc
index 6b2d3454ee43f2ea80a0394111144765272ab565..576a31477486735568284325ce42c91bb6594fdd 100644
--- a/chrome/browser/autofill/address.cc
+++ b/chrome/browser/autofill/address.cc
@@ -17,17 +17,6 @@ namespace {
const char16 kAddressSplitChars[] = {'-', ',', '#', '.', ' ', 0};
-const AutofillType::FieldTypeSubGroup kAutofillAddressTypes[] = {
- AutofillType::ADDRESS_LINE1,
- AutofillType::ADDRESS_LINE2,
- AutofillType::ADDRESS_CITY,
- AutofillType::ADDRESS_STATE,
- AutofillType::ADDRESS_ZIP,
- AutofillType::ADDRESS_COUNTRY,
-};
-
-const int kAutofillAddressLength = arraysize(kAutofillAddressTypes);
-
// Returns the country code corresponding to |country|, which should be a
// localized country name.
std::string ToCountryCode(const string16& country) {
@@ -90,18 +79,18 @@ string16 Address::GetInfo(AutofillFieldType type) const {
}
void Address::SetInfo(AutofillFieldType type, const string16& value) {
- FieldTypeSubGroup subgroup = AutofillType(type).subgroup();
- if (subgroup == AutofillType::ADDRESS_LINE1)
+ type = AutofillType::GetEquivalentFieldType(type);
+ if (type == ADDRESS_HOME_LINE1)
line1_ = value;
- else if (subgroup == AutofillType::ADDRESS_LINE2)
+ else if (type == ADDRESS_HOME_LINE2)
line2_ = value;
- else if (subgroup == AutofillType::ADDRESS_CITY)
+ else if (type == ADDRESS_HOME_CITY)
city_ = value;
- else if (subgroup == AutofillType::ADDRESS_STATE)
+ else if (type == ADDRESS_HOME_STATE)
state_ = value;
- else if (subgroup == AutofillType::ADDRESS_COUNTRY)
+ else if (type == ADDRESS_HOME_COUNTRY)
country_code_ = ToCountryCode(value);
- else if (subgroup == AutofillType::ADDRESS_ZIP)
+ else if (type == ADDRESS_HOME_ZIP)
zip_code_ = value;
else
NOTREACHED();
« no previous file with comments | « no previous file | chrome/browser/autofill/autofill_manager.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698