Chromium Code Reviews| 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 #ifndef COMPONENTS_AUTOFILL_CORE_BROWSER_TEST_AUTOFILL_CLIENT_H_ | 5 #ifndef COMPONENTS_AUTOFILL_CORE_BROWSER_TEST_AUTOFILL_CLIENT_H_ |
| 6 #define COMPONENTS_AUTOFILL_CORE_BROWSER_TEST_AUTOFILL_CLIENT_H_ | 6 #define COMPONENTS_AUTOFILL_CORE_BROWSER_TEST_AUTOFILL_CLIENT_H_ |
| 7 | 7 |
| 8 #include <memory> | 8 #include <memory> |
| 9 #include <string> | 9 #include <string> |
| 10 #include <utility> | 10 #include <utility> |
| 11 #include <vector> | 11 #include <vector> |
| 12 | 12 |
| 13 #include "base/compiler_specific.h" | 13 #include "base/compiler_specific.h" |
| 14 #include "base/i18n/rtl.h" | 14 #include "base/i18n/rtl.h" |
| 15 #include "base/macros.h" | 15 #include "base/macros.h" |
| 16 #include "components/autofill/core/browser/autofill_client.h" | 16 #include "components/autofill/core/browser/autofill_client.h" |
| 17 #include "components/prefs/pref_service.h" | 17 #include "components/prefs/pref_service.h" |
| 18 #include "components/rappor/test_rappor_service.h" | 18 #include "components/rappor/test_rappor_service.h" |
| 19 #include "components/ukm/test_ukm_service.h" | |
| 20 //#include "components/ukm/ukm_source.h" | |
|
Mathieu
2017/03/09 18:40:49
fix
sebsg
2017/03/09 19:57:04
Done.
| |
| 19 #include "google_apis/gaia/fake_identity_provider.h" | 21 #include "google_apis/gaia/fake_identity_provider.h" |
| 20 #include "google_apis/gaia/fake_oauth2_token_service.h" | 22 #include "google_apis/gaia/fake_oauth2_token_service.h" |
| 21 | 23 |
| 22 namespace autofill { | 24 namespace autofill { |
| 23 | 25 |
| 24 // This class is for easier writing of tests. | 26 // This class is for easier writing of tests. |
| 25 class TestAutofillClient : public AutofillClient { | 27 class TestAutofillClient : public AutofillClient { |
| 26 public: | 28 public: |
| 27 TestAutofillClient(); | 29 TestAutofillClient(); |
| 28 ~TestAutofillClient() override; | 30 ~TestAutofillClient() override; |
| 29 | 31 |
| 30 // AutofillClient implementation. | 32 // AutofillClient implementation. |
| 31 PersonalDataManager* GetPersonalDataManager() override; | 33 PersonalDataManager* GetPersonalDataManager() override; |
| 32 scoped_refptr<AutofillWebDataService> GetDatabase() override; | 34 scoped_refptr<AutofillWebDataService> GetDatabase() override; |
| 33 PrefService* GetPrefs() override; | 35 PrefService* GetPrefs() override; |
| 34 syncer::SyncService* GetSyncService() override; | 36 syncer::SyncService* GetSyncService() override; |
| 35 IdentityProvider* GetIdentityProvider() override; | 37 IdentityProvider* GetIdentityProvider() override; |
| 36 rappor::RapporServiceImpl* GetRapporServiceImpl() override; | 38 rappor::RapporServiceImpl* GetRapporServiceImpl() override; |
| 39 ukm::UkmService* GetUkmService() override; | |
| 37 void ShowAutofillSettings() override; | 40 void ShowAutofillSettings() override; |
| 38 void ShowUnmaskPrompt(const CreditCard& card, | 41 void ShowUnmaskPrompt(const CreditCard& card, |
| 39 UnmaskCardReason reason, | 42 UnmaskCardReason reason, |
| 40 base::WeakPtr<CardUnmaskDelegate> delegate) override; | 43 base::WeakPtr<CardUnmaskDelegate> delegate) override; |
| 41 void OnUnmaskVerificationResult(PaymentsRpcResult result) override; | 44 void OnUnmaskVerificationResult(PaymentsRpcResult result) override; |
| 42 void ConfirmSaveCreditCardLocally(const CreditCard& card, | 45 void ConfirmSaveCreditCardLocally(const CreditCard& card, |
| 43 const base::Closure& callback) override; | 46 const base::Closure& callback) override; |
| 44 void ConfirmSaveCreditCardToCloud( | 47 void ConfirmSaveCreditCardToCloud( |
| 45 const CreditCard& card, | 48 const CreditCard& card, |
| 46 std::unique_ptr<base::DictionaryValue> legal_message, | 49 std::unique_ptr<base::DictionaryValue> legal_message, |
| (...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 84 } | 87 } |
| 85 | 88 |
| 86 void set_form_origin(const GURL& url) { form_origin_ = url; } | 89 void set_form_origin(const GURL& url) { form_origin_ = url; } |
| 87 | 90 |
| 88 private: | 91 private: |
| 89 // NULL by default. | 92 // NULL by default. |
| 90 std::unique_ptr<PrefService> prefs_; | 93 std::unique_ptr<PrefService> prefs_; |
| 91 std::unique_ptr<FakeOAuth2TokenService> token_service_; | 94 std::unique_ptr<FakeOAuth2TokenService> token_service_; |
| 92 std::unique_ptr<FakeIdentityProvider> identity_provider_; | 95 std::unique_ptr<FakeIdentityProvider> identity_provider_; |
| 93 std::unique_ptr<rappor::TestRapporServiceImpl> rappor_service_; | 96 std::unique_ptr<rappor::TestRapporServiceImpl> rappor_service_; |
| 97 ukm::UkmServiceTestingHarness ukm_service_test_harness_; | |
| 94 GURL form_origin_; | 98 GURL form_origin_; |
| 95 | 99 |
| 96 DISALLOW_COPY_AND_ASSIGN(TestAutofillClient); | 100 DISALLOW_COPY_AND_ASSIGN(TestAutofillClient); |
| 97 }; | 101 }; |
| 98 | 102 |
| 99 } // namespace autofill | 103 } // namespace autofill |
| 100 | 104 |
| 101 #endif // COMPONENTS_AUTOFILL_CORE_BROWSER_TEST_AUTOFILL_CLIENT_H_ | 105 #endif // COMPONENTS_AUTOFILL_CORE_BROWSER_TEST_AUTOFILL_CLIENT_H_ |
| OLD | NEW |