Chromium Code Reviews| 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/scoped_ptr.h" | |
| 11 #include "base/memory/weak_ptr.h" | 12 #include "base/memory/weak_ptr.h" |
| 12 #include "chrome/browser/ui/zoom/zoom_observer.h" | 13 #include "chrome/browser/ui/zoom/zoom_observer.h" |
| 13 #include "components/autofill/core/browser/autofill_client.h" | 14 #include "components/autofill/core/browser/autofill_client.h" |
| 14 #include "content/public/browser/web_contents_observer.h" | 15 #include "content/public/browser/web_contents_observer.h" |
| 15 #include "content/public/browser/web_contents_user_data.h" | 16 #include "content/public/browser/web_contents_user_data.h" |
| 16 | 17 |
| 18 class ConfirmInfoBarDelegate; | |
| 19 | |
| 17 namespace content { | 20 namespace content { |
| 18 struct FrameNavigateParams; | 21 struct FrameNavigateParams; |
| 19 struct LoadCommittedDetails; | 22 struct LoadCommittedDetails; |
| 20 class WebContents; | 23 class WebContents; |
| 21 } | 24 } |
| 22 | 25 |
| 26 namespace infobars { | |
| 27 class InfoBar; | |
| 28 } | |
| 29 | |
| 23 namespace autofill { | 30 namespace autofill { |
| 24 | 31 |
| 25 class AutofillDialogController; | 32 class AutofillDialogController; |
| 33 class AutofillManager; | |
|
Ilya Sherman
2014/12/03 20:00:20
nit: Alphabetize, please.
Pritam Nikam
2014/12/04 15:37:30
Done.
| |
| 26 class AutofillKeystoneBridgeWrapper; | 34 class AutofillKeystoneBridgeWrapper; |
| 27 class AutofillPopupControllerImpl; | 35 class AutofillPopupControllerImpl; |
| 28 class CreditCardScannerController; | 36 class CreditCardScannerController; |
| 29 struct FormData; | 37 struct FormData; |
| 30 | 38 |
| 31 // Chrome implementation of AutofillClient. | 39 // Chrome implementation of AutofillClient. |
| 32 class ChromeAutofillClient | 40 class ChromeAutofillClient |
| 33 : public AutofillClient, | 41 : public AutofillClient, |
| 34 public content::WebContentsUserData<ChromeAutofillClient>, | 42 public content::WebContentsUserData<ChromeAutofillClient>, |
| 35 public content::WebContentsObserver, | 43 public content::WebContentsObserver, |
| 36 public ZoomObserver { | 44 public ZoomObserver { |
| 37 public: | 45 public: |
| 38 ~ChromeAutofillClient() override; | 46 ~ChromeAutofillClient() override; |
| 39 | 47 |
| 40 // Called when the tab corresponding to |this| instance is activated. | 48 // Called when the tab corresponding to |this| instance is activated. |
| 41 void TabActivated(); | 49 void TabActivated(); |
| 42 | 50 |
| 43 // AutofillClient: | 51 // AutofillClient: |
| 44 PersonalDataManager* GetPersonalDataManager() override; | 52 PersonalDataManager* GetPersonalDataManager() override; |
| 45 scoped_refptr<AutofillWebDataService> GetDatabase() override; | 53 scoped_refptr<AutofillWebDataService> GetDatabase() override; |
| 46 PrefService* GetPrefs() override; | 54 PrefService* GetPrefs() override; |
| 47 void HideRequestAutocompleteDialog() override; | 55 void HideRequestAutocompleteDialog() override; |
| 48 void ShowAutofillSettings() override; | 56 void ShowAutofillSettings() override; |
| 49 void ConfirmSaveCreditCard(const AutofillMetrics& metric_logger, | 57 void ConfirmSaveCreditCard(AutofillManager* autofill_manager, |
| 58 const AutofillMetrics& metric_logger, | |
| 50 const base::Closure& save_card_callback) override; | 59 const base::Closure& save_card_callback) override; |
| 51 bool HasCreditCardScanFeature() override; | 60 bool HasCreditCardScanFeature() override; |
| 52 void ScanCreditCard(const CreditCardScanCallback& callback) override; | 61 void ScanCreditCard(const CreditCardScanCallback& callback) override; |
| 53 void ShowRequestAutocompleteDialog(const FormData& form, | 62 void ShowRequestAutocompleteDialog(const FormData& form, |
| 54 const GURL& source_url, | 63 const GURL& source_url, |
| 55 const ResultCallback& callback) override; | 64 const ResultCallback& callback) override; |
| 56 void ShowAutofillPopup( | 65 void ShowAutofillPopup( |
| 57 const gfx::RectF& element_bounds, | 66 const gfx::RectF& element_bounds, |
| 58 base::i18n::TextDirection text_direction, | 67 base::i18n::TextDirection text_direction, |
| 59 const std::vector<base::string16>& values, | 68 const std::vector<base::string16>& values, |
| 60 const std::vector<base::string16>& labels, | 69 const std::vector<base::string16>& labels, |
| 61 const std::vector<base::string16>& icons, | 70 const std::vector<base::string16>& icons, |
| 62 const std::vector<int>& identifiers, | 71 const std::vector<int>& identifiers, |
| 63 base::WeakPtr<AutofillPopupDelegate> delegate) override; | 72 base::WeakPtr<AutofillPopupDelegate> delegate) override; |
| 64 void UpdateAutofillPopupDataListValues( | 73 void UpdateAutofillPopupDataListValues( |
| 65 const std::vector<base::string16>& values, | 74 const std::vector<base::string16>& values, |
| 66 const std::vector<base::string16>& labels) override; | 75 const std::vector<base::string16>& labels) override; |
| 67 void HideAutofillPopup() override; | 76 void HideAutofillPopup() override; |
| 68 bool IsAutocompleteEnabled() override; | 77 bool IsAutocompleteEnabled() override; |
| 69 void DetectAccountCreationForms( | 78 void DetectAccountCreationForms( |
| 70 const std::vector<autofill::FormStructure*>& forms) override; | 79 const std::vector<autofill::FormStructure*>& forms) override; |
| 71 void DidFillOrPreviewField(const base::string16& autofilled_value, | 80 void DidFillOrPreviewField(const base::string16& autofilled_value, |
| 72 const base::string16& profile_full_name) override; | 81 const base::string16& profile_full_name) override; |
| 82 scoped_ptr<infobars::InfoBar> CreateInfoBar( | |
| 83 scoped_ptr<ConfirmInfoBarDelegate> delegate) override; | |
| 73 | 84 |
| 74 // content::WebContentsObserver implementation. | 85 // content::WebContentsObserver implementation. |
| 75 void WebContentsDestroyed() override; | 86 void WebContentsDestroyed() override; |
| 76 | 87 |
| 77 // ZoomObserver implementation. | 88 // ZoomObserver implementation. |
| 78 void OnZoomChanged(const ZoomController::ZoomChangedEventData& data) override; | 89 void OnZoomChanged(const ZoomController::ZoomChangedEventData& data) override; |
| 79 | 90 |
| 80 // Exposed for testing. | 91 // Exposed for testing. |
| 81 AutofillDialogController* GetDialogControllerForTesting() { | 92 AutofillDialogController* GetDialogControllerForTesting() { |
| 82 return dialog_controller_.get(); | 93 return dialog_controller_.get(); |
| (...skipping 30 matching lines...) Expand all Loading... | |
| 113 // scoped_ptr. | 124 // scoped_ptr. |
| 114 AutofillKeystoneBridgeWrapper* bridge_wrapper_; | 125 AutofillKeystoneBridgeWrapper* bridge_wrapper_; |
| 115 #endif // defined(OS_MACOSX) && !defined(OS_IOS) | 126 #endif // defined(OS_MACOSX) && !defined(OS_IOS) |
| 116 | 127 |
| 117 DISALLOW_COPY_AND_ASSIGN(ChromeAutofillClient); | 128 DISALLOW_COPY_AND_ASSIGN(ChromeAutofillClient); |
| 118 }; | 129 }; |
| 119 | 130 |
| 120 } // namespace autofill | 131 } // namespace autofill |
| 121 | 132 |
| 122 #endif // CHROME_BROWSER_UI_AUTOFILL_CHROME_AUTOFILL_CLIENT_H_ | 133 #endif // CHROME_BROWSER_UI_AUTOFILL_CHROME_AUTOFILL_CLIENT_H_ |
| OLD | NEW |