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

Unified Diff: chrome/browser/autofill/personal_data_manager_mac.mm

Issue 6673079: Reduce boxing and unboxing of AutofillFieldType (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Compile on Windows. Created 9 years, 9 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
Index: chrome/browser/autofill/personal_data_manager_mac.mm
diff --git a/chrome/browser/autofill/personal_data_manager_mac.mm b/chrome/browser/autofill/personal_data_manager_mac.mm
index 13d4f8eb88fbe82ad5a2c11f3a217463c80ee4f1..663b2106554e8b57c596bfc83b788ad80bd904da 100644
--- a/chrome/browser/autofill/personal_data_manager_mac.mm
+++ b/chrome/browser/autofill/personal_data_manager_mac.mm
@@ -111,14 +111,14 @@ void AuxiliaryProfilesImpl::GetAddressBookNames(
NSString* lastName = [me valueForProperty:kABLastNameProperty];
NSString* companyName = [me valueForProperty:kABOrganizationProperty];
- profile->SetInfo(AutofillType(NAME_FIRST),
+ profile->SetInfo(NAME_FIRST,
dhollowa 2011/03/16 17:07:11 nit: A number of these should fit on single line n
Ilya Sherman 2011/03/17 03:42:29 Done.
base::SysNSStringToUTF16(firstName));
- profile->SetInfo(AutofillType(NAME_MIDDLE),
+ profile->SetInfo(NAME_MIDDLE,
base::SysNSStringToUTF16(middleName));
- profile->SetInfo(AutofillType(NAME_LAST),
+ profile->SetInfo(NAME_LAST,
base::SysNSStringToUTF16(lastName));
if ([addressLabelRaw isEqualToString:kABAddressWorkLabel]) {
- profile->SetInfo(AutofillType(COMPANY_NAME),
+ profile->SetInfo(COMPANY_NAME,
base::SysNSStringToUTF16(companyName));
}
}
@@ -146,30 +146,30 @@ void AuxiliaryProfilesImpl::GetAddressBookAddresses(
NSString* addressField2 =
[[chunks subarrayWithRange:NSMakeRange(1, [chunks count] - 1)]
componentsJoinedByString:separator];
- profile->SetInfo(AutofillType(ADDRESS_HOME_LINE1),
+ profile->SetInfo(ADDRESS_HOME_LINE1,
base::SysNSStringToUTF16(addressField1));
- profile->SetInfo(AutofillType(ADDRESS_HOME_LINE2),
+ profile->SetInfo(ADDRESS_HOME_LINE2,
base::SysNSStringToUTF16(addressField2));
} else {
- profile->SetInfo(AutofillType(ADDRESS_HOME_LINE1),
+ profile->SetInfo(ADDRESS_HOME_LINE1,
base::SysNSStringToUTF16(addressField));
}
}
if (NSString* city = [address objectForKey:kABAddressCityKey]) {
- profile->SetInfo(AutofillType(ADDRESS_HOME_CITY),
+ profile->SetInfo(ADDRESS_HOME_CITY,
base::SysNSStringToUTF16(city));
}
if (NSString* state = [address objectForKey:kABAddressStateKey]) {
- profile->SetInfo(AutofillType(ADDRESS_HOME_STATE),
+ profile->SetInfo(ADDRESS_HOME_STATE,
base::SysNSStringToUTF16(state));
}
if (NSString* zip = [address objectForKey:kABAddressZIPKey]) {
- profile->SetInfo(AutofillType(ADDRESS_HOME_ZIP),
+ profile->SetInfo(ADDRESS_HOME_ZIP,
base::SysNSStringToUTF16(zip));
}
if (NSString* country = [address objectForKey:kABAddressCountryKey]) {
- profile->SetInfo(AutofillType(ADDRESS_HOME_COUNTRY),
+ profile->SetInfo(ADDRESS_HOME_COUNTRY,
base::SysNSStringToUTF16(country));
}
}
@@ -191,7 +191,7 @@ void AuxiliaryProfilesImpl::GetAddressBookEmail(
break;
}
}
- profile->SetInfo(AutofillType(EMAIL_ADDRESS),
+ profile->SetInfo(EMAIL_ADDRESS,
base::SysNSStringToUTF16(emailAddress));
}
@@ -218,36 +218,36 @@ void AuxiliaryProfilesImpl::GetAddressBookPhoneNumbers(
[phoneNumbers valueAtIndex:reverseK]);
PhoneNumber::ParsePhoneNumber(
homePhone, &number, &city_code, &country_code);
- profile->SetInfo(AutofillType(PHONE_HOME_NUMBER), number);
- profile->SetInfo(AutofillType(PHONE_HOME_CITY_CODE), city_code);
- profile->SetInfo(AutofillType(PHONE_HOME_COUNTRY_CODE), country_code);
+ profile->SetInfo(PHONE_HOME_NUMBER, number);
+ profile->SetInfo(PHONE_HOME_CITY_CODE, city_code);
+ profile->SetInfo(PHONE_HOME_COUNTRY_CODE, country_code);
} else if ([addressLabelRaw isEqualToString:kABAddressHomeLabel] &&
[phoneLabelRaw isEqualToString:kABPhoneHomeFAXLabel]) {
string16 homeFax = base::SysNSStringToUTF16(
[phoneNumbers valueAtIndex:reverseK]);
PhoneNumber::ParsePhoneNumber(homeFax,
&number, &city_code, &country_code);
- profile->SetInfo(AutofillType(PHONE_FAX_NUMBER), number);
- profile->SetInfo(AutofillType(PHONE_FAX_CITY_CODE), city_code);
- profile->SetInfo(AutofillType(PHONE_FAX_COUNTRY_CODE), country_code);
+ profile->SetInfo(PHONE_FAX_NUMBER, number);
+ profile->SetInfo(PHONE_FAX_CITY_CODE, city_code);
+ profile->SetInfo(PHONE_FAX_COUNTRY_CODE, country_code);
} else if ([addressLabelRaw isEqualToString:kABAddressWorkLabel] &&
[phoneLabelRaw isEqualToString:kABPhoneWorkLabel]) {
string16 workPhone = base::SysNSStringToUTF16(
[phoneNumbers valueAtIndex:reverseK]);
PhoneNumber::ParsePhoneNumber(workPhone,
&number, &city_code, &country_code);
- profile->SetInfo(AutofillType(PHONE_HOME_NUMBER), number);
- profile->SetInfo(AutofillType(PHONE_HOME_CITY_CODE), city_code);
- profile->SetInfo(AutofillType(PHONE_HOME_COUNTRY_CODE), country_code);
+ profile->SetInfo(PHONE_HOME_NUMBER, number);
+ profile->SetInfo(PHONE_HOME_CITY_CODE, city_code);
+ profile->SetInfo(PHONE_HOME_COUNTRY_CODE, country_code);
} else if ([addressLabelRaw isEqualToString:kABAddressWorkLabel] &&
[phoneLabelRaw isEqualToString:kABPhoneWorkFAXLabel]) {
string16 workFax = base::SysNSStringToUTF16(
[phoneNumbers valueAtIndex:reverseK]);
PhoneNumber::ParsePhoneNumber(workFax,
&number, &city_code, &country_code);
- profile->SetInfo(AutofillType(PHONE_FAX_NUMBER), number);
- profile->SetInfo(AutofillType(PHONE_FAX_CITY_CODE), city_code);
- profile->SetInfo(AutofillType(PHONE_FAX_COUNTRY_CODE), country_code);
+ profile->SetInfo(PHONE_FAX_NUMBER, number);
+ profile->SetInfo(PHONE_FAX_CITY_CODE, city_code);
+ profile->SetInfo(PHONE_FAX_COUNTRY_CODE, country_code);
}
}
}

Powered by Google App Engine
This is Rietveld 408576698