| 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 133 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 337 bool success); | 341 bool success); |
| 338 | 342 |
| 339 // Internal implementation of DoBrowserLaunch. Initially should be called with | 343 // Internal implementation of DoBrowserLaunch. Initially should be called with |
| 340 // |locale_pref_checked| set to false which will result in postponing browser | 344 // |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 | 345 // 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. | 346 // completed this method is called with |locale_pref_checked| set to true. |
| 343 void DoBrowserLaunchInternal(Profile* profile, | 347 void DoBrowserLaunchInternal(Profile* profile, |
| 344 LoginDisplayHost* login_host, | 348 LoginDisplayHost* login_host, |
| 345 bool locale_pref_checked); | 349 bool locale_pref_checked); |
| 346 | 350 |
| 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( | 351 static void RunCallbackOnLocaleLoaded( |
| 352 const base::Closure& callback, | 352 const base::Closure& callback, |
| 353 InputEventsBlocker* input_events_blocker, | 353 InputEventsBlocker* input_events_blocker, |
| 354 const locale_util::LanguageSwitchResult& result); | 354 const locale_util::LanguageSwitchResult& result); |
| 355 | 355 |
| 356 // Test API methods. | 356 // Test API methods. |
| 357 | 357 |
| 358 // Injects |user_context| that will be used to create StubAuthenticator | 358 // Injects |user_context| that will be used to create StubAuthenticator |
| 359 // instance when CreateAuthenticator() is called. | 359 // instance when CreateAuthenticator() is called. |
| 360 void InjectStubUserContext(const UserContext& user_context); | 360 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_; | 427 bool waiting_for_child_account_status_; |
| 428 | 428 |
| 429 base::WeakPtrFactory<UserSessionManager> weak_factory_; | 429 base::WeakPtrFactory<UserSessionManager> weak_factory_; |
| 430 | 430 |
| 431 DISALLOW_COPY_AND_ASSIGN(UserSessionManager); | 431 DISALLOW_COPY_AND_ASSIGN(UserSessionManager); |
| 432 }; | 432 }; |
| 433 | 433 |
| 434 } // namespace chromeos | 434 } // namespace chromeos |
| 435 | 435 |
| 436 #endif // CHROME_BROWSER_CHROMEOS_LOGIN_SESSION_USER_SESSION_MANAGER_H_ | 436 #endif // CHROME_BROWSER_CHROMEOS_LOGIN_SESSION_USER_SESSION_MANAGER_H_ |
| OLD | NEW |