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_CHROMEOS_LOGIN_SESSION_USER_SESSION_MANAGER_H_ | 5 #ifndef CHROME_BROWSER_CHROMEOS_LOGIN_SESSION_USER_SESSION_MANAGER_H_ |
6 #define CHROME_BROWSER_CHROMEOS_LOGIN_SESSION_USER_SESSION_MANAGER_H_ | 6 #define CHROME_BROWSER_CHROMEOS_LOGIN_SESSION_USER_SESSION_MANAGER_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
(...skipping 179 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
190 // Returns true if Easy unlock keys needs to be updated. | 190 // Returns true if Easy unlock keys needs to be updated. |
191 bool NeedsToUpdateEasyUnlockKeys() const; | 191 bool NeedsToUpdateEasyUnlockKeys() const; |
192 | 192 |
193 // Returns true if there are pending Easy unlock key operations and | 193 // Returns true if there are pending Easy unlock key operations and |
194 // |callback| will be invoked when it is done. | 194 // |callback| will be invoked when it is done. |
195 bool CheckEasyUnlockKeyOps(const base::Closure& callback); | 195 bool CheckEasyUnlockKeyOps(const base::Closure& callback); |
196 | 196 |
197 void AddSessionStateObserver(chromeos::UserSessionStateObserver* observer); | 197 void AddSessionStateObserver(chromeos::UserSessionStateObserver* observer); |
198 void RemoveSessionStateObserver(chromeos::UserSessionStateObserver* observer); | 198 void RemoveSessionStateObserver(chromeos::UserSessionStateObserver* observer); |
199 | 199 |
200 virtual void ActiveUserChanged( | 200 void ActiveUserChanged(const user_manager::User* active_user) override; |
201 const user_manager::User* active_user) override; | |
202 | 201 |
203 // Returns default IME state for user session. | 202 // Returns default IME state for user session. |
204 scoped_refptr<input_method::InputMethodManager::State> GetDefaultIMEState( | 203 scoped_refptr<input_method::InputMethodManager::State> GetDefaultIMEState( |
205 Profile* profile); | 204 Profile* profile); |
206 | 205 |
207 // Note this could return NULL if not enabled. | 206 // Note this could return NULL if not enabled. |
208 EasyUnlockKeyManager* GetEasyUnlockKeyManager(); | 207 EasyUnlockKeyManager* GetEasyUnlockKeyManager(); |
209 | 208 |
210 // Update Easy unlock cryptohome keys for given user context. | 209 // Update Easy unlock cryptohome keys for given user context. |
211 void UpdateEasyUnlockKeys(const UserContext& user_context); | 210 void UpdateEasyUnlockKeys(const UserContext& user_context); |
212 | 211 |
213 // Removes a profile from the per-user input methods states map. | 212 // Removes a profile from the per-user input methods states map. |
214 void RemoveProfileForTesting(Profile* profile); | 213 void RemoveProfileForTesting(Profile* profile); |
215 | 214 |
216 private: | 215 private: |
217 friend struct DefaultSingletonTraits<UserSessionManager>; | 216 friend struct DefaultSingletonTraits<UserSessionManager>; |
218 | 217 |
219 typedef std::set<std::string> SigninSessionRestoreStateSet; | 218 typedef std::set<std::string> SigninSessionRestoreStateSet; |
220 | 219 |
221 UserSessionManager(); | 220 UserSessionManager(); |
222 virtual ~UserSessionManager(); | 221 ~UserSessionManager() override; |
223 | 222 |
224 // OAuth2LoginManager::Observer overrides: | 223 // OAuth2LoginManager::Observer overrides: |
225 virtual void OnSessionRestoreStateChanged( | 224 void OnSessionRestoreStateChanged( |
226 Profile* user_profile, | 225 Profile* user_profile, |
227 OAuth2LoginManager::SessionRestoreState state) override; | 226 OAuth2LoginManager::SessionRestoreState state) override; |
228 | 227 |
229 // net::NetworkChangeNotifier::ConnectionTypeObserver overrides: | 228 // net::NetworkChangeNotifier::ConnectionTypeObserver overrides: |
230 virtual void OnConnectionTypeChanged( | 229 void OnConnectionTypeChanged( |
231 net::NetworkChangeNotifier::ConnectionType type) override; | 230 net::NetworkChangeNotifier::ConnectionType type) override; |
232 | 231 |
233 // UserSessionManagerDelegate overrides: | 232 // UserSessionManagerDelegate overrides: |
234 // Used when restoring user sessions after crash. | 233 // Used when restoring user sessions after crash. |
235 virtual void OnProfilePrepared(Profile* profile, | 234 void OnProfilePrepared(Profile* profile, bool browser_launched) override; |
236 bool browser_launched) override; | |
237 | 235 |
238 void CreateUserSession(const UserContext& user_context, | 236 void CreateUserSession(const UserContext& user_context, |
239 bool has_auth_cookies); | 237 bool has_auth_cookies); |
240 void PreStartSession(); | 238 void PreStartSession(); |
241 void StartCrosSession(); | 239 void StartCrosSession(); |
242 void NotifyUserLoggedIn(); | 240 void NotifyUserLoggedIn(); |
243 void PrepareProfile(); | 241 void PrepareProfile(); |
244 | 242 |
245 // Callback for asynchronous profile creation. | 243 // Callback for asynchronous profile creation. |
246 void OnProfileCreated(const UserContext& user_context, | 244 void OnProfileCreated(const UserContext& user_context, |
(...skipping 137 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
384 scoped_ptr<EasyUnlockKeyManager> easy_unlock_key_manager_; | 382 scoped_ptr<EasyUnlockKeyManager> easy_unlock_key_manager_; |
385 bool running_easy_unlock_key_ops_; | 383 bool running_easy_unlock_key_ops_; |
386 base::Closure easy_unlock_key_ops_finished_callback_; | 384 base::Closure easy_unlock_key_ops_finished_callback_; |
387 | 385 |
388 DISALLOW_COPY_AND_ASSIGN(UserSessionManager); | 386 DISALLOW_COPY_AND_ASSIGN(UserSessionManager); |
389 }; | 387 }; |
390 | 388 |
391 } // namespace chromeos | 389 } // namespace chromeos |
392 | 390 |
393 #endif // CHROME_BROWSER_CHROMEOS_LOGIN_SESSION_USER_SESSION_MANAGER_H_ | 391 #endif // CHROME_BROWSER_CHROMEOS_LOGIN_SESSION_USER_SESSION_MANAGER_H_ |
OLD | NEW |