| 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_TEST_PAYMENT_REQUEST_H_ | 5 #ifndef IOS_CHROME_BROWSER_PAYMENTS_TEST_PAYMENT_REQUEST_H_ |
| 6 #define IOS_CHROME_BROWSER_PAYMENTS_TEST_PAYMENT_REQUEST_H_ | 6 #define IOS_CHROME_BROWSER_PAYMENTS_TEST_PAYMENT_REQUEST_H_ |
| 7 | 7 |
| 8 #include "base/macros.h" | 8 #include "base/macros.h" |
| 9 #include "ios/chrome/browser/payments/payment_request.h" | 9 #include "ios/chrome/browser/payments/payment_request.h" |
| 10 | 10 |
| 11 namespace autofill { | 11 namespace autofill { |
| 12 class PersonalDataManager; | 12 class PersonalDataManager; |
| 13 class RegionDataLoader; | 13 class RegionDataLoader; |
| 14 } // namespace autofill | 14 } // namespace autofill |
| 15 | 15 |
| 16 namespace ios { |
| 17 class ChromeBrowserState; |
| 18 } // namespace ios |
| 19 |
| 16 namespace payments { | 20 namespace payments { |
| 17 class PaymentsProfileComparator; | 21 class PaymentsProfileComparator; |
| 18 } // namespace payments | 22 } // namespace payments |
| 19 | 23 |
| 20 namespace web { | 24 namespace web { |
| 21 class PaymentRequest; | 25 class PaymentRequest; |
| 22 class PaymentShippingOption; | 26 class PaymentShippingOption; |
| 23 } // namespace web | 27 } // namespace web |
| 24 | 28 |
| 25 // PaymentRequest for use in tests. | 29 // PaymentRequest for use in tests. |
| 26 class TestPaymentRequest : public PaymentRequest { | 30 class TestPaymentRequest : public PaymentRequest { |
| 27 public: | 31 public: |
| 28 // |personal_data_manager| should not be null and should outlive this object. | 32 // |personal_data_manager| should not be null and should outlive this object. |
| 29 TestPaymentRequest(const web::PaymentRequest& web_payment_request, | 33 TestPaymentRequest(const web::PaymentRequest& web_payment_request, |
| 34 ios::ChromeBrowserState* browser_state, |
| 30 autofill::PersonalDataManager* personal_data_manager, | 35 autofill::PersonalDataManager* personal_data_manager, |
| 31 id<PaymentRequestUIDelegate> payment_request_ui_delegate) | 36 id<PaymentRequestUIDelegate> payment_request_ui_delegate) |
| 32 : PaymentRequest(web_payment_request, | 37 : PaymentRequest(web_payment_request, |
| 38 browser_state, |
| 33 personal_data_manager, | 39 personal_data_manager, |
| 34 payment_request_ui_delegate), | 40 payment_request_ui_delegate), |
| 35 region_data_loader_(nullptr), | 41 region_data_loader_(nullptr), |
| 36 profile_comparator_(nullptr) {} | 42 profile_comparator_(nullptr) {} |
| 37 | 43 |
| 38 TestPaymentRequest(const web::PaymentRequest& web_payment_request, | 44 TestPaymentRequest(const web::PaymentRequest& web_payment_request, |
| 39 autofill::PersonalDataManager* personal_data_manager) | 45 autofill::PersonalDataManager* personal_data_manager) |
| 40 : TestPaymentRequest(web_payment_request, personal_data_manager, nil) {} | 46 : TestPaymentRequest(web_payment_request, |
| 47 nil, |
| 48 personal_data_manager, |
| 49 nil) {} |
| 41 | 50 |
| 42 ~TestPaymentRequest() override {} | 51 ~TestPaymentRequest() override {} |
| 43 | 52 |
| 44 void SetRegionDataLoader(autofill::RegionDataLoader* region_data_loader) { | 53 void SetRegionDataLoader(autofill::RegionDataLoader* region_data_loader) { |
| 45 region_data_loader_ = region_data_loader; | 54 region_data_loader_ = region_data_loader; |
| 46 } | 55 } |
| 47 | 56 |
| 48 void SetProfileComparator( | 57 void SetProfileComparator( |
| 49 payments::PaymentsProfileComparator* profile_comparator) { | 58 payments::PaymentsProfileComparator* profile_comparator) { |
| 50 profile_comparator_ = profile_comparator; | 59 profile_comparator_ = profile_comparator; |
| (...skipping 25 matching lines...) Expand all Loading... |
| 76 // Not owned and must outlive this object. | 85 // Not owned and must outlive this object. |
| 77 autofill::RegionDataLoader* region_data_loader_; | 86 autofill::RegionDataLoader* region_data_loader_; |
| 78 | 87 |
| 79 // Not owned and must outlive this object. | 88 // Not owned and must outlive this object. |
| 80 payments::PaymentsProfileComparator* profile_comparator_; | 89 payments::PaymentsProfileComparator* profile_comparator_; |
| 81 | 90 |
| 82 DISALLOW_COPY_AND_ASSIGN(TestPaymentRequest); | 91 DISALLOW_COPY_AND_ASSIGN(TestPaymentRequest); |
| 83 }; | 92 }; |
| 84 | 93 |
| 85 #endif // IOS_CHROME_BROWSER_PAYMENTS_TEST_PAYMENT_REQUEST_H_ | 94 #endif // IOS_CHROME_BROWSER_PAYMENTS_TEST_PAYMENT_REQUEST_H_ |
| OLD | NEW |