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

Unified Diff: chrome/browser/webdata/autofill_profile_syncable_service.cc

Issue 13697002: Make autofill's Address store country using the country code so that app locale isn't needed for th… (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 7 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/webdata/autofill_profile_syncable_service.cc
===================================================================
--- chrome/browser/webdata/autofill_profile_syncable_service.cc (revision 192389)
+++ chrome/browser/webdata/autofill_profile_syncable_service.cc (working copy)
@@ -8,6 +8,8 @@
#include "base/location.h"
#include "base/logging.h"
#include "base/utf_string_conversions.h"
+#include "chrome/browser/browser_process.h"
+#include "components/autofill/browser/autofill_country.h"
#include "components/autofill/browser/autofill_profile.h"
#include "components/autofill/browser/form_group.h"
#include "components/webdata/autofill/autofill_table.h"
@@ -315,8 +317,11 @@
specifics.address_home_city(), profile) || diff;
diff = UpdateField(ADDRESS_HOME_STATE,
specifics.address_home_state(), profile) || diff;
- diff = UpdateField(ADDRESS_HOME_COUNTRY,
- specifics.address_home_country(), profile) || diff;
+ string16 country_name_or_code =
+ ASCIIToUTF16(specifics.address_home_country());
+ std::string country_code = AutofillCountry::GetCountryCode(
+ country_name_or_code, g_browser_process->GetApplicationLocale());
Ilya Sherman 2013/04/05 05:18:01 Again, this happens on the DB thread (I think), so
jam 2013/04/05 06:45:54 Done.
jam 2013/04/05 06:45:54 Done.
+ diff = UpdateField(ADDRESS_HOME_COUNTRY, country_code, profile) || diff;
diff = UpdateField(ADDRESS_HOME_ZIP,
specifics.address_home_zip(), profile) || diff;
diff = UpdateMultivaluedField(EMAIL_ADDRESS,

Powered by Google App Engine
This is Rietveld 408576698