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_impl.h" | 15 #include "components/password_manager/content/browser/credential_manager_dispatc
her.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 | |
112 protected: | 108 protected: |
113 // Callable for tests. | 109 // Callable for tests. |
114 ChromePasswordManagerClient(content::WebContents* web_contents, | 110 ChromePasswordManagerClient(content::WebContents* web_contents, |
115 autofill::AutofillClient* autofill_client); | 111 autofill::AutofillClient* autofill_client); |
116 | 112 |
117 private: | 113 private: |
118 friend class content::WebContentsUserData<ChromePasswordManagerClient>; | 114 friend class content::WebContentsUserData<ChromePasswordManagerClient>; |
119 | 115 |
120 // content::WebContentsObserver overrides. | 116 // content::WebContentsObserver overrides. |
121 bool OnMessageReceived(const IPC::Message& message, | 117 bool OnMessageReceived(const IPC::Message& message, |
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
163 // nothing was chosen. | 159 // nothing was chosen. |
164 void OnCredentialsChosen(const CredentialsCallback& callback, | 160 void OnCredentialsChosen(const CredentialsCallback& callback, |
165 const autofill::PasswordForm* form); | 161 const autofill::PasswordForm* form); |
166 | 162 |
167 Profile* const profile_; | 163 Profile* const profile_; |
168 | 164 |
169 password_manager::PasswordManager password_manager_; | 165 password_manager::PasswordManager password_manager_; |
170 | 166 |
171 password_manager::ContentPasswordManagerDriverFactory* driver_factory_; | 167 password_manager::ContentPasswordManagerDriverFactory* driver_factory_; |
172 | 168 |
173 // As a mojo service, will be registered into service registry | 169 password_manager::CredentialManagerDispatcher |
174 // of the main frame host by ChromeContentBrowserClient | 170 credential_manager_dispatcher_; |
175 // once main frame host was created. | |
176 password_manager::CredentialManagerImpl credential_manager_impl_; | |
177 | 171 |
178 // Observer for password generation popup. | 172 // Observer for password generation popup. |
179 autofill::PasswordGenerationPopupObserver* observer_; | 173 autofill::PasswordGenerationPopupObserver* observer_; |
180 | 174 |
181 // Controls the popup | 175 // Controls the popup |
182 base::WeakPtr< | 176 base::WeakPtr< |
183 autofill::PasswordGenerationPopupControllerImpl> popup_controller_; | 177 autofill::PasswordGenerationPopupControllerImpl> popup_controller_; |
184 | 178 |
185 // Set to false to disable password saving (will no longer ask if you | 179 // Set to false to disable password saving (will no longer ask if you |
186 // want to save passwords and also won't fill the passwords). | 180 // want to save passwords and also won't fill the passwords). |
187 BooleanPrefMember saving_and_filling_passwords_enabled_; | 181 BooleanPrefMember saving_and_filling_passwords_enabled_; |
188 | 182 |
189 const password_manager::SyncCredentialsFilter credentials_filter_; | 183 const password_manager::SyncCredentialsFilter credentials_filter_; |
190 | 184 |
191 std::unique_ptr<password_manager::LogManager> log_manager_; | 185 std::unique_ptr<password_manager::LogManager> log_manager_; |
192 | 186 |
193 // Set during 'NotifyUserCouldBeAutoSignedIn' in order to store the | 187 // Set during 'NotifyUserCouldBeAutoSignedIn' in order to store the |
194 // form for potential use during 'NotifySuccessfulLoginWithExistingPassword'. | 188 // form for potential use during 'NotifySuccessfulLoginWithExistingPassword'. |
195 std::unique_ptr<autofill::PasswordForm> possible_auto_sign_in_; | 189 std::unique_ptr<autofill::PasswordForm> possible_auto_sign_in_; |
196 | 190 |
197 DISALLOW_COPY_AND_ASSIGN(ChromePasswordManagerClient); | 191 DISALLOW_COPY_AND_ASSIGN(ChromePasswordManagerClient); |
198 }; | 192 }; |
199 | 193 |
200 #endif // CHROME_BROWSER_PASSWORD_MANAGER_CHROME_PASSWORD_MANAGER_CLIENT_H_ | 194 #endif // CHROME_BROWSER_PASSWORD_MANAGER_CHROME_PASSWORD_MANAGER_CLIENT_H_ |
OLD | NEW |