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" |
| 11 #include "base/callback.h" |
11 #include "base/memory/scoped_ptr.h" | 12 #include "base/memory/scoped_ptr.h" |
12 #include "base/memory/singleton.h" | 13 #include "base/memory/singleton.h" |
13 #include "base/memory/weak_ptr.h" | 14 #include "base/memory/weak_ptr.h" |
14 #include "base/observer_list.h" | 15 #include "base/observer_list.h" |
15 #include "chrome/browser/chromeos/base/locale_util.h" | 16 #include "chrome/browser/chromeos/base/locale_util.h" |
16 #include "chrome/browser/chromeos/login/signin/oauth2_login_manager.h" | 17 #include "chrome/browser/chromeos/login/signin/oauth2_login_manager.h" |
17 #include "chromeos/dbus/session_manager_client.h" | 18 #include "chromeos/dbus/session_manager_client.h" |
18 #include "chromeos/ime/input_method_manager.h" | 19 #include "chromeos/ime/input_method_manager.h" |
19 #include "chromeos/login/auth/authenticator.h" | 20 #include "chromeos/login/auth/authenticator.h" |
20 #include "chromeos/login/auth/user_context.h" | 21 #include "chromeos/login/auth/user_context.h" |
(...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
132 // values can be overridden with kiosk auth file. | 133 // values can be overridden with kiosk auth file. |
133 bool GetAppModeChromeClientOAuthInfo( | 134 bool GetAppModeChromeClientOAuthInfo( |
134 std::string* chrome_client_id, | 135 std::string* chrome_client_id, |
135 std::string* chrome_client_secret); | 136 std::string* chrome_client_secret); |
136 void SetAppModeChromeClientOAuthInfo( | 137 void SetAppModeChromeClientOAuthInfo( |
137 const std::string& chrome_client_id, | 138 const std::string& chrome_client_id, |
138 const std::string& chrome_client_secret); | 139 const std::string& chrome_client_secret); |
139 | 140 |
140 // Changes browser locale (selects best suitable locale from different | 141 // Changes browser locale (selects best suitable locale from different |
141 // user settings). Returns true if callback will be called. | 142 // user settings). Returns true if callback will be called. |
142 // Returns true if callback will be called. | |
143 bool RespectLocalePreference( | 143 bool RespectLocalePreference( |
144 Profile* profile, | 144 Profile* profile, |
145 const user_manager::User* user, | 145 const user_manager::User* user, |
146 scoped_ptr<locale_util::SwitchLanguageCallback> callback) const; | 146 scoped_ptr<locale_util::SwitchLanguageCallback> callback) const; |
147 | 147 |
| 148 // Returns true if Easy unlock keys needs to be updated. |
| 149 bool NeedsToUpdateEasyUnlockKeys() const; |
| 150 |
| 151 // Returns true if there are pending Easy unlock key operations and |
| 152 // |callback| will be invoked when it is done. |
| 153 bool CheckEasyUnlockKeyOps(const base::Closure& callback); |
| 154 |
148 void AddSessionStateObserver(chromeos::UserSessionStateObserver* observer); | 155 void AddSessionStateObserver(chromeos::UserSessionStateObserver* observer); |
149 void RemoveSessionStateObserver(chromeos::UserSessionStateObserver* observer); | 156 void RemoveSessionStateObserver(chromeos::UserSessionStateObserver* observer); |
150 | 157 |
151 virtual void ActiveUserChanged( | 158 virtual void ActiveUserChanged( |
152 const user_manager::User* active_user) OVERRIDE; | 159 const user_manager::User* active_user) OVERRIDE; |
153 | 160 |
154 // Returns default IME state for user session. | 161 // Returns default IME state for user session. |
155 scoped_refptr<input_method::InputMethodManager::State> GetDefaultIMEState( | 162 scoped_refptr<input_method::InputMethodManager::State> GetDefaultIMEState( |
156 Profile* profile); | 163 Profile* profile); |
157 | 164 |
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
237 // Also called after first user session from that list is restored and so on. | 244 // Also called after first user session from that list is restored and so on. |
238 // Process continues till |pending_user_sessions_| map is not empty. | 245 // Process continues till |pending_user_sessions_| map is not empty. |
239 void RestorePendingUserSessions(); | 246 void RestorePendingUserSessions(); |
240 | 247 |
241 // Notifies observers that user pending sessions restore has finished. | 248 // Notifies observers that user pending sessions restore has finished. |
242 void NotifyPendingUserSessionsRestoreFinished(); | 249 void NotifyPendingUserSessionsRestoreFinished(); |
243 | 250 |
244 // Update Easy unlock cryptohome keys using the pairing data in user prefs. | 251 // Update Easy unlock cryptohome keys using the pairing data in user prefs. |
245 void UpdateEasyUnlockKeys(Profile* user_profile); | 252 void UpdateEasyUnlockKeys(Profile* user_profile); |
246 | 253 |
| 254 // Callback invoked when Easy unlock key operations are finished. |
| 255 void OnEasyUnlockKeyOpsFinished(bool success); |
| 256 |
247 UserSessionManagerDelegate* delegate_; | 257 UserSessionManagerDelegate* delegate_; |
248 | 258 |
249 // Authentication/user context. | 259 // Authentication/user context. |
250 UserContext user_context_; | 260 UserContext user_context_; |
251 scoped_refptr<Authenticator> authenticator_; | 261 scoped_refptr<Authenticator> authenticator_; |
252 | 262 |
253 // True if the authentication context's cookie jar contains authentication | 263 // True if the authentication context's cookie jar contains authentication |
254 // cookies from the authentication extension login flow. | 264 // cookies from the authentication extension login flow. |
255 bool has_auth_cookies_; | 265 bool has_auth_cookies_; |
256 | 266 |
(...skipping 28 matching lines...) Expand all Loading... |
285 // Chrome oauth client id and secret - override values for kiosk mode. | 295 // Chrome oauth client id and secret - override values for kiosk mode. |
286 std::string chrome_client_id_; | 296 std::string chrome_client_id_; |
287 std::string chrome_client_secret_; | 297 std::string chrome_client_secret_; |
288 | 298 |
289 // Per-user-session Input Methods states. | 299 // Per-user-session Input Methods states. |
290 std::map<Profile*, scoped_refptr<input_method::InputMethodManager::State> > | 300 std::map<Profile*, scoped_refptr<input_method::InputMethodManager::State> > |
291 default_ime_states_; | 301 default_ime_states_; |
292 | 302 |
293 // Manages Easy unlock cryptohome keys. | 303 // Manages Easy unlock cryptohome keys. |
294 scoped_ptr<EasyUnlockKeyManager> easy_unlock_key_manager_; | 304 scoped_ptr<EasyUnlockKeyManager> easy_unlock_key_manager_; |
| 305 bool running_easy_unlock_key_ops_; |
| 306 base::Closure easy_unlock_key_ops_finished_callback_; |
295 | 307 |
296 DISALLOW_COPY_AND_ASSIGN(UserSessionManager); | 308 DISALLOW_COPY_AND_ASSIGN(UserSessionManager); |
297 }; | 309 }; |
298 | 310 |
299 } // namespace chromeos | 311 } // namespace chromeos |
300 | 312 |
301 #endif // CHROME_BROWSER_CHROMEOS_LOGIN_SESSION_USER_SESSION_MANAGER_H_ | 313 #endif // CHROME_BROWSER_CHROMEOS_LOGIN_SESSION_USER_SESSION_MANAGER_H_ |
OLD | NEW |