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

Unified Diff: components/payments/content/payment_request_state.cc

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: components/payments/content/payment_request_state.cc
diff --git a/components/payments/content/payment_request_state.cc b/components/payments/content/payment_request_state.cc
index 5628fadf082bc092d1a9dd21c379a2b2d38253bf..ebce279bf598b4bc93424e3210c94baf0fd4d7cd 100644
--- a/components/payments/content/payment_request_state.cc
+++ b/components/payments/content/payment_request_state.cc
@@ -18,7 +18,6 @@
#include "components/payments/core/autofill_payment_instrument.h"
#include "components/payments/core/payment_instrument.h"
#include "components/payments/core/payment_request_delegate.h"
-#include "components/payments/core/profile_util.h"
namespace payments {
@@ -36,7 +35,8 @@ PaymentRequestState::PaymentRequestState(
selected_shipping_profile_(nullptr),
selected_contact_profile_(nullptr),
selected_instrument_(nullptr),
- payment_request_delegate_(payment_request_delegate) {
+ payment_request_delegate_(payment_request_delegate),
+ profile_comparator_(app_locale, *spec) {
PopulateProfileCache();
SetDefaultProfileSelections();
}
@@ -186,8 +186,8 @@ void PaymentRequestState::PopulateProfileCache() {
return p.get();
});
- contact_profiles_ = profile_util::FilterProfilesForContact(
- raw_profiles_for_filtering, GetApplicationLocale(), *spec_);
+ contact_profiles_ = profile_comparator()->FilterProfilesForContact(
+ raw_profiles_for_filtering);
// Create the list of available instruments.
const std::vector<autofill::CreditCard*>& cards =
@@ -246,8 +246,7 @@ bool PaymentRequestState::ArePaymentOptionsSatisfied() {
if (spec_->request_shipping() && selected_shipping_profile_ == nullptr)
return false;
- profile_util::PaymentsProfileComparator comparator(app_locale_, *spec_);
- return comparator.IsContactInfoComplete(selected_contact_profile_);
+ return profile_comparator()->IsContactInfoComplete(selected_contact_profile_);
}
} // namespace payments

Powered by Google App Engine
This is Rietveld 408576698