| 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..16260f1326449e34520c165ac025b51eba90984e 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,15 @@ 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.has_address_home_language_code() &&
|
| + specifics.address_home_language_code() != profile->language_code()) {
|
| + profile->set_language_code(specifics.address_home_language_code());
|
| + diff = true;
|
| + }
|
| +
|
| return diff;
|
| }
|
|
|
| @@ -416,21 +425,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) {
|
|
|