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

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

Issue 2515853002: [Payments] Fix new billing address label. (Closed)
Patch Set: Addressed comments 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
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 beb49d2353600f7610128d878105eeffb42dc3c9..18d886d11b972395a16e0bbf90eacd422c2fc156 100644
--- a/chrome/browser/autofill/android/personal_data_manager_android.cc
+++ b/chrome/browser/autofill/android/personal_data_manager_android.cc
@@ -409,10 +409,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);
@@ -433,6 +435,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 is not included in the billing address label.
please use gerrit instead 2016/11/21 16:34:53 s/company name/company name and country/
+ 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,

Powered by Google App Engine
This is Rietveld 408576698