Commit 7e9ce578 authored by twellington's avatar twellington Committed by Commit bot

Use SetRawInfo in PersonalDataManagerAndroid::PopulateNativeProfileFromJava

SetInfo parses phone numbers and gets rid of invalid ones, so SetRawInfo
should be used instead. This is consistent with AutofillOptionsHandler::SetAddress

BUG=455314

Review URL: https://codereview.chromium.org/1139533007

Cr-Commit-Position: refs/heads/master@{#330401}
parent bb537f10
...@@ -78,58 +78,41 @@ void PopulateNativeProfileFromJava( ...@@ -78,58 +78,41 @@ void PopulateNativeProfileFromJava(
Java_AutofillProfile_getOrigin(env, jprofile))); Java_AutofillProfile_getOrigin(env, jprofile)));
profile->SetInfo( profile->SetInfo(
AutofillType(NAME_FULL), AutofillType(NAME_FULL),
ConvertJavaStringToUTF16( ConvertJavaStringToUTF16(Java_AutofillProfile_getFullName(env, jprofile)),
Java_AutofillProfile_getFullName(env, jprofile)),
g_browser_process->GetApplicationLocale());
profile->SetInfo(
AutofillType(COMPANY_NAME),
ConvertJavaStringToUTF16(
Java_AutofillProfile_getCompanyName(env, jprofile)),
g_browser_process->GetApplicationLocale());
profile->SetInfo(
AutofillType(ADDRESS_HOME_STREET_ADDRESS),
ConvertJavaStringToUTF16(
Java_AutofillProfile_getStreetAddress(env, jprofile)),
g_browser_process->GetApplicationLocale());
profile->SetInfo(
AutofillType(ADDRESS_HOME_STATE),
ConvertJavaStringToUTF16(
Java_AutofillProfile_getRegion(env, jprofile)),
g_browser_process->GetApplicationLocale());
profile->SetInfo(
AutofillType(ADDRESS_HOME_CITY),
ConvertJavaStringToUTF16(
Java_AutofillProfile_getLocality(env, jprofile)),
g_browser_process->GetApplicationLocale()); g_browser_process->GetApplicationLocale());
profile->SetInfo( profile->SetRawInfo(autofill::COMPANY_NAME,
AutofillType(ADDRESS_HOME_DEPENDENT_LOCALITY), ConvertJavaStringToUTF16(
Java_AutofillProfile_getCompanyName(env, jprofile)));
profile->SetRawInfo(
autofill::ADDRESS_HOME_STREET_ADDRESS,
ConvertJavaStringToUTF16( ConvertJavaStringToUTF16(
Java_AutofillProfile_getDependentLocality(env, jprofile)), Java_AutofillProfile_getStreetAddress(env, jprofile)));
g_browser_process->GetApplicationLocale()); profile->SetRawInfo(
profile->SetInfo( autofill::ADDRESS_HOME_STATE,
AutofillType(ADDRESS_HOME_ZIP), ConvertJavaStringToUTF16(Java_AutofillProfile_getRegion(env, jprofile)));
profile->SetRawInfo(autofill::ADDRESS_HOME_CITY,
ConvertJavaStringToUTF16(
Java_AutofillProfile_getLocality(env, jprofile)));
profile->SetRawInfo(
autofill::ADDRESS_HOME_DEPENDENT_LOCALITY,
ConvertJavaStringToUTF16( ConvertJavaStringToUTF16(
Java_AutofillProfile_getPostalCode(env, jprofile)), Java_AutofillProfile_getDependentLocality(env, jprofile)));
g_browser_process->GetApplicationLocale()); profile->SetRawInfo(autofill::ADDRESS_HOME_ZIP,
profile->SetInfo( ConvertJavaStringToUTF16(
AutofillType(ADDRESS_HOME_SORTING_CODE), Java_AutofillProfile_getPostalCode(env, jprofile)));
ConvertJavaStringToUTF16( profile->SetRawInfo(autofill::ADDRESS_HOME_SORTING_CODE,
Java_AutofillProfile_getSortingCode(env, jprofile)), ConvertJavaStringToUTF16(
g_browser_process->GetApplicationLocale()); Java_AutofillProfile_getSortingCode(env, jprofile)));
profile->SetInfo(AutofillType(ADDRESS_HOME_COUNTRY), profile->SetInfo(AutofillType(ADDRESS_HOME_COUNTRY),
ConvertJavaStringToUTF16( ConvertJavaStringToUTF16(
Java_AutofillProfile_getCountryCode(env, jprofile)), Java_AutofillProfile_getCountryCode(env, jprofile)),
g_browser_process->GetApplicationLocale()); g_browser_process->GetApplicationLocale());
profile->SetInfo( profile->SetRawInfo(autofill::PHONE_HOME_WHOLE_NUMBER,
AutofillType(PHONE_HOME_WHOLE_NUMBER), ConvertJavaStringToUTF16(
ConvertJavaStringToUTF16( Java_AutofillProfile_getPhoneNumber(env, jprofile)));
Java_AutofillProfile_getPhoneNumber(env, jprofile)), profile->SetRawInfo(autofill::EMAIL_ADDRESS,
g_browser_process->GetApplicationLocale()); ConvertJavaStringToUTF16(
profile->SetInfo( Java_AutofillProfile_getEmailAddress(env, jprofile)));
AutofillType(EMAIL_ADDRESS),
ConvertJavaStringToUTF16(
Java_AutofillProfile_getEmailAddress(env, jprofile)),
g_browser_process->GetApplicationLocale());
profile->set_language_code( profile->set_language_code(
ConvertJavaStringToUTF8( ConvertJavaStringToUTF8(
Java_AutofillProfile_getLanguageCode(env, jprofile))); Java_AutofillProfile_getLanguageCode(env, jprofile)));
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment