| 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 9b76320a94726e5144505e4368182c49053d825b..4413a88e937345a60eefe6bdef205bb0cf2b574c 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
|
| @@ -675,15 +675,21 @@ public class CardEditor extends EditorBase<AutofillPaymentInstrument>
|
| }
|
| return;
|
| }
|
| -
|
| - final AutofillAddress editAddress = isSelectingIncompleteAddress
|
| - ? new AutofillAddress(mContext,
|
| - findTargetProfile(mProfilesForBillingAddress, eventData.first))
|
| - : null;
|
| + 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.
|
| + profile.setFullName(
|
| + card.getIsLocal() ? mNameField.getValue().toString() : card.getName());
|
| + }
|
| + final AutofillAddress editAddress = new AutofillAddress(mContext, profile);
|
| mAddressEditor.edit(editAddress, new Callback<AutofillAddress>() {
|
| @Override
|
| public void onResult(AutofillAddress billingAddress) {
|
| - if (billingAddress == null || !billingAddress.isComplete()) {
|
| + if (!billingAddress.isComplete()) {
|
| // User cancelled out of the add or edit flow. Restore the selection
|
| // to the card's billing address, if any, else clear the selection.
|
| if (mBillingAddressField.getDropdownKeys().contains(
|
|
|