| 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" | |
| 13 #include "components/autofill/core/browser/autofill_client.h" | 12 #include "components/autofill/core/browser/autofill_client.h" |
| 13 #include "components/ui/zoom/zoom_observer.h" |
| 14 #include "content/public/browser/web_contents_observer.h" | 14 #include "content/public/browser/web_contents_observer.h" |
| 15 #include "content/public/browser/web_contents_user_data.h" | 15 #include "content/public/browser/web_contents_user_data.h" |
| 16 | 16 |
| 17 namespace content { | 17 namespace content { |
| 18 struct FrameNavigateParams; | 18 struct FrameNavigateParams; |
| 19 struct LoadCommittedDetails; | 19 struct LoadCommittedDetails; |
| 20 class WebContents; | 20 class WebContents; |
| 21 } | 21 } |
| 22 | 22 |
| 23 namespace autofill { | 23 namespace autofill { |
| 24 | 24 |
| 25 class AutofillDialogController; | 25 class AutofillDialogController; |
| 26 class AutofillKeystoneBridgeWrapper; | 26 class AutofillKeystoneBridgeWrapper; |
| 27 class AutofillPopupControllerImpl; | 27 class AutofillPopupControllerImpl; |
| 28 class CreditCardScannerController; | 28 class CreditCardScannerController; |
| 29 struct FormData; | 29 struct FormData; |
| 30 | 30 |
| 31 // Chrome implementation of AutofillClient. | 31 // Chrome implementation of AutofillClient. |
| 32 class ChromeAutofillClient | 32 class ChromeAutofillClient |
| 33 : public AutofillClient, | 33 : public AutofillClient, |
| 34 public content::WebContentsUserData<ChromeAutofillClient>, | 34 public content::WebContentsUserData<ChromeAutofillClient>, |
| 35 public content::WebContentsObserver, | 35 public content::WebContentsObserver, |
| 36 public ZoomObserver { | 36 public components::ZoomObserver { |
| 37 public: | 37 public: |
| 38 ~ChromeAutofillClient() override; | 38 ~ChromeAutofillClient() override; |
| 39 | 39 |
| 40 // Called when the tab corresponding to |this| instance is activated. | 40 // Called when the tab corresponding to |this| instance is activated. |
| 41 void TabActivated(); | 41 void TabActivated(); |
| 42 | 42 |
| 43 // AutofillClient: | 43 // AutofillClient: |
| 44 PersonalDataManager* GetPersonalDataManager() override; | 44 PersonalDataManager* GetPersonalDataManager() override; |
| 45 scoped_refptr<AutofillWebDataService> GetDatabase() override; | 45 scoped_refptr<AutofillWebDataService> GetDatabase() override; |
| 46 PrefService* GetPrefs() override; | 46 PrefService* GetPrefs() override; |
| (...skipping 23 matching lines...) Expand all Loading... |
| 70 content::RenderFrameHost* rfh, | 70 content::RenderFrameHost* rfh, |
| 71 const std::vector<autofill::FormStructure*>& forms) override; | 71 const std::vector<autofill::FormStructure*>& forms) override; |
| 72 void DidFillOrPreviewField(const base::string16& autofilled_value, | 72 void DidFillOrPreviewField(const base::string16& autofilled_value, |
| 73 const base::string16& profile_full_name) override; | 73 const base::string16& profile_full_name) override; |
| 74 void OnFirstUserGestureObserved() override; | 74 void OnFirstUserGestureObserved() override; |
| 75 | 75 |
| 76 // content::WebContentsObserver implementation. | 76 // content::WebContentsObserver implementation. |
| 77 void WebContentsDestroyed() override; | 77 void WebContentsDestroyed() override; |
| 78 | 78 |
| 79 // ZoomObserver implementation. | 79 // ZoomObserver implementation. |
| 80 void OnZoomChanged(const ZoomController::ZoomChangedEventData& data) override; | 80 void OnZoomChanged( |
| 81 const components::ZoomController::ZoomChangedEventData& data) override; |
| 81 | 82 |
| 82 // Exposed for testing. | 83 // Exposed for testing. |
| 83 AutofillDialogController* GetDialogControllerForTesting() { | 84 AutofillDialogController* GetDialogControllerForTesting() { |
| 84 return dialog_controller_.get(); | 85 return dialog_controller_.get(); |
| 85 } | 86 } |
| 86 void SetDialogControllerForTesting( | 87 void SetDialogControllerForTesting( |
| 87 const base::WeakPtr<AutofillDialogController>& dialog_controller) { | 88 const base::WeakPtr<AutofillDialogController>& dialog_controller) { |
| 88 dialog_controller_ = dialog_controller; | 89 dialog_controller_ = dialog_controller; |
| 89 } | 90 } |
| 90 | 91 |
| (...skipping 24 matching lines...) Expand all Loading... |
| 115 // scoped_ptr. | 116 // scoped_ptr. |
| 116 AutofillKeystoneBridgeWrapper* bridge_wrapper_; | 117 AutofillKeystoneBridgeWrapper* bridge_wrapper_; |
| 117 #endif // defined(OS_MACOSX) && !defined(OS_IOS) | 118 #endif // defined(OS_MACOSX) && !defined(OS_IOS) |
| 118 | 119 |
| 119 DISALLOW_COPY_AND_ASSIGN(ChromeAutofillClient); | 120 DISALLOW_COPY_AND_ASSIGN(ChromeAutofillClient); |
| 120 }; | 121 }; |
| 121 | 122 |
| 122 } // namespace autofill | 123 } // namespace autofill |
| 123 | 124 |
| 124 #endif // CHROME_BROWSER_UI_AUTOFILL_CHROME_AUTOFILL_CLIENT_H_ | 125 #endif // CHROME_BROWSER_UI_AUTOFILL_CHROME_AUTOFILL_CLIENT_H_ |
| OLD | NEW |