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

Unified Diff: chrome/android/java/src/org/chromium/chrome/browser/payments/CardEditor.java

Issue 2798023004: Prefill the billing address name only when adding a new address. (Closed)
Patch Set: Created 3 years, 8 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698