| 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 e61c810571beced6a74c25b99a209b188869f545..b0ef5fe919c6e864b1fb9148934309affb3cff5d 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];
|
| }
|
|
|