• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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 "components/autofill/core/browser/autofill_manager_delegate.h"
11 
12 namespace autofill {
13 
14 // This class is only for easier writing of testings. All pure virtual functions
15 // have been giving empty methods.
16 class TestAutofillManagerDelegate : public AutofillManagerDelegate {
17  public:
18   TestAutofillManagerDelegate();
19   virtual ~TestAutofillManagerDelegate();
20 
21   // AutofillManagerDelegate implementation.
22   virtual PersonalDataManager* GetPersonalDataManager() OVERRIDE;
23   virtual scoped_refptr<AutofillWebDataService>
24       GetDatabase() OVERRIDE;
25   virtual PrefService* GetPrefs() OVERRIDE;
26   virtual void HideRequestAutocompleteDialog() OVERRIDE;
27   virtual void ShowAutofillSettings() OVERRIDE;
28   virtual void ConfirmSaveCreditCard(
29       const AutofillMetrics& metric_logger,
30       const base::Closure& save_card_callback) OVERRIDE;
31   virtual void ShowRequestAutocompleteDialog(
32       const FormData& form,
33       const GURL& source_url,
34       const base::Callback<void(const FormStructure*)>& callback) OVERRIDE;
35   virtual void ShowAutofillPopup(
36       const gfx::RectF& element_bounds,
37       base::i18n::TextDirection text_direction,
38       const std::vector<base::string16>& values,
39       const std::vector<base::string16>& labels,
40       const std::vector<base::string16>& icons,
41       const std::vector<int>& identifiers,
42       base::WeakPtr<AutofillPopupDelegate> delegate) OVERRIDE;
43   virtual void UpdateAutofillPopupDataListValues(
44       const std::vector<base::string16>& values,
45       const std::vector<base::string16>& labels) OVERRIDE;
46   virtual void HideAutofillPopup() OVERRIDE;
47   virtual bool IsAutocompleteEnabled() OVERRIDE;
48 
49   virtual void DetectAccountCreationForms(
50       const std::vector<autofill::FormStructure*>& forms) OVERRIDE;
51 
52  private:
53   DISALLOW_COPY_AND_ASSIGN(TestAutofillManagerDelegate);
54 };
55 
56 }  // namespace autofill
57 
58 #endif  // COMPONENTS_AUTOFILL_CORE_BROWSER_TEST_AUTOFILL_MANAGER_DELEGATE_H_
59