| 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 173 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 184 // login host is deleted. | 184 // login host is deleted. |
| 185 void DoBrowserLaunch(Profile* profile, LoginDisplayHost* login_host); | 185 void DoBrowserLaunch(Profile* profile, LoginDisplayHost* login_host); |
| 186 | 186 |
| 187 // Changes browser locale (selects best suitable locale from different | 187 // Changes browser locale (selects best suitable locale from different |
| 188 // user settings). Returns true if callback will be called. | 188 // user settings). Returns true if callback will be called. |
| 189 bool RespectLocalePreference( | 189 bool RespectLocalePreference( |
| 190 Profile* profile, | 190 Profile* profile, |
| 191 const user_manager::User* user, | 191 const user_manager::User* user, |
| 192 const locale_util::SwitchLanguageCallback& callback) const; | 192 const locale_util::SwitchLanguageCallback& callback) const; |
| 193 | 193 |
| 194 // Switch to the locale that |profile| wishes to use and invoke |callback|. |
| 195 void RespectLocalePreferenceWrapper(Profile* profile, |
| 196 const base::Closure& callback); |
| 197 |
| 194 // Restarts Chrome if needed. This happens when user session has custom | 198 // Restarts Chrome if needed. This happens when user session has custom |
| 195 // flags/switches enabled. Another case when owner has setup custom flags, | 199 // flags/switches enabled. Another case when owner has setup custom flags, |
| 196 // they are applied on login screen as well but not to user session. | 200 // they are applied on login screen as well but not to user session. |
| 197 // |early_restart| is true if this restart attempt happens before user profile | 201 // |early_restart| is true if this restart attempt happens before user profile |
| 198 // is fully initialized. | 202 // is fully initialized. |
| 199 // Might not return if restart is possible right now. | 203 // Might not return if restart is possible right now. |
| 200 // Returns true if restart was scheduled. | 204 // Returns true if restart was scheduled. |
| 201 // Returns false if no restart is needed. | 205 // Returns false if no restart is needed. |
| 202 bool RestartToApplyPerSessionFlagsIfNeed(Profile* profile, | 206 bool RestartToApplyPerSessionFlagsIfNeed(Profile* profile, |
| 203 bool early_restart); | 207 bool early_restart); |
| (...skipping 21 matching lines...) Expand all Loading... |
| 225 void UpdateEasyUnlockKeys(const UserContext& user_context); | 229 void UpdateEasyUnlockKeys(const UserContext& user_context); |
| 226 | 230 |
| 227 // Returns the auth request context associated with auth data. | 231 // Returns the auth request context associated with auth data. |
| 228 net::URLRequestContextGetter* GetAuthRequestContext() const; | 232 net::URLRequestContextGetter* GetAuthRequestContext() const; |
| 229 | 233 |
| 230 // Removes a profile from the per-user input methods states map. | 234 // Removes a profile from the per-user input methods states map. |
| 231 void RemoveProfileForTesting(Profile* profile); | 235 void RemoveProfileForTesting(Profile* profile); |
| 232 | 236 |
| 233 bool has_auth_cookies() const { return has_auth_cookies_; } | 237 bool has_auth_cookies() const { return has_auth_cookies_; } |
| 234 | 238 |
| 239 // This is called from ProfileImpl() before profile is created. |
| 240 void OnNewProfileCreating(Profile* profile); |
| 241 |
| 235 private: | 242 private: |
| 236 friend class test::UserSessionManagerTestApi; | 243 friend class test::UserSessionManagerTestApi; |
| 237 friend struct DefaultSingletonTraits<UserSessionManager>; | 244 friend struct DefaultSingletonTraits<UserSessionManager>; |
| 238 | 245 |
| 239 typedef std::set<std::string> SigninSessionRestoreStateSet; | 246 typedef std::set<std::string> SigninSessionRestoreStateSet; |
| 240 | 247 |
| 241 UserSessionManager(); | 248 UserSessionManager(); |
| 242 ~UserSessionManager() override; | 249 ~UserSessionManager() override; |
| 243 | 250 |
| 244 // OAuth2LoginManager::Observer overrides: | 251 // OAuth2LoginManager::Observer overrides: |
| (...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 337 bool success); | 344 bool success); |
| 338 | 345 |
| 339 // Internal implementation of DoBrowserLaunch. Initially should be called with | 346 // Internal implementation of DoBrowserLaunch. Initially should be called with |
| 340 // |locale_pref_checked| set to false which will result in postponing browser | 347 // |locale_pref_checked| set to false which will result in postponing browser |
| 341 // launch till user locale is applied if needed. After locale check has | 348 // launch till user locale is applied if needed. After locale check has |
| 342 // completed this method is called with |locale_pref_checked| set to true. | 349 // completed this method is called with |locale_pref_checked| set to true. |
| 343 void DoBrowserLaunchInternal(Profile* profile, | 350 void DoBrowserLaunchInternal(Profile* profile, |
| 344 LoginDisplayHost* login_host, | 351 LoginDisplayHost* login_host, |
| 345 bool locale_pref_checked); | 352 bool locale_pref_checked); |
| 346 | 353 |
| 347 // Switch to the locale that |profile| wishes to use and invoke |callback|. | |
| 348 void RespectLocalePreferenceWrapper(Profile* profile, | |
| 349 const base::Closure& callback); | |
| 350 | |
| 351 static void RunCallbackOnLocaleLoaded( | 354 static void RunCallbackOnLocaleLoaded( |
| 352 const base::Closure& callback, | 355 const base::Closure& callback, |
| 353 InputEventsBlocker* input_events_blocker, | 356 InputEventsBlocker* input_events_blocker, |
| 354 const locale_util::LanguageSwitchResult& result); | 357 const locale_util::LanguageSwitchResult& result); |
| 355 | 358 |
| 356 // Test API methods. | 359 // Test API methods. |
| 357 | 360 |
| 358 // Injects |user_context| that will be used to create StubAuthenticator | 361 // Injects |user_context| that will be used to create StubAuthenticator |
| 359 // instance when CreateAuthenticator() is called. | 362 // instance when CreateAuthenticator() is called. |
| 360 void InjectStubUserContext(const UserContext& user_context); | 363 void InjectStubUserContext(const UserContext& user_context); |
| (...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 427 bool waiting_for_child_account_status_; | 430 bool waiting_for_child_account_status_; |
| 428 | 431 |
| 429 base::WeakPtrFactory<UserSessionManager> weak_factory_; | 432 base::WeakPtrFactory<UserSessionManager> weak_factory_; |
| 430 | 433 |
| 431 DISALLOW_COPY_AND_ASSIGN(UserSessionManager); | 434 DISALLOW_COPY_AND_ASSIGN(UserSessionManager); |
| 432 }; | 435 }; |
| 433 | 436 |
| 434 } // namespace chromeos | 437 } // namespace chromeos |
| 435 | 438 |
| 436 #endif // CHROME_BROWSER_CHROMEOS_LOGIN_SESSION_USER_SESSION_MANAGER_H_ | 439 #endif // CHROME_BROWSER_CHROMEOS_LOGIN_SESSION_USER_SESSION_MANAGER_H_ |
| OLD | NEW |