Chromium Code Reviews| Index: components/autofill/core/browser/webdata/autofill_profile_syncable_service.cc |
| diff --git a/components/autofill/core/browser/webdata/autofill_profile_syncable_service.cc b/components/autofill/core/browser/webdata/autofill_profile_syncable_service.cc |
| index 5baf5566b77c4b6ba794d4d7632f8b526076fdbf..a8ea6f8f7f5de49eb2fbebc18ec66e840f7323ff 100644 |
| --- a/components/autofill/core/browser/webdata/autofill_profile_syncable_service.cc |
| +++ b/components/autofill/core/browser/webdata/autofill_profile_syncable_service.cc |
| @@ -374,6 +374,14 @@ bool AutofillProfileSyncableService::OverwriteProfileWithServerData( |
| diff = UpdateField(ADDRESS_HOME_LINE2, |
| specifics.address_home_line2(), profile) || diff; |
| } |
| + |
| + // Update the BCP 47 language code that can be used to format the address for |
| + // display. |
| + if (specifics.address_home_language_code() != profile->language_code()) { |
|
Nicolas Zea
2014/03/28 18:43:57
You should probably check has_address_home_languag
please use gerrit instead
2014/03/28 22:00:38
Done.
|
| + profile->set_language_code(specifics.address_home_language_code()); |
| + diff = true; |
| + } |
| + |
| return diff; |
| } |
| @@ -416,21 +424,22 @@ void AutofillProfileSyncableService::WriteAutofillProfile( |
| LimitData(UTF16ToUTF8(profile.GetRawInfo(ADDRESS_HOME_LINE1)))); |
| specifics->set_address_home_line2( |
| LimitData(UTF16ToUTF8(profile.GetRawInfo(ADDRESS_HOME_LINE2)))); |
| + specifics->set_address_home_street_address( |
| + LimitData(UTF16ToUTF8(profile.GetRawInfo(ADDRESS_HOME_STREET_ADDRESS)))); |
| + specifics->set_address_home_dependent_locality( |
| + LimitData( |
| + UTF16ToUTF8(profile.GetRawInfo(ADDRESS_HOME_DEPENDENT_LOCALITY)))); |
| specifics->set_address_home_city( |
| LimitData(UTF16ToUTF8(profile.GetRawInfo(ADDRESS_HOME_CITY)))); |
| specifics->set_address_home_state( |
| LimitData(UTF16ToUTF8(profile.GetRawInfo(ADDRESS_HOME_STATE)))); |
| specifics->set_address_home_zip( |
| LimitData(UTF16ToUTF8(profile.GetRawInfo(ADDRESS_HOME_ZIP)))); |
| - specifics->set_address_home_country( |
| - LimitData(UTF16ToUTF8(profile.GetRawInfo(ADDRESS_HOME_COUNTRY)))); |
| - specifics->set_address_home_street_address( |
| - LimitData(UTF16ToUTF8(profile.GetRawInfo(ADDRESS_HOME_STREET_ADDRESS)))); |
| specifics->set_address_home_sorting_code( |
| LimitData(UTF16ToUTF8(profile.GetRawInfo(ADDRESS_HOME_SORTING_CODE)))); |
| - specifics->set_address_home_dependent_locality( |
| - LimitData( |
| - UTF16ToUTF8(profile.GetRawInfo(ADDRESS_HOME_DEPENDENT_LOCALITY)))); |
| + specifics->set_address_home_country( |
| + LimitData(UTF16ToUTF8(profile.GetRawInfo(ADDRESS_HOME_COUNTRY)))); |
| + specifics->set_address_home_language_code(LimitData(profile.language_code())); |
| profile.GetRawMultiInfo(EMAIL_ADDRESS, &values); |
| for (size_t i = 0; i < values.size(); ++i) { |