| 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 "base/memory/weak_ptr.h" |
| 9 #include "chrome/browser/autofill/autofill_manager_delegate.h" | 10 #include "chrome/browser/autofill/autofill_manager_delegate.h" |
| 10 #include "chrome/browser/ui/autofill/autofill_dialog_types.h" | 11 #include "chrome/browser/ui/autofill/autofill_dialog_types.h" |
| 11 #include "content/public/browser/web_contents_observer.h" | 12 #include "content/public/browser/web_contents_observer.h" |
| 12 #include "content/public/browser/web_contents_user_data.h" | 13 #include "content/public/browser/web_contents_user_data.h" |
| 13 | 14 |
| 15 class AutofillPopupControllerImpl; |
| 16 |
| 14 namespace content { | 17 namespace content { |
| 15 struct FrameNavigateParams; | 18 struct FrameNavigateParams; |
| 16 struct LoadCommittedDetails; | 19 struct LoadCommittedDetails; |
| 17 class WebContents; | 20 class WebContents; |
| 18 } | 21 } |
| 19 | 22 |
| 20 namespace autofill { | 23 namespace autofill { |
| 21 | 24 |
| 22 class AutofillDialogControllerImpl; | 25 class AutofillDialogControllerImpl; |
| 23 | 26 |
| 24 // Chrome implementation of AutofillManagerDelegate. | 27 // Chrome implementation of AutofillManagerDelegate. |
| 25 class TabAutofillManagerDelegate | 28 class TabAutofillManagerDelegate |
| 26 : public AutofillManagerDelegate, | 29 : public AutofillManagerDelegate, |
| 27 public content::WebContentsUserData<TabAutofillManagerDelegate>, | 30 public content::WebContentsUserData<TabAutofillManagerDelegate>, |
| 28 public content::WebContentsObserver { | 31 public content::WebContentsObserver { |
| 29 public: | 32 public: |
| 30 virtual ~TabAutofillManagerDelegate() {} | 33 virtual ~TabAutofillManagerDelegate(); |
| 31 | 34 |
| 32 // AutofillManagerDelegate implementation. | 35 // AutofillManagerDelegate implementation. |
| 33 virtual InfoBarService* GetInfoBarService() OVERRIDE; | 36 virtual InfoBarService* GetInfoBarService() OVERRIDE; |
| 34 virtual PersonalDataManager* GetPersonalDataManager() OVERRIDE; | 37 virtual PersonalDataManager* GetPersonalDataManager() OVERRIDE; |
| 35 virtual PrefService* GetPrefs() OVERRIDE; | 38 virtual PrefService* GetPrefs() OVERRIDE; |
| 36 virtual ProfileSyncServiceBase* GetProfileSyncService() OVERRIDE; | 39 virtual ProfileSyncServiceBase* GetProfileSyncService() OVERRIDE; |
| 37 virtual void HideRequestAutocompleteDialog() OVERRIDE; | 40 virtual void HideRequestAutocompleteDialog() OVERRIDE; |
| 38 virtual bool IsSavingPasswordsEnabled() const OVERRIDE; | 41 virtual bool IsSavingPasswordsEnabled() const OVERRIDE; |
| 39 virtual void OnAutocheckoutError() OVERRIDE; | 42 virtual void OnAutocheckoutError() OVERRIDE; |
| 40 virtual void ShowAutofillSettings() OVERRIDE; | 43 virtual void ShowAutofillSettings() OVERRIDE; |
| 41 virtual void ShowPasswordGenerationBubble( | 44 virtual void ShowPasswordGenerationBubble( |
| 42 const gfx::Rect& bounds, | 45 const gfx::Rect& bounds, |
| 43 const content::PasswordForm& form, | 46 const content::PasswordForm& form, |
| 44 PasswordGenerator* generator) OVERRIDE; | 47 PasswordGenerator* generator) OVERRIDE; |
| 45 virtual void ShowAutocheckoutBubble( | 48 virtual void ShowAutocheckoutBubble( |
| 46 const gfx::RectF& bounds, | 49 const gfx::RectF& bounds, |
| 47 const gfx::NativeView& native_view, | 50 const gfx::NativeView& native_view, |
| 48 const base::Closure& callback) OVERRIDE; | 51 const base::Closure& callback) OVERRIDE; |
| 49 virtual void ShowRequestAutocompleteDialog( | 52 virtual void ShowRequestAutocompleteDialog( |
| 50 const FormData& form, | 53 const FormData& form, |
| 51 const GURL& source_url, | 54 const GURL& source_url, |
| 52 const content::SSLStatus& ssl_status, | 55 const content::SSLStatus& ssl_status, |
| 53 const AutofillMetrics& metric_logger, | 56 const AutofillMetrics& metric_logger, |
| 54 DialogType dialog_type, | 57 DialogType dialog_type, |
| 55 const base::Callback<void(const FormStructure*)>& callback) OVERRIDE; | 58 const base::Callback<void(const FormStructure*)>& callback) OVERRIDE; |
| 56 virtual void RequestAutocompleteDialogClosed() OVERRIDE; | 59 virtual void RequestAutocompleteDialogClosed() OVERRIDE; |
| 60 virtual void ShowAutofillPopup(const gfx::RectF& element_bounds, |
| 61 const std::vector<string16>& values, |
| 62 const std::vector<string16>& labels, |
| 63 const std::vector<string16>& icons, |
| 64 const std::vector<int>& identifiers, |
| 65 AutofillPopupDelegate* delegate) OVERRIDE; |
| 66 virtual void HideAutofillPopup() OVERRIDE; |
| 57 virtual void UpdateProgressBar(double value) OVERRIDE; | 67 virtual void UpdateProgressBar(double value) OVERRIDE; |
| 58 | 68 |
| 59 // content::WebContentsObserver implementation. | 69 // content::WebContentsObserver implementation. |
| 60 virtual void DidNavigateMainFrame( | 70 virtual void DidNavigateMainFrame( |
| 61 const content::LoadCommittedDetails& details, | 71 const content::LoadCommittedDetails& details, |
| 62 const content::FrameNavigateParams& params) OVERRIDE; | 72 const content::FrameNavigateParams& params) OVERRIDE; |
| 63 | 73 |
| 64 private: | 74 private: |
| 65 explicit TabAutofillManagerDelegate(content::WebContents* web_contents); | 75 explicit TabAutofillManagerDelegate(content::WebContents* web_contents); |
| 66 friend class content::WebContentsUserData<TabAutofillManagerDelegate>; | 76 friend class content::WebContentsUserData<TabAutofillManagerDelegate>; |
| 67 | 77 |
| 68 content::WebContents* const web_contents_; | 78 content::WebContents* const web_contents_; |
| 69 AutofillDialogControllerImpl* autofill_dialog_controller_; // weak. | 79 AutofillDialogControllerImpl* dialog_controller_; // weak. |
| 80 base::WeakPtr<AutofillPopupControllerImpl> popup_controller_; |
| 70 | 81 |
| 71 DISALLOW_COPY_AND_ASSIGN(TabAutofillManagerDelegate); | 82 DISALLOW_COPY_AND_ASSIGN(TabAutofillManagerDelegate); |
| 72 }; | 83 }; |
| 73 | 84 |
| 74 } // namespace autofill | 85 } // namespace autofill |
| 75 | 86 |
| 76 #endif // CHROME_BROWSER_UI_AUTOFILL_TAB_AUTOFILL_MANAGER_DELEGATE_H_ | 87 #endif // CHROME_BROWSER_UI_AUTOFILL_TAB_AUTOFILL_MANAGER_DELEGATE_H_ |
| OLD | NEW |