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

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

Issue 2438343002: [Payments] Don't suggest profiles with no street address in PR. (Closed)
Patch Set: Added test Created 4 years, 2 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 | chrome/android/javatests/src/org/chromium/chrome/browser/payments/PaymentRequestDynamicShippingMultipleAddressesTest.java » ('j') | 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/PaymentRequestImpl.java
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/payments/PaymentRequestImpl.java b/chrome/android/java/src/org/chromium/chrome/browser/payments/PaymentRequestImpl.java
index 44bc75d4b1ef2bfa34541677372ae808c686100a..4a996b60ef039fd4675928385cb9fe59df94da83 100644
--- a/chrome/android/java/src/org/chromium/chrome/browser/payments/PaymentRequestImpl.java
+++ b/chrome/android/java/src/org/chromium/chrome/browser/payments/PaymentRequestImpl.java
@@ -287,8 +287,11 @@ public class PaymentRequestImpl implements PaymentRequest, PaymentRequestUI.Clie
AutofillProfile profile = profiles.get(i);
mAddressEditor.addPhoneNumberIfValid(profile.getPhoneNumber());
- boolean isComplete = mAddressEditor.isProfileComplete(profile);
- addresses.add(new AutofillAddress(profile, isComplete));
+ // Only suggest addresses that have a street address.
+ if (!TextUtils.isEmpty(profile.getStreetAddress())) {
+ boolean isComplete = mAddressEditor.isProfileComplete(profile);
+ addresses.add(new AutofillAddress(profile, isComplete));
+ }
}
// Suggest complete addresses first.
« no previous file with comments | « no previous file | chrome/android/javatests/src/org/chromium/chrome/browser/payments/PaymentRequestDynamicShippingMultipleAddressesTest.java » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698