Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(394)

Side by Side Diff: chrome/browser/autofill/autofill_manager_delegate.h

Issue 10919066: Use BrowserContext as key in API. Switch Autofill to use BC in place of Profile. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Merge to parent Created 8 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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_AUTOFILL_MANAGER_DELEGATE_H_ 5 #ifndef CHROME_BROWSER_AUTOFILL_AUTOFILL_MANAGER_DELEGATE_H_
6 #define CHROME_BROWSER_AUTOFILL_AUTOFILL_MANAGER_DELEGATE_H_ 6 #define CHROME_BROWSER_AUTOFILL_AUTOFILL_MANAGER_DELEGATE_H_
7 7
8 namespace autofill { 8 namespace autofill {
9 class PasswordGenerator; 9 class PasswordGenerator;
10 } 10 }
11 11
12 namespace content {
13 class BrowserContext;
14 }
15
12 namespace gfx { 16 namespace gfx {
13 class Rect; 17 class Rect;
14 } 18 }
15 19
16 namespace webkit { 20 namespace webkit {
17 namespace forms { 21 namespace forms {
18 struct PasswordForm; 22 struct PasswordForm;
19 } 23 }
20 } 24 }
21 25
22 class InfoBarService; 26 class InfoBarService;
23 class PrefServiceBase; 27 class PrefServiceBase;
24 28
25 namespace autofill { 29 namespace autofill {
26 30
27 // A delegate interface that needs to be supplied to AutofillManager 31 // A delegate interface that needs to be supplied to AutofillManager
28 // by the embedder. 32 // by the embedder.
29 // 33 //
30 // Each delegate instance is associated with a given context within 34 // Each delegate instance is associated with a given context within
31 // which an AutofillManager is used (e.g. a single tab), so when we 35 // which an AutofillManager is used (e.g. a single tab), so when we
32 // say "for the delegate" below, we mean "in the execution context the 36 // say "for the delegate" below, we mean "in the execution context the
33 // delegate is associated with" (e.g. for the tab the AutofillManager is 37 // delegate is associated with" (e.g. for the tab the AutofillManager is
34 // attached to). 38 // attached to).
35 class AutofillManagerDelegate { 39 class AutofillManagerDelegate {
36 public: 40 public:
37 virtual ~AutofillManagerDelegate() {} 41 virtual ~AutofillManagerDelegate() {}
38 42
43 // Gets the BrowserContext the AutofillManager is in.
44 virtual content::BrowserContext* GetBrowserContext() const = 0;
45
46 // Gets the BrowserContext the AutofillManager is in, or if in an
47 // incognito mode, the associated (original) BrowserContext.
48 virtual content::BrowserContext* GetOriginalBrowserContext() const = 0;
49
39 // Gets the infobar service associated with the delegate. 50 // Gets the infobar service associated with the delegate.
40 virtual InfoBarService* GetInfoBarService() = 0; 51 virtual InfoBarService* GetInfoBarService() = 0;
41 52
42 // Gets the preferences associated with the delegate. 53 // Gets the preferences associated with the delegate.
43 virtual PrefServiceBase* GetPrefs() = 0; 54 virtual PrefServiceBase* GetPrefs() = 0;
44 55
45 // Returns true if saving passwords is currently enabled for the 56 // Returns true if saving passwords is currently enabled for the
46 // delegate. 57 // delegate.
47 virtual bool IsSavingPasswordsEnabled() const = 0; 58 virtual bool IsSavingPasswordsEnabled() const = 0;
48 59
49 // Causes the Autofill settings UI to be shown. 60 // Causes the Autofill settings UI to be shown.
50 virtual void ShowAutofillSettings() = 0; 61 virtual void ShowAutofillSettings() = 0;
51 62
52 // Causes the password generation bubble UI to be shown using the 63 // Causes the password generation bubble UI to be shown using the
53 // specified form with the given bounds. 64 // specified form with the given bounds.
54 virtual void ShowPasswordGenerationBubble( 65 virtual void ShowPasswordGenerationBubble(
55 const gfx::Rect& bounds, 66 const gfx::Rect& bounds,
56 const webkit::forms::PasswordForm& form, 67 const webkit::forms::PasswordForm& form,
57 autofill::PasswordGenerator* generator) = 0; 68 autofill::PasswordGenerator* generator) = 0;
58 }; 69 };
59 70
60 } // namespace autofill 71 } // namespace autofill
61 72
62 #endif // CHROME_BROWSER_AUTOFILL_AUTOFILL_MANAGER_DELEGATE_H_ 73 #endif // CHROME_BROWSER_AUTOFILL_AUTOFILL_MANAGER_DELEGATE_H_
OLDNEW
« no previous file with comments | « chrome/browser/autofill/autofill_manager.cc ('k') | chrome/browser/autofill/autofill_manager_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698