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 <memory> | 8 #include <memory> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
11 #include "base/compiler_specific.h" | 11 #include "base/compiler_specific.h" |
12 #include "base/macros.h" | 12 #include "base/macros.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 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
161 void OnCredentialsChosen(const CredentialsCallback& callback, | 165 void OnCredentialsChosen(const CredentialsCallback& callback, |
162 bool one_local_credential, | 166 bool one_local_credential, |
163 const autofill::PasswordForm* form); | 167 const autofill::PasswordForm* form); |
164 | 168 |
165 Profile* const profile_; | 169 Profile* const profile_; |
166 | 170 |
167 password_manager::PasswordManager password_manager_; | 171 password_manager::PasswordManager password_manager_; |
168 | 172 |
169 password_manager::ContentPasswordManagerDriverFactory* driver_factory_; | 173 password_manager::ContentPasswordManagerDriverFactory* driver_factory_; |
170 | 174 |
171 password_manager::CredentialManagerDispatcher | 175 // As a mojo service, will be registered into service registry |
172 credential_manager_dispatcher_; | 176 // of the main frame host by ChromeContentBrowserClient |
| 177 // once main frame host was created. |
| 178 password_manager::CredentialManagerImpl credential_manager_impl_; |
173 | 179 |
174 // Observer for password generation popup. | 180 // Observer for password generation popup. |
175 autofill::PasswordGenerationPopupObserver* observer_; | 181 autofill::PasswordGenerationPopupObserver* observer_; |
176 | 182 |
177 // Controls the popup | 183 // Controls the popup |
178 base::WeakPtr< | 184 base::WeakPtr< |
179 autofill::PasswordGenerationPopupControllerImpl> popup_controller_; | 185 autofill::PasswordGenerationPopupControllerImpl> popup_controller_; |
180 | 186 |
181 // Set to false to disable password saving (will no longer ask if you | 187 // Set to false to disable password saving (will no longer ask if you |
182 // want to save passwords and also won't fill the passwords). | 188 // want to save passwords and also won't fill the passwords). |
183 BooleanPrefMember saving_and_filling_passwords_enabled_; | 189 BooleanPrefMember saving_and_filling_passwords_enabled_; |
184 | 190 |
185 const password_manager::SyncCredentialsFilter credentials_filter_; | 191 const password_manager::SyncCredentialsFilter credentials_filter_; |
186 | 192 |
187 std::unique_ptr<password_manager::LogManager> log_manager_; | 193 std::unique_ptr<password_manager::LogManager> log_manager_; |
188 | 194 |
189 // Set during 'NotifyUserCouldBeAutoSignedIn' in order to store the | 195 // Set during 'NotifyUserCouldBeAutoSignedIn' in order to store the |
190 // form for potential use during 'NotifySuccessfulLoginWithExistingPassword'. | 196 // form for potential use during 'NotifySuccessfulLoginWithExistingPassword'. |
191 std::unique_ptr<autofill::PasswordForm> possible_auto_sign_in_; | 197 std::unique_ptr<autofill::PasswordForm> possible_auto_sign_in_; |
192 | 198 |
193 DISALLOW_COPY_AND_ASSIGN(ChromePasswordManagerClient); | 199 DISALLOW_COPY_AND_ASSIGN(ChromePasswordManagerClient); |
194 }; | 200 }; |
195 | 201 |
196 #endif // CHROME_BROWSER_PASSWORD_MANAGER_CHROME_PASSWORD_MANAGER_CLIENT_H_ | 202 #endif // CHROME_BROWSER_PASSWORD_MANAGER_CHROME_PASSWORD_MANAGER_CLIENT_H_ |
OLD | NEW |