| 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 COMPONENTS_PAYMENTS_CORE_TEST_PAYMENT_REQUEST_DELEGATE_H_ | 5 #ifndef COMPONENTS_PAYMENTS_CORE_TEST_PAYMENT_REQUEST_DELEGATE_H_ |
| 6 #define COMPONENTS_PAYMENTS_CORE_TEST_PAYMENT_REQUEST_DELEGATE_H_ | 6 #define COMPONENTS_PAYMENTS_CORE_TEST_PAYMENT_REQUEST_DELEGATE_H_ |
| 7 | 7 |
| 8 #include <string> |
| 9 |
| 8 #include "components/payments/core/payment_request_delegate.h" | 10 #include "components/payments/core/payment_request_delegate.h" |
| 9 #include "components/payments/core/test_address_normalizer.h" | 11 #include "components/payments/core/test_address_normalizer.h" |
| 10 | 12 |
| 11 namespace payments { | 13 namespace payments { |
| 12 | 14 |
| 13 class TestPaymentRequestDelegate : public PaymentRequestDelegate { | 15 class TestPaymentRequestDelegate : public PaymentRequestDelegate { |
| 14 public: | 16 public: |
| 15 TestPaymentRequestDelegate( | 17 TestPaymentRequestDelegate( |
| 16 autofill::PersonalDataManager* personal_data_manager); | 18 autofill::PersonalDataManager* personal_data_manager); |
| 17 ~TestPaymentRequestDelegate() override; | 19 ~TestPaymentRequestDelegate() override; |
| 18 | 20 |
| 19 // PaymentRequestDelegate | 21 // PaymentRequestDelegate |
| 20 void ShowDialog(PaymentRequest* request) override {} | 22 void ShowDialog(PaymentRequest* request) override {} |
| 21 void CloseDialog() override {} | 23 void CloseDialog() override {} |
| 22 void ShowErrorMessage() override {} | 24 void ShowErrorMessage() override {} |
| 23 autofill::PersonalDataManager* GetPersonalDataManager() override; | 25 autofill::PersonalDataManager* GetPersonalDataManager() override; |
| 24 const std::string& GetApplicationLocale() const override; | 26 const std::string& GetApplicationLocale() const override; |
| 25 bool IsIncognito() const override; | 27 bool IsIncognito() const override; |
| 26 bool IsSslCertificateValid() override; | 28 bool IsSslCertificateValid() override; |
| 27 const GURL& GetLastCommittedURL() const override; | 29 const GURL& GetLastCommittedURL() const override; |
| 28 void DoFullCardRequest( | 30 void DoFullCardRequest( |
| 29 const autofill::CreditCard& credit_card, | 31 const autofill::CreditCard& credit_card, |
| 30 base::WeakPtr<autofill::payments::FullCardRequest::ResultDelegate> | 32 base::WeakPtr<autofill::payments::FullCardRequest::ResultDelegate> |
| 31 result_delegate) override; | 33 result_delegate) override; |
| 32 AddressNormalizer* GetAddressNormalizer() override; | 34 AddressNormalizer* GetAddressNormalizer() override; |
| 33 autofill::RegionDataLoader* GetRegionDataLoader() override; | 35 autofill::RegionDataLoader* GetRegionDataLoader() override; |
| 34 ukm::UkmService* GetUkmService() override; | 36 ukm::UkmService* GetUkmService() override; |
| 37 std::string GetAuthenticatedEmail() const override; |
| 38 PrefService* GetPrefService() override; |
| 35 | 39 |
| 36 TestAddressNormalizer* test_address_normalizer(); | 40 TestAddressNormalizer* test_address_normalizer(); |
| 37 void DelayFullCardRequestCompletion(); | 41 void DelayFullCardRequestCompletion(); |
| 38 void CompleteFullCardRequest(); | 42 void CompleteFullCardRequest(); |
| 39 | 43 |
| 40 private: | 44 private: |
| 41 autofill::PersonalDataManager* personal_data_manager_; | 45 autofill::PersonalDataManager* personal_data_manager_; |
| 42 std::string locale_; | 46 std::string locale_; |
| 43 const GURL last_committed_url_; | 47 const GURL last_committed_url_; |
| 44 TestAddressNormalizer address_normalizer_; | 48 TestAddressNormalizer address_normalizer_; |
| 45 | 49 |
| 46 bool instantaneous_full_card_request_result_ = true; | 50 bool instantaneous_full_card_request_result_ = true; |
| 47 autofill::CreditCard full_card_request_card_; | 51 autofill::CreditCard full_card_request_card_; |
| 48 base::WeakPtr<autofill::payments::FullCardRequest::ResultDelegate> | 52 base::WeakPtr<autofill::payments::FullCardRequest::ResultDelegate> |
| 49 full_card_result_delegate_; | 53 full_card_result_delegate_; |
| 50 DISALLOW_COPY_AND_ASSIGN(TestPaymentRequestDelegate); | 54 DISALLOW_COPY_AND_ASSIGN(TestPaymentRequestDelegate); |
| 51 }; | 55 }; |
| 52 | 56 |
| 53 } // namespace payments | 57 } // namespace payments |
| 54 | 58 |
| 55 #endif // COMPONENTS_PAYMENTS_CORE_TEST_PAYMENT_REQUEST_DELEGATE_H_ | 59 #endif // COMPONENTS_PAYMENTS_CORE_TEST_PAYMENT_REQUEST_DELEGATE_H_ |
| OLD | NEW |