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

Unified Diff: chrome/browser/autofill/android/personal_data_manager_android.cc

Issue 2287513002: [Payments] Show name and address when selecting a CC billing address. (Closed)
Patch Set: Fixed error Created 4 years, 4 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
« no previous file with comments | « chrome/browser/autofill/android/personal_data_manager_android.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/autofill/android/personal_data_manager_android.cc
diff --git a/chrome/browser/autofill/android/personal_data_manager_android.cc b/chrome/browser/autofill/android/personal_data_manager_android.cc
index 156ead71007dc6def02a3e45f40db521b4fcfc69..b3d09e0a520a7f2d3fe3cd11d364d460da442560 100644
--- a/chrome/browser/autofill/android/personal_data_manager_android.cc
+++ b/chrome/browser/autofill/android/personal_data_manager_android.cc
@@ -368,14 +368,16 @@ ScopedJavaLocalRef<jobjectArray>
PersonalDataManagerAndroid::GetProfileLabelsForSettings(
JNIEnv* env,
const JavaParamRef<jobject>& unused_obj) {
- return GetProfileLabels(env, false, personal_data_manager_->GetProfiles());
+ return GetProfileLabels(env, false, false,
+ personal_data_manager_->GetProfiles());
}
ScopedJavaLocalRef<jobjectArray>
PersonalDataManagerAndroid::GetProfileLabelsToSuggest(
JNIEnv* env,
- const JavaParamRef<jobject>& unused_obj) {
- return GetProfileLabels(env, true,
+ const JavaParamRef<jobject>& unused_obj,
+ jboolean include_name) {
+ return GetProfileLabels(env, true, include_name,
personal_data_manager_->GetProfilesToSuggest());
}
@@ -657,11 +659,14 @@ ScopedJavaLocalRef<jobjectArray> PersonalDataManagerAndroid::GetCreditCardGUIDs(
ScopedJavaLocalRef<jobjectArray> PersonalDataManagerAndroid::GetProfileLabels(
JNIEnv* env,
bool address_only,
+ bool include_name,
std::vector<AutofillProfile*> profiles) {
std::unique_ptr<std::vector<ServerFieldType>> suggested_fields;
size_t minimal_fields_shown = 2;
if (address_only) {
suggested_fields.reset(new std::vector<ServerFieldType>);
+ if (include_name)
+ suggested_fields->push_back(NAME_FULL);
suggested_fields->push_back(COMPANY_NAME);
suggested_fields->push_back(ADDRESS_HOME_LINE1);
suggested_fields->push_back(ADDRESS_HOME_LINE2);
@@ -674,9 +679,11 @@ ScopedJavaLocalRef<jobjectArray> PersonalDataManagerAndroid::GetProfileLabels(
minimal_fields_shown = suggested_fields->size();
}
+ ServerFieldType excluded_field = include_name ? UNKNOWN_TYPE : NAME_FULL;
+
std::vector<base::string16> labels;
AutofillProfile::CreateInferredLabels(
- profiles, suggested_fields.get(), NAME_FULL, minimal_fields_shown,
+ profiles, suggested_fields.get(), excluded_field, minimal_fields_shown,
g_browser_process->GetApplicationLocale(), &labels);
return base::android::ToJavaArrayOfStrings(env, labels);
« no previous file with comments | « chrome/browser/autofill/android/personal_data_manager_android.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698