| OLD | NEW |
| 1 // Copyright 2017 The Chromium Authors. All rights reserved. | 1 // Copyright 2017 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef IOS_CHROME_BROWSER_PAYMENTS_PAYMENT_REQUEST_H_ | 5 #ifndef IOS_CHROME_BROWSER_PAYMENTS_PAYMENT_REQUEST_H_ |
| 6 #define IOS_CHROME_BROWSER_PAYMENTS_PAYMENT_REQUEST_H_ | 6 #define IOS_CHROME_BROWSER_PAYMENTS_PAYMENT_REQUEST_H_ |
| 7 | 7 |
| 8 #include <memory> | 8 #include <memory> |
| 9 #include <set> | 9 #include <set> |
| 10 #include <string> | 10 #include <string> |
| (...skipping 145 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 156 | 156 |
| 157 // Returns the selected shipping option from |web_payment_request_| if there | 157 // Returns the selected shipping option from |web_payment_request_| if there |
| 158 // is one. Returns nullptr otherwise. | 158 // is one. Returns nullptr otherwise. |
| 159 web::PaymentShippingOption* selected_shipping_option() const { | 159 web::PaymentShippingOption* selected_shipping_option() const { |
| 160 return selected_shipping_option_; | 160 return selected_shipping_option_; |
| 161 } | 161 } |
| 162 | 162 |
| 163 // Returns whether the current PaymentRequest can be used to make a payment. | 163 // Returns whether the current PaymentRequest can be used to make a payment. |
| 164 bool CanMakePayment() const; | 164 bool CanMakePayment() const; |
| 165 | 165 |
| 166 private: | 166 protected: |
| 167 // Fetches the autofill profiles for this user from the PersonalDataManager, | 167 // Fetches the autofill profiles for this user from the PersonalDataManager, |
| 168 // and stores copies of them, owned by this PaymentRequest, in profile_cache_. | 168 // and stores copies of them, owned by this PaymentRequest, in profile_cache_. |
| 169 void PopulateProfileCache(); | 169 void PopulateProfileCache(); |
| 170 | 170 |
| 171 // Sets the available shipping and contact profiles as references to the | 171 // Sets the available shipping and contact profiles as references to the |
| 172 // cached profiles ordered by completeness. | 172 // cached profiles ordered by completeness. |
| 173 void PopulateAvailableProfiles(); | 173 void PopulateAvailableProfiles(); |
| 174 | 174 |
| 175 // Fetches the autofill credit cards for this user from the | 175 // Fetches the autofill credit cards for this user from the |
| 176 // PersonalDataManager that match a supported type specified in | 176 // PersonalDataManager that match a supported type specified in |
| (...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 230 // A vector of pointers to the shipping options in |web_payment_request_|. | 230 // A vector of pointers to the shipping options in |web_payment_request_|. |
| 231 std::vector<web::PaymentShippingOption*> shipping_options_; | 231 std::vector<web::PaymentShippingOption*> shipping_options_; |
| 232 web::PaymentShippingOption* selected_shipping_option_; | 232 web::PaymentShippingOption* selected_shipping_option_; |
| 233 | 233 |
| 234 payments::PaymentsProfileComparator profile_comparator_; | 234 payments::PaymentsProfileComparator profile_comparator_; |
| 235 | 235 |
| 236 DISALLOW_COPY_AND_ASSIGN(PaymentRequest); | 236 DISALLOW_COPY_AND_ASSIGN(PaymentRequest); |
| 237 }; | 237 }; |
| 238 | 238 |
| 239 #endif // IOS_CHROME_BROWSER_PAYMENTS_PAYMENT_REQUEST_H_ | 239 #endif // IOS_CHROME_BROWSER_PAYMENTS_PAYMENT_REQUEST_H_ |
| OLD | NEW |