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

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

Issue 2482533002: [Payments] Display warning messages for incomplete shipping address and update editor title (Closed)
Patch Set: refactor function 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/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 d7ff16a44713e4d462c4df3194d59371dd864443..11c58e8a8dd1947a991ab9d1417a5d961e4ada59 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
@@ -153,7 +153,9 @@ public class CardEditor extends EditorBase<AutofillPaymentInstrument>
// browser restart. Server profiles are not supported as billing addresses.
// 2) Include only complete profiles, so that user launches the editor only when
// explicitly selecting [+ ADD ADDRESS] in the dropdown.
- if (profile.getIsLocal() && mAddressEditor.isProfileComplete(profile)) {
+ if (profile.getIsLocal()
+ && AutofillAddress.checkAddressCompletionStatus(profile)
+ == AutofillAddress.COMPLETE) {
mProfilesForBillingAddress.put(profile.getGUID(), profile);
}
}
@@ -313,13 +315,14 @@ public class CardEditor extends EditorBase<AutofillPaymentInstrument>
}
/**
- * Adds the given billing address to the list of billing addresses. If the address is already
- * known, then updates the existing address. Should be called before opening the card editor.
+ * Adds the given billing address to the list of billing addresses, if it's complete. If the
+ * address is already known, then updates the existing address. Should be called before opening
+ * the card editor.
*
- * @param billingAddress The billing address to add or update. Should not be null. Should be
- * complete.
+ * @param billingAddress The billing address to add or update. Should not be null.
*/
- public void updateBillingAddress(AutofillAddress billingAddress) {
+ public void updateBillingAddressIfComplete(AutofillAddress billingAddress) {
+ if (!billingAddress.isComplete()) return;
mProfilesForBillingAddress.put(billingAddress.getIdentifier(), billingAddress.getProfile());
}

Powered by Google App Engine
This is Rietveld 408576698