OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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_CHROME_AUTOFILL_CLIENT_H_ | 5 #ifndef CHROME_BROWSER_UI_AUTOFILL_CHROME_AUTOFILL_CLIENT_H_ |
6 #define CHROME_BROWSER_UI_AUTOFILL_CHROME_AUTOFILL_CLIENT_H_ | 6 #define CHROME_BROWSER_UI_AUTOFILL_CHROME_AUTOFILL_CLIENT_H_ |
7 | 7 |
8 #include "base/callback.h" | 8 #include "base/callback.h" |
9 #include "base/compiler_specific.h" | 9 #include "base/compiler_specific.h" |
10 #include "base/i18n/rtl.h" | 10 #include "base/i18n/rtl.h" |
11 #include "base/memory/weak_ptr.h" | 11 #include "base/memory/weak_ptr.h" |
| 12 #include "chrome/browser/ui/zoom/zoom_observer.h" |
12 #include "components/autofill/core/browser/autofill_client.h" | 13 #include "components/autofill/core/browser/autofill_client.h" |
13 #include "content/public/browser/web_contents_observer.h" | 14 #include "content/public/browser/web_contents_observer.h" |
14 #include "content/public/browser/web_contents_user_data.h" | 15 #include "content/public/browser/web_contents_user_data.h" |
15 | 16 |
16 namespace content { | 17 namespace content { |
17 struct FrameNavigateParams; | 18 struct FrameNavigateParams; |
18 struct LoadCommittedDetails; | 19 struct LoadCommittedDetails; |
19 class WebContents; | 20 class WebContents; |
20 } | 21 } |
21 | 22 |
22 namespace autofill { | 23 namespace autofill { |
23 | 24 |
24 class AutofillDialogController; | 25 class AutofillDialogController; |
25 class AutofillKeystoneBridgeWrapper; | 26 class AutofillKeystoneBridgeWrapper; |
26 class AutofillPopupControllerImpl; | 27 class AutofillPopupControllerImpl; |
27 struct FormData; | 28 struct FormData; |
28 | 29 |
29 // Chrome implementation of AutofillClient. | 30 // Chrome implementation of AutofillClient. |
30 class ChromeAutofillClient | 31 class ChromeAutofillClient |
31 : public AutofillClient, | 32 : public AutofillClient, |
32 public content::WebContentsUserData<ChromeAutofillClient>, | 33 public content::WebContentsUserData<ChromeAutofillClient>, |
33 public content::WebContentsObserver { | 34 public content::WebContentsObserver, |
| 35 public ZoomObserver { |
34 public: | 36 public: |
35 virtual ~ChromeAutofillClient(); | 37 virtual ~ChromeAutofillClient(); |
36 | 38 |
37 // Called when the tab corresponding to |this| instance is activated. | 39 // Called when the tab corresponding to |this| instance is activated. |
38 void TabActivated(); | 40 void TabActivated(); |
39 | 41 |
40 // AutofillClient: | 42 // AutofillClient: |
41 virtual PersonalDataManager* GetPersonalDataManager() OVERRIDE; | 43 virtual PersonalDataManager* GetPersonalDataManager() OVERRIDE; |
42 virtual scoped_refptr<AutofillWebDataService> GetDatabase() OVERRIDE; | 44 virtual scoped_refptr<AutofillWebDataService> GetDatabase() OVERRIDE; |
43 virtual PrefService* GetPrefs() OVERRIDE; | 45 virtual PrefService* GetPrefs() OVERRIDE; |
(...skipping 21 matching lines...) Expand all Loading... |
65 virtual bool IsAutocompleteEnabled() OVERRIDE; | 67 virtual bool IsAutocompleteEnabled() OVERRIDE; |
66 virtual void DetectAccountCreationForms( | 68 virtual void DetectAccountCreationForms( |
67 const std::vector<autofill::FormStructure*>& forms) OVERRIDE; | 69 const std::vector<autofill::FormStructure*>& forms) OVERRIDE; |
68 virtual void DidFillOrPreviewField( | 70 virtual void DidFillOrPreviewField( |
69 const base::string16& autofilled_value, | 71 const base::string16& autofilled_value, |
70 const base::string16& profile_full_name) OVERRIDE; | 72 const base::string16& profile_full_name) OVERRIDE; |
71 | 73 |
72 // content::WebContentsObserver implementation. | 74 // content::WebContentsObserver implementation. |
73 virtual void WebContentsDestroyed() OVERRIDE; | 75 virtual void WebContentsDestroyed() OVERRIDE; |
74 | 76 |
| 77 // ZoomObserver implementation. |
| 78 virtual void OnZoomChanged( |
| 79 const ZoomController::ZoomChangedEventData& data) OVERRIDE; |
| 80 |
75 // Exposed for testing. | 81 // Exposed for testing. |
76 AutofillDialogController* GetDialogControllerForTesting() { | 82 AutofillDialogController* GetDialogControllerForTesting() { |
77 return dialog_controller_.get(); | 83 return dialog_controller_.get(); |
78 } | 84 } |
79 void SetDialogControllerForTesting( | 85 void SetDialogControllerForTesting( |
80 const base::WeakPtr<AutofillDialogController>& dialog_controller) { | 86 const base::WeakPtr<AutofillDialogController>& dialog_controller) { |
81 dialog_controller_ = dialog_controller; | 87 dialog_controller_ = dialog_controller; |
82 } | 88 } |
83 | 89 |
84 private: | 90 private: |
(...skipping 23 matching lines...) Expand all Loading... |
108 // scoped_ptr. | 114 // scoped_ptr. |
109 AutofillKeystoneBridgeWrapper* bridge_wrapper_; | 115 AutofillKeystoneBridgeWrapper* bridge_wrapper_; |
110 #endif // defined(OS_MACOSX) && !defined(OS_IOS) | 116 #endif // defined(OS_MACOSX) && !defined(OS_IOS) |
111 | 117 |
112 DISALLOW_COPY_AND_ASSIGN(ChromeAutofillClient); | 118 DISALLOW_COPY_AND_ASSIGN(ChromeAutofillClient); |
113 }; | 119 }; |
114 | 120 |
115 } // namespace autofill | 121 } // namespace autofill |
116 | 122 |
117 #endif // CHROME_BROWSER_UI_AUTOFILL_CHROME_AUTOFILL_CLIENT_H_ | 123 #endif // CHROME_BROWSER_UI_AUTOFILL_CHROME_AUTOFILL_CLIENT_H_ |
OLD | NEW |