| 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 "base/compiler_specific.h" | 8 #include "base/compiler_specific.h" |
| 9 #include "base/i18n/rtl.h" | 9 #include "base/i18n/rtl.h" |
| 10 #include "base/memory/scoped_ptr.h" | 10 #include "base/memory/scoped_ptr.h" |
| 11 #include "base/prefs/pref_service.h" | 11 #include "base/prefs/pref_service.h" |
| 12 #include "components/autofill/core/browser/autofill_client.h" | 12 #include "components/autofill/core/browser/autofill_client.h" |
| 13 | 13 |
| 14 namespace infobars { |
| 15 class InfoBarManager; |
| 16 } |
| 17 |
| 14 namespace autofill { | 18 namespace autofill { |
| 15 | 19 |
| 16 // This class is for easier writing of tests. | 20 // This class is for easier writing of tests. |
| 17 class TestAutofillClient : public AutofillClient { | 21 class TestAutofillClient : public AutofillClient { |
| 18 public: | 22 public: |
| 19 TestAutofillClient(); | 23 TestAutofillClient(); |
| 20 ~TestAutofillClient() override; | 24 ~TestAutofillClient() override; |
| 21 | 25 |
| 22 // AutofillClient implementation. | 26 // AutofillClient implementation. |
| 23 PersonalDataManager* GetPersonalDataManager() override; | 27 PersonalDataManager* GetPersonalDataManager() override; |
| 24 scoped_refptr<AutofillWebDataService> GetDatabase() override; | 28 scoped_refptr<AutofillWebDataService> GetDatabase() override; |
| 25 PrefService* GetPrefs() override; | 29 PrefService* GetPrefs() override; |
| 26 void HideRequestAutocompleteDialog() override; | 30 void HideRequestAutocompleteDialog() override; |
| 27 void ShowAutofillSettings() override; | 31 void ShowAutofillSettings() override; |
| 28 void ShowUnmaskPrompt() override; | 32 void ShowUnmaskPrompt() override; |
| 29 void ConfirmSaveCreditCard(const base::Closure& save_card_callback) override; | |
| 30 bool HasCreditCardScanFeature() override; | 33 bool HasCreditCardScanFeature() override; |
| 31 void ScanCreditCard(const CreditCardScanCallback& callback) override; | 34 void ScanCreditCard(const CreditCardScanCallback& callback) override; |
| 32 void ShowRequestAutocompleteDialog(const FormData& form, | 35 void ShowRequestAutocompleteDialog(const FormData& form, |
| 33 const GURL& source_url, | 36 const GURL& source_url, |
| 34 const ResultCallback& callback) override; | 37 const ResultCallback& callback) override; |
| 35 void ShowAutofillPopup( | 38 void ShowAutofillPopup( |
| 36 const gfx::RectF& element_bounds, | 39 const gfx::RectF& element_bounds, |
| 37 base::i18n::TextDirection text_direction, | 40 base::i18n::TextDirection text_direction, |
| 38 const std::vector<Suggestion>& suggestions, | 41 const std::vector<Suggestion>& suggestions, |
| 39 base::WeakPtr<AutofillPopupDelegate> delegate) override; | 42 base::WeakPtr<AutofillPopupDelegate> delegate) override; |
| 40 void UpdateAutofillPopupDataListValues( | 43 void UpdateAutofillPopupDataListValues( |
| 41 const std::vector<base::string16>& values, | 44 const std::vector<base::string16>& values, |
| 42 const std::vector<base::string16>& labels) override; | 45 const std::vector<base::string16>& labels) override; |
| 43 void HideAutofillPopup() override; | 46 void HideAutofillPopup() override; |
| 44 bool IsAutocompleteEnabled() override; | 47 bool IsAutocompleteEnabled() override; |
| 45 void DetectAccountCreationForms( | 48 void DetectAccountCreationForms( |
| 46 content::RenderFrameHost* rfh, | 49 content::RenderFrameHost* rfh, |
| 47 const std::vector<autofill::FormStructure*>& forms) override; | 50 const std::vector<autofill::FormStructure*>& forms) override; |
| 48 void DidFillOrPreviewField(const base::string16& autofilled_value, | 51 void DidFillOrPreviewField(const base::string16& autofilled_value, |
| 49 const base::string16& profile_full_name) override; | 52 const base::string16& profile_full_name) override; |
| 50 void OnFirstUserGestureObserved() override; | 53 void OnFirstUserGestureObserved() override; |
| 54 infobars::InfoBarManager* GetInfoBarManager() override; |
| 51 | 55 |
| 52 void SetPrefs(scoped_ptr<PrefService> prefs) { prefs_ = prefs.Pass(); } | 56 void SetPrefs(scoped_ptr<PrefService> prefs) { prefs_ = prefs.Pass(); } |
| 53 | 57 |
| 54 private: | 58 private: |
| 55 // NULL by default. | 59 // NULL by default. |
| 56 scoped_ptr<PrefService> prefs_; | 60 scoped_ptr<PrefService> prefs_; |
| 57 | 61 |
| 58 DISALLOW_COPY_AND_ASSIGN(TestAutofillClient); | 62 DISALLOW_COPY_AND_ASSIGN(TestAutofillClient); |
| 59 }; | 63 }; |
| 60 | 64 |
| 61 } // namespace autofill | 65 } // namespace autofill |
| 62 | 66 |
| 63 #endif // COMPONENTS_AUTOFILL_CORE_BROWSER_TEST_AUTOFILL_CLIENT_H_ | 67 #endif // COMPONENTS_AUTOFILL_CORE_BROWSER_TEST_AUTOFILL_CLIENT_H_ |
| OLD | NEW |