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

Unified Diff: ios/chrome/browser/payments/payment_request.mm

Issue 2847503002: [WebPayments] Show labels on incomplete profiles (Closed)
Patch Set: ios namespace 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
Index: ios/chrome/browser/payments/payment_request.mm
diff --git a/ios/chrome/browser/payments/payment_request.mm b/ios/chrome/browser/payments/payment_request.mm
index 3b9fe0a4642ad73a64a4cb567ee5be8d31ed042a..6d3c2fc574d05bdcffb32462ccb38868fa3cd7b5 100644
--- a/ios/chrome/browser/payments/payment_request.mm
+++ b/ios/chrome/browser/payments/payment_request.mm
@@ -98,17 +98,20 @@ void PaymentRequest::PopulateProfileCache() {
contact_profiles_.push_back(&profile_cache_.back());
}
+ payments::PaymentsProfileComparator comparator(
+ GetApplicationContext()->GetApplicationLocale(), *this);
+
// TODO(crbug.com/602666): Implement deduplication and prioritization rules
Mathieu 2017/04/27 18:34:01 is this resolved then?
tmartino 2017/04/28 17:10:06 Nope. We'll want to write a shipping method that's
// for shipping profiles.
- contact_profiles_ = payments::profile_util::FilterProfilesForContact(
- contact_profiles_, GetApplicationContext()->GetApplicationLocale(),
- *this);
+ contact_profiles_ = comparator.FilterProfilesForContact(contact_profiles_);
if (!shipping_profiles_.empty())
selected_shipping_profile_ = shipping_profiles_[0];
- if (!contact_profiles_.empty())
+ if (!contact_profiles_.empty() &&
+ comparator.IsContactInfoComplete(contact_profiles_[0])) {
selected_contact_profile_ = contact_profiles_[0];
+ }
}
void PaymentRequest::PopulateCreditCardCache() {
« components/payments/core/profile_util.cc ('K') | « components/payments/core/profile_util_unittest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698