| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 #include "components/autofill/core/browser/test_autofill_client.h" | 5 #include "components/autofill/core/browser/test_autofill_client.h" |
| 6 #if !defined(OS_ANDROID) |
| 7 #include "components/autofill/core/browser/ui/mock_save_card_bubble_controller.h
" |
| 8 #endif |
| 6 | 9 |
| 7 #include "components/autofill/core/browser/webdata/autofill_webdata_service.h" | 10 #include "components/autofill/core/browser/webdata/autofill_webdata_service.h" |
| 8 | 11 |
| 9 namespace autofill { | 12 namespace autofill { |
| 10 | 13 |
| 11 TestAutofillClient::TestAutofillClient() | 14 TestAutofillClient::TestAutofillClient() |
| 12 : token_service_(new FakeOAuth2TokenService()), | 15 : token_service_(new FakeOAuth2TokenService()), |
| 13 identity_provider_(new FakeIdentityProvider(token_service_.get())), | 16 identity_provider_(new FakeIdentityProvider(token_service_.get())), |
| 14 rappor_service_(new rappor::TestRapporServiceImpl()), | 17 rappor_service_(new rappor::TestRapporServiceImpl()), |
| 18 #if !defined(OS_ANDROID) |
| 19 save_card_bubble_controller_(new MockSaveCardBubbleController()), |
| 20 #endif |
| 15 form_origin_(GURL("https://example.test")) {} | 21 form_origin_(GURL("https://example.test")) {} |
| 16 | 22 |
| 17 TestAutofillClient::~TestAutofillClient() { | 23 TestAutofillClient::~TestAutofillClient() { |
| 18 } | 24 } |
| 19 | 25 |
| 20 PersonalDataManager* TestAutofillClient::GetPersonalDataManager() { | 26 PersonalDataManager* TestAutofillClient::GetPersonalDataManager() { |
| 21 return nullptr; | 27 return nullptr; |
| 22 } | 28 } |
| 23 | 29 |
| 24 scoped_refptr<AutofillWebDataService> TestAutofillClient::GetDatabase() { | 30 scoped_refptr<AutofillWebDataService> TestAutofillClient::GetDatabase() { |
| (...skipping 13 matching lines...) Expand all Loading... |
| 38 } | 44 } |
| 39 | 45 |
| 40 rappor::RapporServiceImpl* TestAutofillClient::GetRapporServiceImpl() { | 46 rappor::RapporServiceImpl* TestAutofillClient::GetRapporServiceImpl() { |
| 41 return rappor_service_.get(); | 47 return rappor_service_.get(); |
| 42 } | 48 } |
| 43 | 49 |
| 44 ukm::UkmService* TestAutofillClient::GetUkmService() { | 50 ukm::UkmService* TestAutofillClient::GetUkmService() { |
| 45 return ukm_service_test_harness_.test_ukm_service(); | 51 return ukm_service_test_harness_.test_ukm_service(); |
| 46 } | 52 } |
| 47 | 53 |
| 54 SaveCardBubbleController* TestAutofillClient::GetSaveCardBubbleController() { |
| 55 #if defined(OS_ANDROID) |
| 56 return nullptr; |
| 57 #else |
| 58 return save_card_bubble_controller_.get(); |
| 59 #endif |
| 60 } |
| 61 |
| 48 void TestAutofillClient::ShowAutofillSettings() { | 62 void TestAutofillClient::ShowAutofillSettings() { |
| 49 } | 63 } |
| 50 | 64 |
| 51 void TestAutofillClient::ShowUnmaskPrompt( | 65 void TestAutofillClient::ShowUnmaskPrompt( |
| 52 const CreditCard& card, | 66 const CreditCard& card, |
| 53 UnmaskCardReason reason, | 67 UnmaskCardReason reason, |
| 54 base::WeakPtr<CardUnmaskDelegate> delegate) { | 68 base::WeakPtr<CardUnmaskDelegate> delegate) { |
| 55 } | 69 } |
| 56 | 70 |
| 57 void TestAutofillClient::OnUnmaskVerificationResult(PaymentsRpcResult result) { | 71 void TestAutofillClient::OnUnmaskVerificationResult(PaymentsRpcResult result) { |
| 58 } | 72 } |
| 59 | 73 |
| 60 void TestAutofillClient::ConfirmSaveCreditCardLocally( | 74 void TestAutofillClient::ConfirmSaveCreditCardLocally( |
| 61 const CreditCard& card, | 75 const CreditCard& card, |
| 62 const base::Closure& callback) { | 76 const base::Closure& callback) { |
| 63 } | 77 } |
| 64 | 78 |
| 65 void TestAutofillClient::ConfirmSaveCreditCardToCloud( | 79 void TestAutofillClient::ConfirmSaveCreditCardToCloud( |
| 66 const CreditCard& card, | 80 const CreditCard& card, |
| 67 std::unique_ptr<base::DictionaryValue> legal_message, | 81 std::unique_ptr<base::DictionaryValue> legal_message, |
| 82 bool should_cvc_be_requested, |
| 68 const base::Closure& callback) { | 83 const base::Closure& callback) { |
| 69 callback.Run(); | 84 callback.Run(); |
| 70 } | 85 } |
| 71 | 86 |
| 72 void TestAutofillClient::ConfirmCreditCardFillAssist( | 87 void TestAutofillClient::ConfirmCreditCardFillAssist( |
| 73 const CreditCard& card, | 88 const CreditCard& card, |
| 74 const base::Closure& callback) { | 89 const base::Closure& callback) { |
| 75 callback.Run(); | 90 callback.Run(); |
| 76 } | 91 } |
| 77 | 92 |
| (...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 127 | 142 |
| 128 bool TestAutofillClient::ShouldShowSigninPromo() { | 143 bool TestAutofillClient::ShouldShowSigninPromo() { |
| 129 return false; | 144 return false; |
| 130 } | 145 } |
| 131 | 146 |
| 132 void TestAutofillClient::StartSigninFlow() {} | 147 void TestAutofillClient::StartSigninFlow() {} |
| 133 | 148 |
| 134 void TestAutofillClient::ShowHttpNotSecureExplanation() {} | 149 void TestAutofillClient::ShowHttpNotSecureExplanation() {} |
| 135 | 150 |
| 136 } // namespace autofill | 151 } // namespace autofill |
| OLD | NEW |