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

Unified Diff: components/autofill/core/browser/webdata/autofill_profile_syncable_service.cc

Issue 212873003: Store the language code for the address in autofill profile. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Address comments. Created 6 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: 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..cb57298b52b006fb03d7160e60a266e9d783e600 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() &&
Ilya Sherman 2014/04/02 23:48:11 Hmm, I wonder whether we should similarly test spe
please use gerrit instead 2014/04/08 21:33:31 Done.
+ specifics.address_home_language_code() != profile->language_code()) {
+ profile->set_language_code(specifics.address_home_language_code());
+ diff = true;
+ }
+
return diff;
}
@@ -431,6 +440,7 @@ void AutofillProfileSyncableService::WriteAutofillProfile(
specifics->set_address_home_dependent_locality(
LimitData(
UTF16ToUTF8(profile.GetRawInfo(ADDRESS_HOME_DEPENDENT_LOCALITY))));
+ specifics->set_address_home_language_code(LimitData(profile.language_code()));
profile.GetRawMultiInfo(EMAIL_ADDRESS, &values);
for (size_t i = 0; i < values.size(); ++i) {

Powered by Google App Engine
This is Rietveld 408576698