| 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/memory/singleton.h" | 11 #include "base/memory/singleton.h" |
| 12 #include "base/memory/weak_ptr.h" | 12 #include "base/memory/weak_ptr.h" |
| 13 #include "base/observer_list.h" | 13 #include "base/observer_list.h" |
| 14 #include "chrome/browser/chromeos/base/locale_util.h" | 14 #include "chrome/browser/chromeos/base/locale_util.h" |
| 15 #include "chrome/browser/chromeos/login/signin/oauth2_login_manager.h" | 15 #include "chrome/browser/chromeos/login/signin/oauth2_login_manager.h" |
| 16 #include "chromeos/dbus/session_manager_client.h" | 16 #include "chromeos/dbus/session_manager_client.h" |
| 17 #include "chromeos/ime/input_method_manager.h" |
| 17 #include "chromeos/login/auth/authenticator.h" | 18 #include "chromeos/login/auth/authenticator.h" |
| 18 #include "chromeos/login/auth/user_context.h" | 19 #include "chromeos/login/auth/user_context.h" |
| 19 #include "components/user_manager/user.h" | 20 #include "components/user_manager/user.h" |
| 20 #include "net/base/network_change_notifier.h" | 21 #include "net/base/network_change_notifier.h" |
| 21 | 22 |
| 22 class PrefRegistrySimple; | 23 class PrefRegistrySimple; |
| 23 class PrefService; | 24 class PrefService; |
| 24 class Profile; | 25 class Profile; |
| 25 | 26 |
| 26 namespace chromeos { | 27 namespace chromeos { |
| (...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 123 const std::string& chrome_client_secret); | 124 const std::string& chrome_client_secret); |
| 124 | 125 |
| 125 // Changes browser locale (selects best suitable locale from different | 126 // Changes browser locale (selects best suitable locale from different |
| 126 // user settings). Returns true if callback will be called. | 127 // user settings). Returns true if callback will be called. |
| 127 // Returns true if callback will be called. | 128 // Returns true if callback will be called. |
| 128 bool RespectLocalePreference( | 129 bool RespectLocalePreference( |
| 129 Profile* profile, | 130 Profile* profile, |
| 130 const user_manager::User* user, | 131 const user_manager::User* user, |
| 131 scoped_ptr<locale_util::SwitchLanguageCallback> callback) const; | 132 scoped_ptr<locale_util::SwitchLanguageCallback> callback) const; |
| 132 | 133 |
| 133 void AddSessionStateObserver(UserSessionStateObserver* observer); | 134 void AddSessionStateObserver(chromeos::UserSessionStateObserver* observer); |
| 134 void RemoveSessionStateObserver(UserSessionStateObserver* observer); | 135 void RemoveSessionStateObserver(chromeos::UserSessionStateObserver* observer); |
| 135 | 136 |
| 136 private: | 137 private: |
| 137 friend struct DefaultSingletonTraits<UserSessionManager>; | 138 friend struct DefaultSingletonTraits<UserSessionManager>; |
| 138 | 139 |
| 139 typedef std::set<std::string> SigninSessionRestoreStateSet; | 140 typedef std::set<std::string> SigninSessionRestoreStateSet; |
| 140 | 141 |
| 141 UserSessionManager(); | 142 UserSessionManager(); |
| 142 virtual ~UserSessionManager(); | 143 virtual ~UserSessionManager(); |
| 143 | 144 |
| 144 // OAuth2LoginManager::Observer overrides: | 145 // OAuth2LoginManager::Observer overrides: |
| (...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 233 // Active user session restoration related members. | 234 // Active user session restoration related members. |
| 234 | 235 |
| 235 // True is user sessions has been restored after crash. | 236 // True is user sessions has been restored after crash. |
| 236 // On a normal boot then login into user sessions this will be false. | 237 // On a normal boot then login into user sessions this will be false. |
| 237 bool user_sessions_restored_; | 238 bool user_sessions_restored_; |
| 238 | 239 |
| 239 // User sessions that have to be restored after browser crash. | 240 // User sessions that have to be restored after browser crash. |
| 240 // [user_id] > [user_id_hash] | 241 // [user_id] > [user_id_hash] |
| 241 SessionManagerClient::ActiveSessionsMap pending_user_sessions_; | 242 SessionManagerClient::ActiveSessionsMap pending_user_sessions_; |
| 242 | 243 |
| 243 ObserverList<UserSessionStateObserver> session_state_observer_list_; | 244 ObserverList<chromeos::UserSessionStateObserver> session_state_observer_list_; |
| 244 | 245 |
| 245 // OAuth2 session related members. | 246 // OAuth2 session related members. |
| 246 | 247 |
| 247 // True if we should restart chrome right after session restore. | 248 // True if we should restart chrome right after session restore. |
| 248 bool exit_after_session_restore_; | 249 bool exit_after_session_restore_; |
| 249 | 250 |
| 250 // Sesion restore strategy. | 251 // Sesion restore strategy. |
| 251 OAuth2LoginManager::SessionRestoreStrategy session_restore_strategy_; | 252 OAuth2LoginManager::SessionRestoreStrategy session_restore_strategy_; |
| 252 | 253 |
| 253 // OAuth2 refresh token for session restore. | 254 // OAuth2 refresh token for session restore. |
| 254 std::string oauth2_refresh_token_; | 255 std::string oauth2_refresh_token_; |
| 255 | 256 |
| 256 // Set of user_id for those users that we should restore authentication | 257 // Set of user_id for those users that we should restore authentication |
| 257 // session when notified about online state change. | 258 // session when notified about online state change. |
| 258 SigninSessionRestoreStateSet pending_signin_restore_sessions_; | 259 SigninSessionRestoreStateSet pending_signin_restore_sessions_; |
| 259 | 260 |
| 260 // Kiosk mode related members. | 261 // Kiosk mode related members. |
| 261 // Chrome oauth client id and secret - override values for kiosk mode. | 262 // Chrome oauth client id and secret - override values for kiosk mode. |
| 262 std::string chrome_client_id_; | 263 std::string chrome_client_id_; |
| 263 std::string chrome_client_secret_; | 264 std::string chrome_client_secret_; |
| 264 | 265 |
| 265 DISALLOW_COPY_AND_ASSIGN(UserSessionManager); | 266 DISALLOW_COPY_AND_ASSIGN(UserSessionManager); |
| 266 }; | 267 }; |
| 267 | 268 |
| 268 } // namespace chromeos | 269 } // namespace chromeos |
| 269 | 270 |
| 270 #endif // CHROME_BROWSER_CHROMEOS_LOGIN_SESSION_USER_SESSION_MANAGER_H_ | 271 #endif // CHROME_BROWSER_CHROMEOS_LOGIN_SESSION_USER_SESSION_MANAGER_H_ |
| OLD | NEW |