OLD | NEW |
(Empty) | |
| 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 |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #include "components/payments/core/test_payment_request_delegate.h" |
| 6 |
| 7 #include "base/strings/utf_string_conversions.h" |
| 8 |
| 9 namespace payments { |
| 10 |
| 11 TestPaymentRequestDelegate::TestPaymentRequestDelegate( |
| 12 autofill::PersonalDataManager* personal_data_manager) |
| 13 : personal_data_manager_(personal_data_manager), |
| 14 locale_("en-US"), |
| 15 last_committed_url_("https://shop.com") {} |
| 16 |
| 17 TestPaymentRequestDelegate::~TestPaymentRequestDelegate() {} |
| 18 |
| 19 autofill::PersonalDataManager* |
| 20 TestPaymentRequestDelegate::GetPersonalDataManager() { |
| 21 return personal_data_manager_; |
| 22 } |
| 23 |
| 24 const std::string& TestPaymentRequestDelegate::GetApplicationLocale() const { |
| 25 return locale_; |
| 26 } |
| 27 |
| 28 bool TestPaymentRequestDelegate::IsIncognito() const { |
| 29 return false; |
| 30 } |
| 31 |
| 32 bool TestPaymentRequestDelegate::IsSslCertificateValid() { |
| 33 return true; |
| 34 } |
| 35 |
| 36 const GURL& TestPaymentRequestDelegate::GetLastCommittedURL() const { |
| 37 return last_committed_url_; |
| 38 } |
| 39 |
| 40 void TestPaymentRequestDelegate::DoFullCardRequest( |
| 41 const autofill::CreditCard& credit_card, |
| 42 base::WeakPtr<autofill::payments::FullCardRequest::ResultDelegate> |
| 43 result_delegate) { |
| 44 result_delegate->OnFullCardRequestSucceeded(credit_card, |
| 45 base::ASCIIToUTF16("123")); |
| 46 } |
| 47 |
| 48 AddressNormalizer* TestPaymentRequestDelegate::GetAddressNormalizer() { |
| 49 return &address_normalizer_; |
| 50 } |
| 51 |
| 52 TestAddressNormalizer* TestPaymentRequestDelegate::GetTestAddressNormalizer() { |
| 53 return &address_normalizer_; |
| 54 } |
| 55 |
| 56 autofill::RegionDataLoader* TestPaymentRequestDelegate::GetRegionDataLoader() { |
| 57 return nullptr; |
| 58 } |
| 59 |
| 60 } // namespace payments |
OLD | NEW |