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

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

Issue 2515853002: [Payments] Fix new billing address label. (Closed)
Patch Set: Updated test and code added in the Rebase Created 4 years, 1 month 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 b7e3cd458eaaec3a8aa04532e97fb3ae0e468aee..7de6fd815d4a1155705443f4fda2f1925919d198 100644
--- a/chrome/browser/autofill/android/personal_data_manager_android.cc
+++ b/chrome/browser/autofill/android/personal_data_manager_android.cc
@@ -430,10 +430,12 @@ PersonalDataManagerAndroid::GetProfileLabelsToSuggest(
}
base::android::ScopedJavaLocalRef<jstring>
-PersonalDataManagerAndroid::GetAddressLabelForPaymentRequest(
+PersonalDataManagerAndroid::GetShippingAddressLabelForPaymentRequest(
JNIEnv* env,
const base::android::JavaParamRef<jobject>& unused_obj,
const base::android::JavaParamRef<jobject>& jprofile) {
+ // The full name is not included in the label for shipping address. It is
+ // added separately instead.
std::vector<ServerFieldType> label_fields;
label_fields.push_back(COMPANY_NAME);
label_fields.push_back(ADDRESS_HOME_LINE1);
@@ -454,6 +456,31 @@ PersonalDataManagerAndroid::GetAddressLabelForPaymentRequest(
g_browser_process->GetApplicationLocale()));
}
+base::android::ScopedJavaLocalRef<jstring>
+PersonalDataManagerAndroid::GetBillingAddressLabelForPaymentRequest(
+ JNIEnv* env,
+ const base::android::JavaParamRef<jobject>& unused_obj,
+ const base::android::JavaParamRef<jobject>& jprofile) {
+ // The company name and country are not included in the billing address label.
+ std::vector<ServerFieldType> label_fields;
+ label_fields.push_back(NAME_FULL);
+ label_fields.push_back(ADDRESS_HOME_LINE1);
+ label_fields.push_back(ADDRESS_HOME_LINE2);
+ label_fields.push_back(ADDRESS_HOME_DEPENDENT_LOCALITY);
+ label_fields.push_back(ADDRESS_HOME_CITY);
+ label_fields.push_back(ADDRESS_HOME_STATE);
+ label_fields.push_back(ADDRESS_HOME_ZIP);
+ label_fields.push_back(ADDRESS_HOME_SORTING_CODE);
+
+ AutofillProfile profile;
+ PopulateNativeProfileFromJava(jprofile, env, &profile);
+
+ return ConvertUTF16ToJavaString(
+ env, profile.ConstructInferredLabel(
+ label_fields, label_fields.size(),
+ g_browser_process->GetApplicationLocale()));
+}
+
base::android::ScopedJavaLocalRef<jobjectArray>
PersonalDataManagerAndroid::GetCreditCardGUIDsForSettings(
JNIEnv* env,
« 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