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

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: Impl done, unit_tests and browser_tests not ready yet 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 // Mojo CredentialManager impl instance,
vabr (Chromium) 2016/03/09 16:26:29 nit: I'm not sure I understand the first sentence,
leonhsl(Using Gerrit) 2016/03/10 06:42:41 Done. Removed the redundant sentence.
169 credential_manager_dispatcher_; 173 // keep its lifecycle untouch, keep the 1:1 mapping with
174 // ChromePasswordManagerClient instance and WebContents instance.
175 // As a mojo service, will be registered into service registry
176 // of the main frame host by ChromeContentBrowserClient
177 // once main frame host was created.
178 password_manager::CredentialManagerImpl credential_manager_impl_;
170 179
171 // Observer for password generation popup. 180 // Observer for password generation popup.
172 autofill::PasswordGenerationPopupObserver* observer_; 181 autofill::PasswordGenerationPopupObserver* observer_;
173 182
174 // Controls the popup 183 // Controls the popup
175 base::WeakPtr< 184 base::WeakPtr<
176 autofill::PasswordGenerationPopupControllerImpl> popup_controller_; 185 autofill::PasswordGenerationPopupControllerImpl> popup_controller_;
177 186
178 // 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
179 // want to save passwords and also won't fill the passwords). 188 // want to save passwords and also won't fill the passwords).
180 BooleanPrefMember saving_and_filling_passwords_enabled_; 189 BooleanPrefMember saving_and_filling_passwords_enabled_;
181 190
182 const password_manager::SyncCredentialsFilter credentials_filter_; 191 const password_manager::SyncCredentialsFilter credentials_filter_;
183 192
184 scoped_ptr<password_manager::LogManager> log_manager_; 193 scoped_ptr<password_manager::LogManager> log_manager_;
185 194
186 // Set during 'NotifyUserCouldBeAutoSignedIn' in order to store the 195 // Set during 'NotifyUserCouldBeAutoSignedIn' in order to store the
187 // form for potential use during 'NotifySuccessfulLoginWithExistingPassword'. 196 // form for potential use during 'NotifySuccessfulLoginWithExistingPassword'.
188 scoped_ptr<autofill::PasswordForm> possible_auto_sign_in_; 197 scoped_ptr<autofill::PasswordForm> possible_auto_sign_in_;
189 198
190 DISALLOW_COPY_AND_ASSIGN(ChromePasswordManagerClient); 199 DISALLOW_COPY_AND_ASSIGN(ChromePasswordManagerClient);
191 }; 200 };
192 201
193 #endif // CHROME_BROWSER_PASSWORD_MANAGER_CHROME_PASSWORD_MANAGER_CLIENT_H_ 202 #endif // CHROME_BROWSER_PASSWORD_MANAGER_CHROME_PASSWORD_MANAGER_CLIENT_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698