Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1)

Side by Side Diff: chrome/browser/password_manager/chrome_password_manager_client.h

Issue 1762603002: Switch components/password_manager code from IPC messages to Mojo. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Add browsertests. Created 4 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 71 matching lines...) Expand 10 before | Expand all | Expand 10 after
97 content::WebContents* contents, 97 content::WebContents* contents,
98 autofill::AutofillClient* autofill_client); 98 autofill::AutofillClient* autofill_client);
99 99
100 // Observer for PasswordGenerationPopup events. Used for testing. 100 // Observer for PasswordGenerationPopup events. Used for testing.
101 void SetTestObserver(autofill::PasswordGenerationPopupObserver* observer); 101 void SetTestObserver(autofill::PasswordGenerationPopupObserver* observer);
102 102
103 // Returns true if the bubble UI is enabled, and false if we're still using 103 // Returns true if the bubble UI is enabled, and false if we're still using
104 // the sad old Infobar UI. 104 // the sad old Infobar UI.
105 static bool IsTheHotNewBubbleUIEnabled(); 105 static bool IsTheHotNewBubbleUIEnabled();
106 106
107 static void BindCredentialManager(
108 content::RenderFrameHost* render_frame_host,
109 password_manager::mojom::CredentialManagerRequest request);
110
107 protected: 111 protected:
108 // Callable for tests. 112 // Callable for tests.
109 ChromePasswordManagerClient(content::WebContents* web_contents, 113 ChromePasswordManagerClient(content::WebContents* web_contents,
110 autofill::AutofillClient* autofill_client); 114 autofill::AutofillClient* autofill_client);
111 115
112 private: 116 private:
113 friend class content::WebContentsUserData<ChromePasswordManagerClient>; 117 friend class content::WebContentsUserData<ChromePasswordManagerClient>;
114 118
115 // content::WebContentsObserver overrides. 119 // content::WebContentsObserver overrides.
116 bool OnMessageReceived(const IPC::Message& message, 120 bool OnMessageReceived(const IPC::Message& message,
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
158 void OnCredentialsChosen( 162 void OnCredentialsChosen(
159 base::Callback<void(const password_manager::CredentialInfo&)> callback, 163 base::Callback<void(const password_manager::CredentialInfo&)> callback,
160 const password_manager::CredentialInfo& credential); 164 const password_manager::CredentialInfo& credential);
161 165
162 Profile* const profile_; 166 Profile* const profile_;
163 167
164 password_manager::PasswordManager password_manager_; 168 password_manager::PasswordManager password_manager_;
165 169
166 password_manager::ContentPasswordManagerDriverFactory* driver_factory_; 170 password_manager::ContentPasswordManagerDriverFactory* driver_factory_;
167 171
168 password_manager::CredentialManagerDispatcher 172 // As a mojo service, will be registered into service registry
169 credential_manager_dispatcher_; 173 // of the main frame host by ChromeContentBrowserClient
174 // once main frame host was created.
175 password_manager::CredentialManagerImpl credential_manager_impl_;
170 176
171 // Observer for password generation popup. 177 // Observer for password generation popup.
172 autofill::PasswordGenerationPopupObserver* observer_; 178 autofill::PasswordGenerationPopupObserver* observer_;
173 179
174 // Controls the popup 180 // Controls the popup
175 base::WeakPtr< 181 base::WeakPtr<
176 autofill::PasswordGenerationPopupControllerImpl> popup_controller_; 182 autofill::PasswordGenerationPopupControllerImpl> popup_controller_;
177 183
178 // Set to false to disable password saving (will no longer ask if you 184 // Set to false to disable password saving (will no longer ask if you
179 // want to save passwords and also won't fill the passwords). 185 // want to save passwords and also won't fill the passwords).
180 BooleanPrefMember saving_and_filling_passwords_enabled_; 186 BooleanPrefMember saving_and_filling_passwords_enabled_;
181 187
182 const password_manager::SyncCredentialsFilter credentials_filter_; 188 const password_manager::SyncCredentialsFilter credentials_filter_;
183 189
184 scoped_ptr<password_manager::LogManager> log_manager_; 190 scoped_ptr<password_manager::LogManager> log_manager_;
185 191
186 // Set during 'NotifyUserCouldBeAutoSignedIn' in order to store the 192 // Set during 'NotifyUserCouldBeAutoSignedIn' in order to store the
187 // form for potential use during 'NotifySuccessfulLoginWithExistingPassword'. 193 // form for potential use during 'NotifySuccessfulLoginWithExistingPassword'.
188 scoped_ptr<autofill::PasswordForm> possible_auto_sign_in_; 194 scoped_ptr<autofill::PasswordForm> possible_auto_sign_in_;
189 195
190 DISALLOW_COPY_AND_ASSIGN(ChromePasswordManagerClient); 196 DISALLOW_COPY_AND_ASSIGN(ChromePasswordManagerClient);
191 }; 197 };
192 198
193 #endif // CHROME_BROWSER_PASSWORD_MANAGER_CHROME_PASSWORD_MANAGER_CLIENT_H_ 199 #endif // CHROME_BROWSER_PASSWORD_MANAGER_CHROME_PASSWORD_MANAGER_CLIENT_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698