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

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

Issue 2847503002: [WebPayments] Show labels on incomplete profiles (Closed)
Patch Set: test fix 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 | « components/payments/core/profile_util_unittest.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..784c86a2ecc1443d3f71b6774a9207b3c530918d 100644
--- a/ios/chrome/browser/payments/payment_request.mm
+++ b/ios/chrome/browser/payments/payment_request.mm
@@ -11,7 +11,7 @@
#include "components/autofill/core/browser/personal_data_manager.h"
#include "components/payments/core/currency_formatter.h"
#include "components/payments/core/payment_request_data_util.h"
-#include "components/payments/core/profile_util.h"
+#include "components/payments/core/payments_profile_comparator.h"
#include "ios/chrome/browser/application_context.h"
#include "ios/web/public/payments/payment_request.h"
@@ -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
// 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() {
« no previous file with comments | « 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