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_PASSWORD_MANAGER_CHROME_PASSWORD_MANAGER_CLIENT_H_ | 5 #ifndef CHROME_BROWSER_PASSWORD_MANAGER_CHROME_PASSWORD_MANAGER_CLIENT_H_ |
6 #define CHROME_BROWSER_PASSWORD_MANAGER_CHROME_PASSWORD_MANAGER_CLIENT_H_ | 6 #define CHROME_BROWSER_PASSWORD_MANAGER_CHROME_PASSWORD_MANAGER_CLIENT_H_ |
7 | 7 |
8 #include <vector> | 8 #include <vector> |
9 | 9 |
10 #include "base/compiler_specific.h" | 10 #include "base/compiler_specific.h" |
11 #include "base/macros.h" | 11 #include "base/macros.h" |
12 #include "base/memory/scoped_ptr.h" | 12 #include "base/memory/scoped_ptr.h" |
13 #include "base/memory/scoped_vector.h" | 13 #include "base/memory/scoped_vector.h" |
14 #include "components/password_manager/content/browser/content_password_manager_d
river_factory.h" | 14 #include "components/password_manager/content/browser/content_password_manager_d
river_factory.h" |
15 #include "components/password_manager/content/browser/credential_manager_dispatc
her.h" | 15 #include "components/password_manager/content/browser/credential_manager_impl.h" |
16 #include "components/password_manager/core/browser/password_manager.h" | 16 #include "components/password_manager/core/browser/password_manager.h" |
17 #include "components/password_manager/core/browser/password_manager_client.h" | 17 #include "components/password_manager/core/browser/password_manager_client.h" |
18 #include "components/password_manager/sync/browser/sync_credentials_filter.h" | 18 #include "components/password_manager/sync/browser/sync_credentials_filter.h" |
19 #include "components/prefs/pref_member.h" | 19 #include "components/prefs/pref_member.h" |
20 #include "content/public/browser/web_contents_observer.h" | 20 #include "content/public/browser/web_contents_observer.h" |
21 #include "content/public/browser/web_contents_user_data.h" | 21 #include "content/public/browser/web_contents_user_data.h" |
22 #include "ui/gfx/geometry/rect.h" | 22 #include "ui/gfx/geometry/rect.h" |
23 | 23 |
24 class Profile; | 24 class Profile; |
25 | 25 |
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
98 content::WebContents* contents, | 98 content::WebContents* contents, |
99 autofill::AutofillClient* autofill_client); | 99 autofill::AutofillClient* autofill_client); |
100 | 100 |
101 // Observer for PasswordGenerationPopup events. Used for testing. | 101 // Observer for PasswordGenerationPopup events. Used for testing. |
102 void SetTestObserver(autofill::PasswordGenerationPopupObserver* observer); | 102 void SetTestObserver(autofill::PasswordGenerationPopupObserver* observer); |
103 | 103 |
104 // Returns true if the bubble UI is enabled, and false if we're still using | 104 // Returns true if the bubble UI is enabled, and false if we're still using |
105 // the sad old Infobar UI. | 105 // the sad old Infobar UI. |
106 static bool IsTheHotNewBubbleUIEnabled(); | 106 static bool IsTheHotNewBubbleUIEnabled(); |
107 | 107 |
| 108 static void BindCredentialManager( |
| 109 content::RenderFrameHost* render_frame_host, |
| 110 password_manager::mojom::CredentialManagerRequest request); |
| 111 |
108 protected: | 112 protected: |
109 // Callable for tests. | 113 // Callable for tests. |
110 ChromePasswordManagerClient(content::WebContents* web_contents, | 114 ChromePasswordManagerClient(content::WebContents* web_contents, |
111 autofill::AutofillClient* autofill_client); | 115 autofill::AutofillClient* autofill_client); |
112 | 116 |
113 private: | 117 private: |
114 friend class content::WebContentsUserData<ChromePasswordManagerClient>; | 118 friend class content::WebContentsUserData<ChromePasswordManagerClient>; |
115 | 119 |
116 // content::WebContentsObserver overrides. | 120 // content::WebContentsObserver overrides. |
117 bool OnMessageReceived(const IPC::Message& message, | 121 bool OnMessageReceived(const IPC::Message& message, |
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
159 void OnCredentialsChosen( | 163 void OnCredentialsChosen( |
160 base::Callback<void(const password_manager::CredentialInfo&)> callback, | 164 base::Callback<void(const password_manager::CredentialInfo&)> callback, |
161 const password_manager::CredentialInfo& credential); | 165 const password_manager::CredentialInfo& credential); |
162 | 166 |
163 Profile* const profile_; | 167 Profile* const profile_; |
164 | 168 |
165 password_manager::PasswordManager password_manager_; | 169 password_manager::PasswordManager password_manager_; |
166 | 170 |
167 password_manager::ContentPasswordManagerDriverFactory* driver_factory_; | 171 password_manager::ContentPasswordManagerDriverFactory* driver_factory_; |
168 | 172 |
169 password_manager::CredentialManagerDispatcher | 173 // As a mojo service, will be registered into service registry |
170 credential_manager_dispatcher_; | 174 // of the main frame host by ChromeContentBrowserClient |
| 175 // once main frame host was created. |
| 176 password_manager::CredentialManagerImpl credential_manager_impl_; |
171 | 177 |
172 // Observer for password generation popup. | 178 // Observer for password generation popup. |
173 autofill::PasswordGenerationPopupObserver* observer_; | 179 autofill::PasswordGenerationPopupObserver* observer_; |
174 | 180 |
175 // Controls the popup | 181 // Controls the popup |
176 base::WeakPtr< | 182 base::WeakPtr< |
177 autofill::PasswordGenerationPopupControllerImpl> popup_controller_; | 183 autofill::PasswordGenerationPopupControllerImpl> popup_controller_; |
178 | 184 |
179 // Set to false to disable password saving (will no longer ask if you | 185 // Set to false to disable password saving (will no longer ask if you |
180 // want to save passwords and also won't fill the passwords). | 186 // want to save passwords and also won't fill the passwords). |
181 BooleanPrefMember saving_and_filling_passwords_enabled_; | 187 BooleanPrefMember saving_and_filling_passwords_enabled_; |
182 | 188 |
183 const password_manager::SyncCredentialsFilter credentials_filter_; | 189 const password_manager::SyncCredentialsFilter credentials_filter_; |
184 | 190 |
185 scoped_ptr<password_manager::LogManager> log_manager_; | 191 scoped_ptr<password_manager::LogManager> log_manager_; |
186 | 192 |
187 // Set during 'NotifyUserCouldBeAutoSignedIn' in order to store the | 193 // Set during 'NotifyUserCouldBeAutoSignedIn' in order to store the |
188 // form for potential use during 'NotifySuccessfulLoginWithExistingPassword'. | 194 // form for potential use during 'NotifySuccessfulLoginWithExistingPassword'. |
189 scoped_ptr<autofill::PasswordForm> possible_auto_sign_in_; | 195 scoped_ptr<autofill::PasswordForm> possible_auto_sign_in_; |
190 | 196 |
191 DISALLOW_COPY_AND_ASSIGN(ChromePasswordManagerClient); | 197 DISALLOW_COPY_AND_ASSIGN(ChromePasswordManagerClient); |
192 }; | 198 }; |
193 | 199 |
194 #endif // CHROME_BROWSER_PASSWORD_MANAGER_CHROME_PASSWORD_MANAGER_CLIENT_H_ | 200 #endif // CHROME_BROWSER_PASSWORD_MANAGER_CHROME_PASSWORD_MANAGER_CLIENT_H_ |
OLD | NEW |