| Index: chrome/android/java/src/org/chromium/chrome/browser/payments/CardEditor.java
|
| diff --git a/chrome/android/java/src/org/chromium/chrome/browser/payments/CardEditor.java b/chrome/android/java/src/org/chromium/chrome/browser/payments/CardEditor.java
|
| index fd38e244db4d08daed0b732c0e097593a3655be7..74fae0ede982be3f78da62965d492d3c3c667995 100644
|
| --- a/chrome/android/java/src/org/chromium/chrome/browser/payments/CardEditor.java
|
| +++ b/chrome/android/java/src/org/chromium/chrome/browser/payments/CardEditor.java
|
| @@ -678,16 +678,19 @@ public class CardEditor extends EditorBase<AutofillPaymentInstrument>
|
| }
|
| return;
|
| }
|
| - assert isAddingNewAddress || isSelectingIncompleteAddress;
|
| + assert isAddingNewAddress != isSelectingIncompleteAddress;
|
|
|
| - AutofillProfile profile = isSelectingIncompleteAddress
|
| - ? findTargetProfile(mProfilesForBillingAddress, eventData.first)
|
| - : new AutofillProfile();
|
| - if (TextUtils.isEmpty(profile.getFullName())) {
|
| - // Prefill card holder name as the billing address name.
|
| + AutofillProfile profile;
|
| + if (isAddingNewAddress) {
|
| + profile = new AutofillProfile();
|
| + // Prefill card holder name as the billing address name only when adding a new
|
| + // address.
|
| profile.setFullName(
|
| card.getIsLocal() ? mNameField.getValue().toString() : card.getName());
|
| + } else {
|
| + profile = findTargetProfile(mProfilesForBillingAddress, eventData.first);
|
| }
|
| +
|
| final AutofillAddress editAddress = new AutofillAddress(mContext, profile);
|
| mAddressEditor.edit(editAddress, new Callback<AutofillAddress>() {
|
| @Override
|
|
|