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

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

Issue 1582353006: CountryNames: Separate data creation from usage (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@571610_exposeCountryNamesToTesting
Patch Set: Just rebased Created 4 years, 11 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 dcbeda26c87d23e510f250484dd278d6af7fb025..ef741487f179974433dae1ca4594aea7320b37f1 100644
--- a/components/autofill/core/browser/webdata/autofill_profile_syncable_service.cc
+++ b/components/autofill/core/browser/webdata/autofill_profile_syncable_service.cc
@@ -305,8 +305,7 @@ bool AutofillProfileSyncableService::SaveChangesToWebData(
// static
bool AutofillProfileSyncableService::OverwriteProfileWithServerData(
const sync_pb::AutofillProfileSpecifics& specifics,
- AutofillProfile* profile,
- const std::string& app_locale) {
+ AutofillProfile* profile) {
bool diff = false;
if (specifics.has_origin() && profile->origin() != specifics.origin()) {
bool was_verified = profile->IsVerified();
@@ -367,8 +366,8 @@ bool AutofillProfileSyncableService::OverwriteProfileWithServerData(
// version of Chrome).
base::string16 country_name_or_code =
ASCIIToUTF16(specifics.address_home_country());
- std::string country_code = CountryNames::GetInstance()->GetCountryCode(
- country_name_or_code, app_locale);
+ std::string country_code =
+ CountryNames::GetInstance()->GetCountryCode(country_name_or_code);
diff = UpdateField(ADDRESS_HOME_COUNTRY, country_code, profile) || diff;
// Update the street address. In newer versions of Chrome (M34+), this data
@@ -497,8 +496,8 @@ AutofillProfileSyncableService::CreateOrUpdateProfile(
autofill_specifics.guid());
if (existing_profile != profile_map->end()) {
// The synced profile already exists locally. It might need to be updated.
- if (OverwriteProfileWithServerData(
- autofill_specifics, existing_profile->second, app_locale_)) {
+ if (OverwriteProfileWithServerData(autofill_specifics,
+ existing_profile->second)) {
bundle->profiles_to_update.push_back(existing_profile->second);
}
return existing_profile;
@@ -507,7 +506,7 @@ AutofillProfileSyncableService::CreateOrUpdateProfile(
// New profile synced.
AutofillProfile* new_profile = new AutofillProfile(
autofill_specifics.guid(), autofill_specifics.origin());
- OverwriteProfileWithServerData(autofill_specifics, new_profile, app_locale_);
+ OverwriteProfileWithServerData(autofill_specifics, new_profile);
// Check if profile appears under a different guid. Compares only profile
// contents. (Ignores origin and language code in comparison.)

Powered by Google App Engine
This is Rietveld 408576698