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

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

Issue 310463005: Fill in more name fields with requestAutocomplete (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: dumb test is dumb Created 6 years, 6 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 bfb32d7a2f361a1a0e90cebeb605de3feac90539..2764743c505998e0c455acfded638bbbf52854ea 100644
--- a/components/autofill/core/browser/webdata/autofill_profile_syncable_service.cc
+++ b/components/autofill/core/browser/webdata/autofill_profile_syncable_service.cc
@@ -332,6 +332,12 @@ bool AutofillProfileSyncableService::OverwriteProfileWithServerData(
specifics.name_middle(), profile) || diff;
diff = UpdateMultivaluedField(NAME_LAST,
specifics.name_last(), profile) || diff;
+ // Older versions don't have a separate full name; don't overwrite full name
+ // in this case.
+ if (specifics.name_full().size() > 0) {
+ diff = UpdateMultivaluedField(NAME_FULL,
+ specifics.name_full(), profile) || diff;
+ }
diff = UpdateMultivaluedField(EMAIL_ADDRESS,
specifics.email_address(), profile) || diff;
diff = UpdateMultivaluedField(PHONE_HOME_WHOLE_NUMBER,
@@ -399,6 +405,7 @@ void AutofillProfileSyncableService::WriteAutofillProfile(
specifics->clear_name_first();
specifics->clear_name_middle();
specifics->clear_name_last();
+ specifics->clear_name_full();
specifics->clear_email_address();
specifics->clear_phone_home_whole_number();
@@ -421,6 +428,11 @@ void AutofillProfileSyncableService::WriteAutofillProfile(
specifics->add_name_last(LimitData(UTF16ToUTF8(values[i])));
}
+ profile.GetRawMultiInfo(NAME_FULL, &values);
+ for (size_t i = 0; i < values.size(); ++i) {
+ specifics->add_name_full(LimitData(UTF16ToUTF8(values[i])));
+ }
+
specifics->set_address_home_line1(
LimitData(UTF16ToUTF8(profile.GetRawInfo(ADDRESS_HOME_LINE1))));
specifics->set_address_home_line2(

Powered by Google App Engine
This is Rietveld 408576698