Index: components/autofill/browser/personal_data_manager_mac.mm |
=================================================================== |
--- components/autofill/browser/personal_data_manager_mac.mm (revision 192613) |
+++ components/autofill/browser/personal_data_manager_mac.mm (working copy) |
@@ -42,13 +42,15 @@ |
virtual ~AuxiliaryProfilesImpl() {} |
// Import the "me" card from the Mac Address Book and fill in |profiles_|. |
- void GetAddressBookMeCard(); |
+ void GetAddressBookMeCard(const std::string& app_locale); |
private: |
void GetAddressBookNames(ABPerson* me, |
NSString* addressLabelRaw, |
AutofillProfile* profile); |
- void GetAddressBookAddress(NSDictionary* address, AutofillProfile* profile); |
+ void GetAddressBookAddress(const std::string& app_locale, |
+ NSDictionary* address, |
+ AutofillProfile* profile); |
void GetAddressBookEmail(ABPerson* me, |
NSString* addressLabelRaw, |
AutofillProfile* profile); |
@@ -67,7 +69,8 @@ |
// from the active user's address book. It looks for the user address |
// information and translates it to the internal list of |AutofillProfile| data |
// structures. |
-void AuxiliaryProfilesImpl::GetAddressBookMeCard() { |
+void AuxiliaryProfilesImpl::GetAddressBookMeCard( |
+ const std::string& app_locale) { |
profiles_.clear(); |
// +[ABAddressBook sharedAddressBook] throws an exception internally in |
@@ -122,7 +125,7 @@ |
GetAddressBookNames(me, addressLabelRaw, profile.get()); |
// Fill in address information. |
- GetAddressBookAddress(address, profile.get()); |
+ GetAddressBookAddress(app_locale, address, profile.get()); |
// Fill in email information. |
GetAddressBookEmail(me, addressLabelRaw, profile.get()); |
@@ -158,7 +161,8 @@ |
// second line we join with commas. |
// For example: "c/o John Doe\n1122 Other Avenue\nApt #7" translates to |
// line 1: "c/o John Doe", line 2: "1122 Other Avenue, Apt #7". |
-void AuxiliaryProfilesImpl::GetAddressBookAddress(NSDictionary* address, |
+void AuxiliaryProfilesImpl::GetAddressBookAddress(const std::string& app_locale, |
+ NSDictionary* address, |
AutofillProfile* profile) { |
if (NSString* addressField = [address objectForKey:kABAddressStreetKey]) { |
// If there are newlines in the address, split into two lines. |
@@ -197,7 +201,7 @@ |
if (NSString* country = [address objectForKey:kABAddressCountryKey]) { |
profile->SetInfo(ADDRESS_HOME_COUNTRY, |
base::SysNSStringToUTF16(country), |
- AutofillCountry::ApplicationLocale()); |
+ app_locale); |
} |
} |
@@ -258,5 +262,5 @@ |
// Populate |auxiliary_profiles_| with the Address Book data. |
void PersonalDataManager::LoadAuxiliaryProfiles() { |
AuxiliaryProfilesImpl impl(&auxiliary_profiles_); |
- impl.GetAddressBookMeCard(); |
+ impl.GetAddressBookMeCard(app_locale_); |
} |