OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 CHROME_BROWSER_AUTOFILL_API_AUTOFILL_MANAGER_DELEGATE_H_ | 5 #ifndef CHROME_BROWSER_AUTOFILL_API_AUTOFILL_MANAGER_DELEGATE_H_ |
6 #define CHROME_BROWSER_AUTOFILL_API_AUTOFILL_MANAGER_DELEGATE_H_ | 6 #define CHROME_BROWSER_AUTOFILL_API_AUTOFILL_MANAGER_DELEGATE_H_ |
7 | 7 |
8 class InfoBarTabService; | 8 class InfoBarService; |
9 class PrefServiceBase; | 9 class PrefServiceBase; |
10 | 10 |
11 namespace autofill { | 11 namespace autofill { |
12 | 12 |
13 // A delegate interface that needs to be supplied to AutofillManager | 13 // A delegate interface that needs to be supplied to AutofillManager |
14 // by the embedder. | 14 // by the embedder. |
15 // | 15 // |
16 // Each delegate instance is associated with a given context within | 16 // Each delegate instance is associated with a given context within |
17 // which an AutofillManager is used (e.g. a single tab), so when we | 17 // which an AutofillManager is used (e.g. a single tab), so when we |
18 // say "for the delegate" below, we mean "in the execution context the | 18 // say "for the delegate" below, we mean "in the execution context the |
19 // delegate is associated with" (e.g. for the tab the AutofillManager is | 19 // delegate is associated with" (e.g. for the tab the AutofillManager is |
20 // attached to). | 20 // attached to). |
21 class AutofillManagerDelegate { | 21 class AutofillManagerDelegate { |
22 public: | 22 public: |
23 virtual ~AutofillManagerDelegate() {} | 23 virtual ~AutofillManagerDelegate() {} |
24 | 24 |
25 // Gets the infobar service associated with the delegate. | 25 // Gets the infobar service associated with the delegate. |
26 // | 26 virtual InfoBarService* GetInfoBarService() = 0; |
27 // TODO(joi): Given the approach (which we will likely use more | |
28 // widely) of a context associated with the instance of the delegate, | |
29 // it seems right to rename InfoBarTabService to just | |
30 // InfoBarService. Naming the getter appropriately, will name the | |
31 // class itself in a follow-up change. | |
32 virtual InfoBarTabService* GetInfoBarService() = 0; | |
33 | 27 |
34 // Gets the preferences associated with the delegate. | 28 // Gets the preferences associated with the delegate. |
35 virtual PrefServiceBase* GetPrefs() = 0; | 29 virtual PrefServiceBase* GetPrefs() = 0; |
36 | 30 |
37 // Returns true if saving passwords is currently enabled for the | 31 // Returns true if saving passwords is currently enabled for the |
38 // delegate. | 32 // delegate. |
39 virtual bool IsSavingPasswordsEnabled() const = 0; | 33 virtual bool IsSavingPasswordsEnabled() const = 0; |
40 }; | 34 }; |
41 | 35 |
42 } // namespace autofill | 36 } // namespace autofill |
43 | 37 |
44 #endif // CHROME_BROWSER_AUTOFILL_API_AUTOFILL_MANAGER_DELEGATE_H_ | 38 #endif // CHROME_BROWSER_AUTOFILL_API_AUTOFILL_MANAGER_DELEGATE_H_ |
OLD | NEW |