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_UI_AUTOFILL_TAB_AUTOFILL_MANAGER_DELEGATE_H_ | 5 #ifndef CHROME_BROWSER_UI_AUTOFILL_TAB_AUTOFILL_MANAGER_DELEGATE_H_ |
6 #define CHROME_BROWSER_UI_AUTOFILL_TAB_AUTOFILL_MANAGER_DELEGATE_H_ | 6 #define CHROME_BROWSER_UI_AUTOFILL_TAB_AUTOFILL_MANAGER_DELEGATE_H_ |
7 | 7 |
8 #include "base/compiler_specific.h" | 8 #include "base/compiler_specific.h" |
9 #include "chrome/browser/autofill/autofill_manager_delegate.h" | 9 #include "chrome/browser/autofill/autofill_manager_delegate.h" |
10 #include "chrome/browser/ui/autofill/autofill_dialog_types.h" | 10 #include "chrome/browser/ui/autofill/autofill_dialog_types.h" |
11 #include "content/public/browser/web_contents_observer.h" | 11 #include "content/public/browser/web_contents_observer.h" |
12 #include "content/public/browser/web_contents_user_data.h" | 12 #include "content/public/browser/web_contents_user_data.h" |
13 | 13 |
14 namespace autofill { | |
15 class AutofillDialogControllerImpl; | |
16 } | |
17 | |
18 namespace content { | 14 namespace content { |
19 struct FrameNavigateParams; | 15 struct FrameNavigateParams; |
20 struct LoadCommittedDetails; | 16 struct LoadCommittedDetails; |
21 class WebContents; | 17 class WebContents; |
22 } | 18 } |
23 | 19 |
| 20 namespace autofill { |
| 21 |
| 22 class AutofillDialogControllerImpl; |
| 23 |
24 // Chrome implementation of AutofillManagerDelegate. | 24 // Chrome implementation of AutofillManagerDelegate. |
25 class TabAutofillManagerDelegate | 25 class TabAutofillManagerDelegate |
26 : public autofill::AutofillManagerDelegate, | 26 : public AutofillManagerDelegate, |
27 public content::WebContentsUserData<TabAutofillManagerDelegate>, | 27 public content::WebContentsUserData<TabAutofillManagerDelegate>, |
28 public content::WebContentsObserver { | 28 public content::WebContentsObserver { |
29 public: | 29 public: |
30 virtual ~TabAutofillManagerDelegate() {} | 30 virtual ~TabAutofillManagerDelegate() {} |
31 | 31 |
| 32 // AutofillManagerDelegate implementation. |
32 virtual content::BrowserContext* GetBrowserContext() const OVERRIDE; | 33 virtual content::BrowserContext* GetBrowserContext() const OVERRIDE; |
33 virtual content::BrowserContext* GetOriginalBrowserContext() const OVERRIDE; | 34 virtual content::BrowserContext* GetOriginalBrowserContext() const OVERRIDE; |
34 virtual Profile* GetOriginalProfile() const OVERRIDE; | 35 virtual Profile* GetOriginalProfile() const OVERRIDE; |
35 virtual InfoBarService* GetInfoBarService() OVERRIDE; | 36 virtual InfoBarService* GetInfoBarService() OVERRIDE; |
36 virtual PrefServiceBase* GetPrefs() OVERRIDE; | 37 virtual PrefServiceBase* GetPrefs() OVERRIDE; |
37 virtual ProfileSyncServiceBase* GetProfileSyncService() OVERRIDE; | 38 virtual ProfileSyncServiceBase* GetProfileSyncService() OVERRIDE; |
38 virtual bool IsSavingPasswordsEnabled() const OVERRIDE; | 39 virtual bool IsSavingPasswordsEnabled() const OVERRIDE; |
39 virtual void ShowAutofillSettings() OVERRIDE; | 40 virtual void ShowAutofillSettings() OVERRIDE; |
40 virtual void ShowPasswordGenerationBubble( | 41 virtual void ShowPasswordGenerationBubble( |
41 const gfx::Rect& bounds, | 42 const gfx::Rect& bounds, |
42 const content::PasswordForm& form, | 43 const content::PasswordForm& form, |
43 autofill::PasswordGenerator* generator) OVERRIDE; | 44 PasswordGenerator* generator) OVERRIDE; |
44 virtual void ShowRequestAutocompleteDialog( | 45 virtual void ShowRequestAutocompleteDialog( |
45 const FormData& form, | 46 const FormData& form, |
46 const GURL& source_url, | 47 const GURL& source_url, |
47 const content::SSLStatus& ssl_status, | 48 const content::SSLStatus& ssl_status, |
| 49 const AutofillMetrics& metric_logger, |
| 50 DialogType dialog_type, |
48 const base::Callback<void(const FormStructure*)>& callback) OVERRIDE; | 51 const base::Callback<void(const FormStructure*)>& callback) OVERRIDE; |
49 virtual void RequestAutocompleteDialogClosed() OVERRIDE; | 52 virtual void RequestAutocompleteDialogClosed() OVERRIDE; |
50 | 53 |
51 // content::WebContentsObserver implementation. | 54 // content::WebContentsObserver implementation. |
52 virtual void DidNavigateMainFrame( | 55 virtual void DidNavigateMainFrame( |
53 const content::LoadCommittedDetails& details, | 56 const content::LoadCommittedDetails& details, |
54 const content::FrameNavigateParams& params) OVERRIDE; | 57 const content::FrameNavigateParams& params) OVERRIDE; |
55 | 58 |
56 private: | 59 private: |
57 explicit TabAutofillManagerDelegate(content::WebContents* web_contents); | 60 explicit TabAutofillManagerDelegate(content::WebContents* web_contents); |
58 friend class content::WebContentsUserData<TabAutofillManagerDelegate>; | 61 friend class content::WebContentsUserData<TabAutofillManagerDelegate>; |
59 | 62 |
60 // Hides the associated request autocomplete dialog (if it exists). | 63 // Hides the associated request autocomplete dialog (if it exists). |
61 void HideRequestAutocompleteDialog(); | 64 void HideRequestAutocompleteDialog(); |
62 | 65 |
63 content::WebContents* const web_contents_; | 66 content::WebContents* const web_contents_; |
64 autofill::AutofillDialogControllerImpl* autofill_dialog_controller_; // weak. | 67 AutofillDialogControllerImpl* autofill_dialog_controller_; // weak. |
65 | 68 |
66 DISALLOW_COPY_AND_ASSIGN(TabAutofillManagerDelegate); | 69 DISALLOW_COPY_AND_ASSIGN(TabAutofillManagerDelegate); |
67 }; | 70 }; |
68 | 71 |
| 72 } // namespace autofill |
| 73 |
69 #endif // CHROME_BROWSER_UI_AUTOFILL_TAB_AUTOFILL_MANAGER_DELEGATE_H_ | 74 #endif // CHROME_BROWSER_UI_AUTOFILL_TAB_AUTOFILL_MANAGER_DELEGATE_H_ |
OLD | NEW |