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