| 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" |
| (...skipping 16 matching lines...) Expand all Loading... |
| 27 class AutofillPopupControllerImpl; | 27 class AutofillPopupControllerImpl; |
| 28 struct FormData; | 28 struct FormData; |
| 29 | 29 |
| 30 // Chrome implementation of AutofillClient. | 30 // Chrome implementation of AutofillClient. |
| 31 class ChromeAutofillClient | 31 class ChromeAutofillClient |
| 32 : public AutofillClient, | 32 : public AutofillClient, |
| 33 public content::WebContentsUserData<ChromeAutofillClient>, | 33 public content::WebContentsUserData<ChromeAutofillClient>, |
| 34 public content::WebContentsObserver, | 34 public content::WebContentsObserver, |
| 35 public ZoomObserver { | 35 public ZoomObserver { |
| 36 public: | 36 public: |
| 37 virtual ~ChromeAutofillClient(); | 37 ~ChromeAutofillClient() override; |
| 38 | 38 |
| 39 // Called when the tab corresponding to |this| instance is activated. | 39 // Called when the tab corresponding to |this| instance is activated. |
| 40 void TabActivated(); | 40 void TabActivated(); |
| 41 | 41 |
| 42 // AutofillClient: | 42 // AutofillClient: |
| 43 virtual PersonalDataManager* GetPersonalDataManager() override; | 43 PersonalDataManager* GetPersonalDataManager() override; |
| 44 virtual scoped_refptr<AutofillWebDataService> GetDatabase() override; | 44 scoped_refptr<AutofillWebDataService> GetDatabase() override; |
| 45 virtual PrefService* GetPrefs() override; | 45 PrefService* GetPrefs() override; |
| 46 virtual void HideRequestAutocompleteDialog() override; | 46 void HideRequestAutocompleteDialog() override; |
| 47 virtual void ShowAutofillSettings() override; | 47 void ShowAutofillSettings() override; |
| 48 virtual void ConfirmSaveCreditCard( | 48 void ConfirmSaveCreditCard(const AutofillMetrics& metric_logger, |
| 49 const AutofillMetrics& metric_logger, | 49 const base::Closure& save_card_callback) override; |
| 50 const base::Closure& save_card_callback) override; | 50 void ShowRequestAutocompleteDialog(const FormData& form, |
| 51 virtual void ShowRequestAutocompleteDialog( | 51 const GURL& source_url, |
| 52 const FormData& form, | 52 const ResultCallback& callback) override; |
| 53 const GURL& source_url, | 53 void ShowAutofillPopup( |
| 54 const ResultCallback& callback) override; | |
| 55 virtual void ShowAutofillPopup( | |
| 56 const gfx::RectF& element_bounds, | 54 const gfx::RectF& element_bounds, |
| 57 base::i18n::TextDirection text_direction, | 55 base::i18n::TextDirection text_direction, |
| 58 const std::vector<base::string16>& values, | 56 const std::vector<base::string16>& values, |
| 59 const std::vector<base::string16>& labels, | 57 const std::vector<base::string16>& labels, |
| 60 const std::vector<base::string16>& icons, | 58 const std::vector<base::string16>& icons, |
| 61 const std::vector<int>& identifiers, | 59 const std::vector<int>& identifiers, |
| 62 base::WeakPtr<AutofillPopupDelegate> delegate) override; | 60 base::WeakPtr<AutofillPopupDelegate> delegate) override; |
| 63 virtual void UpdateAutofillPopupDataListValues( | 61 void UpdateAutofillPopupDataListValues( |
| 64 const std::vector<base::string16>& values, | 62 const std::vector<base::string16>& values, |
| 65 const std::vector<base::string16>& labels) override; | 63 const std::vector<base::string16>& labels) override; |
| 66 virtual void HideAutofillPopup() override; | 64 void HideAutofillPopup() override; |
| 67 virtual bool IsAutocompleteEnabled() override; | 65 bool IsAutocompleteEnabled() override; |
| 68 virtual void DetectAccountCreationForms( | 66 void DetectAccountCreationForms( |
| 69 const std::vector<autofill::FormStructure*>& forms) override; | 67 const std::vector<autofill::FormStructure*>& forms) override; |
| 70 virtual void DidFillOrPreviewField( | 68 void DidFillOrPreviewField(const base::string16& autofilled_value, |
| 71 const base::string16& autofilled_value, | 69 const base::string16& profile_full_name) override; |
| 72 const base::string16& profile_full_name) override; | |
| 73 | 70 |
| 74 // content::WebContentsObserver implementation. | 71 // content::WebContentsObserver implementation. |
| 75 virtual void WebContentsDestroyed() override; | 72 void WebContentsDestroyed() override; |
| 76 | 73 |
| 77 // ZoomObserver implementation. | 74 // ZoomObserver implementation. |
| 78 virtual void OnZoomChanged( | 75 void OnZoomChanged(const ZoomController::ZoomChangedEventData& data) override; |
| 79 const ZoomController::ZoomChangedEventData& data) override; | |
| 80 | 76 |
| 81 // Exposed for testing. | 77 // Exposed for testing. |
| 82 AutofillDialogController* GetDialogControllerForTesting() { | 78 AutofillDialogController* GetDialogControllerForTesting() { |
| 83 return dialog_controller_.get(); | 79 return dialog_controller_.get(); |
| 84 } | 80 } |
| 85 void SetDialogControllerForTesting( | 81 void SetDialogControllerForTesting( |
| 86 const base::WeakPtr<AutofillDialogController>& dialog_controller) { | 82 const base::WeakPtr<AutofillDialogController>& dialog_controller) { |
| 87 dialog_controller_ = dialog_controller; | 83 dialog_controller_ = dialog_controller; |
| 88 } | 84 } |
| 89 | 85 |
| (...skipping 24 matching lines...) Expand all Loading... |
| 114 // scoped_ptr. | 110 // scoped_ptr. |
| 115 AutofillKeystoneBridgeWrapper* bridge_wrapper_; | 111 AutofillKeystoneBridgeWrapper* bridge_wrapper_; |
| 116 #endif // defined(OS_MACOSX) && !defined(OS_IOS) | 112 #endif // defined(OS_MACOSX) && !defined(OS_IOS) |
| 117 | 113 |
| 118 DISALLOW_COPY_AND_ASSIGN(ChromeAutofillClient); | 114 DISALLOW_COPY_AND_ASSIGN(ChromeAutofillClient); |
| 119 }; | 115 }; |
| 120 | 116 |
| 121 } // namespace autofill | 117 } // namespace autofill |
| 122 | 118 |
| 123 #endif // CHROME_BROWSER_UI_AUTOFILL_CHROME_AUTOFILL_CLIENT_H_ | 119 #endif // CHROME_BROWSER_UI_AUTOFILL_CHROME_AUTOFILL_CLIENT_H_ |
| OLD | NEW |