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

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

Issue 2712053003: [Payment Request] Displays Contact Info in the payment summary view (Closed)
Patch Set: rebase Created 3 years, 10 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 fe3bdee8a3adca80212d9352dd874434fa28afab..3d959a11a6a709667dfb1877848598076deb7db1 100644
--- a/ios/chrome/browser/payments/payment_request.mm
+++ b/ios/chrome/browser/payments/payment_request.mm
@@ -25,6 +25,7 @@ PaymentRequest::PaymentRequest(
: web_payment_request_(std::move(web_payment_request)),
personal_data_manager_(personal_data_manager),
selected_shipping_profile_(nullptr),
+ selected_contact_profile_(nullptr),
selected_credit_card_(nullptr),
selected_shipping_option_(nullptr) {
PopulateProfileCache();
@@ -56,11 +57,18 @@ void PaymentRequest::PopulateProfileCache() {
for (const auto& profile : personal_data_manager_->GetProfilesToSuggest()) {
profile_cache_.push_back(
base::MakeUnique<autofill::AutofillProfile>(*profile));
- profiles_.push_back(profile_cache_.back().get());
+ shipping_profiles_.push_back(profile_cache_.back().get());
+ // TODO(crbug.com/602666): Implement deduplication rules for profiles.
+ contact_profiles_.push_back(profile_cache_.back().get());
}
- if (!profiles_.empty())
- selected_shipping_profile_ = profiles_[0];
+ // TODO(crbug.com/602666): Implement prioritization rules for shipping and
+ // contact profiles.
+
+ if (!shipping_profiles_.empty())
+ selected_shipping_profile_ = shipping_profiles_[0];
+ if (!contact_profiles_.empty())
+ selected_contact_profile_ = contact_profiles_[0];
}
void PaymentRequest::PopulateCreditCardCache() {
@@ -86,6 +94,8 @@ void PaymentRequest::PopulateCreditCardCache() {
}
}
+ // TODO(crbug.com/602666): Implement prioritization rules for credit cards.
+
if (!credit_cards_.empty())
selected_credit_card_ = credit_cards_[0];
}
« no previous file with comments | « ios/chrome/browser/payments/payment_request.h ('k') | ios/chrome/browser/payments/payment_request_coordinator.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698