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 "components/autofill/core/browser/autofill_client.h" | 13 #include "components/autofill/core/browser/autofill_client.h" |
13 #include "components/ui/zoom/zoom_observer.h" | 14 #include "components/ui/zoom/zoom_observer.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 |
17 namespace content { | 18 namespace content { |
18 struct FrameNavigateParams; | 19 struct FrameNavigateParams; |
19 struct LoadCommittedDetails; | 20 struct LoadCommittedDetails; |
20 class WebContents; | 21 class WebContents; |
(...skipping 18 matching lines...) Expand all Loading... |
39 | 40 |
40 // Called when the tab corresponding to |this| instance is activated. | 41 // Called when the tab corresponding to |this| instance is activated. |
41 void TabActivated(); | 42 void TabActivated(); |
42 | 43 |
43 // AutofillClient: | 44 // AutofillClient: |
44 PersonalDataManager* GetPersonalDataManager() override; | 45 PersonalDataManager* GetPersonalDataManager() override; |
45 scoped_refptr<AutofillWebDataService> GetDatabase() override; | 46 scoped_refptr<AutofillWebDataService> GetDatabase() override; |
46 PrefService* GetPrefs() override; | 47 PrefService* GetPrefs() override; |
47 void HideRequestAutocompleteDialog() override; | 48 void HideRequestAutocompleteDialog() override; |
48 void ShowAutofillSettings() override; | 49 void ShowAutofillSettings() override; |
| 50 void ShowUnmaskPrompt() override; |
49 void ConfirmSaveCreditCard(const base::Closure& save_card_callback) override; | 51 void ConfirmSaveCreditCard(const base::Closure& save_card_callback) override; |
50 bool HasCreditCardScanFeature() override; | 52 bool HasCreditCardScanFeature() override; |
51 void ScanCreditCard(const CreditCardScanCallback& callback) override; | 53 void ScanCreditCard(const CreditCardScanCallback& callback) override; |
52 void ShowRequestAutocompleteDialog(const FormData& form, | 54 void ShowRequestAutocompleteDialog(const FormData& form, |
53 const GURL& source_url, | 55 const GURL& source_url, |
54 const ResultCallback& callback) override; | 56 const ResultCallback& callback) override; |
55 void ShowAutofillPopup( | 57 void ShowAutofillPopup( |
56 const gfx::RectF& element_bounds, | 58 const gfx::RectF& element_bounds, |
57 base::i18n::TextDirection text_direction, | 59 base::i18n::TextDirection text_direction, |
58 const std::vector<base::string16>& values, | 60 const std::vector<base::string16>& values, |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
91 private: | 93 private: |
92 #if defined(OS_MACOSX) && !defined(OS_IOS) | 94 #if defined(OS_MACOSX) && !defined(OS_IOS) |
93 // Creates |bridge_wrapper_|, which is responsible for dealing with Keystone | 95 // Creates |bridge_wrapper_|, which is responsible for dealing with Keystone |
94 // notifications. | 96 // notifications. |
95 void RegisterForKeystoneNotifications(); | 97 void RegisterForKeystoneNotifications(); |
96 | 98 |
97 // Deletes |bridge_wrapper_|. | 99 // Deletes |bridge_wrapper_|. |
98 void UnregisterFromKeystoneNotifications(); | 100 void UnregisterFromKeystoneNotifications(); |
99 #endif // defined(OS_MACOSX) && !defined(OS_IOS) | 101 #endif // defined(OS_MACOSX) && !defined(OS_IOS) |
100 | 102 |
| 103 void OnUnmaskResponse(const base::string16& response); |
| 104 |
101 explicit ChromeAutofillClient(content::WebContents* web_contents); | 105 explicit ChromeAutofillClient(content::WebContents* web_contents); |
102 friend class content::WebContentsUserData<ChromeAutofillClient>; | 106 friend class content::WebContentsUserData<ChromeAutofillClient>; |
103 | 107 |
104 content::WebContents* const web_contents_; | |
105 base::WeakPtr<AutofillDialogController> dialog_controller_; | 108 base::WeakPtr<AutofillDialogController> dialog_controller_; |
106 base::WeakPtr<AutofillPopupControllerImpl> popup_controller_; | 109 base::WeakPtr<AutofillPopupControllerImpl> popup_controller_; |
107 | 110 |
108 #if defined(OS_MACOSX) && !defined(OS_IOS) | 111 #if defined(OS_MACOSX) && !defined(OS_IOS) |
109 // Listens to Keystone notifications and passes relevant ones on to the | 112 // Listens to Keystone notifications and passes relevant ones on to the |
110 // PersonalDataManager. | 113 // PersonalDataManager. |
111 // | 114 // |
112 // The class of this member must remain a forward declaration, even in the | 115 // The class of this member must remain a forward declaration, even in the |
113 // .cc implementation file, since the class is defined in a Mac-only | 116 // .cc implementation file, since the class is defined in a Mac-only |
114 // implementation file. This means that the pointer cannot be wrapped in a | 117 // implementation file. This means that the pointer cannot be wrapped in a |
115 // scoped_ptr. | 118 // scoped_ptr. |
116 AutofillKeystoneBridgeWrapper* bridge_wrapper_; | 119 AutofillKeystoneBridgeWrapper* bridge_wrapper_; |
117 #endif // defined(OS_MACOSX) && !defined(OS_IOS) | 120 #endif // defined(OS_MACOSX) && !defined(OS_IOS) |
118 | 121 |
| 122 base::WeakPtrFactory<ChromeAutofillClient> weak_pointer_factory_; |
| 123 |
119 DISALLOW_COPY_AND_ASSIGN(ChromeAutofillClient); | 124 DISALLOW_COPY_AND_ASSIGN(ChromeAutofillClient); |
120 }; | 125 }; |
121 | 126 |
122 } // namespace autofill | 127 } // namespace autofill |
123 | 128 |
124 #endif // CHROME_BROWSER_UI_AUTOFILL_CHROME_AUTOFILL_CLIENT_H_ | 129 #endif // CHROME_BROWSER_UI_AUTOFILL_CHROME_AUTOFILL_CLIENT_H_ |
OLD | NEW |