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 140 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
344 bool success); | 348 bool success); |
345 | 349 |
346 // Internal implementation of DoBrowserLaunch. Initially should be called with | 350 // Internal implementation of DoBrowserLaunch. Initially should be called with |
347 // |locale_pref_checked| set to false which will result in postponing browser | 351 // |locale_pref_checked| set to false which will result in postponing browser |
348 // launch till user locale is applied if needed. After locale check has | 352 // launch till user locale is applied if needed. After locale check has |
349 // completed this method is called with |locale_pref_checked| set to true. | 353 // completed this method is called with |locale_pref_checked| set to true. |
350 void DoBrowserLaunchInternal(Profile* profile, | 354 void DoBrowserLaunchInternal(Profile* profile, |
351 LoginDisplayHost* login_host, | 355 LoginDisplayHost* login_host, |
352 bool locale_pref_checked); | 356 bool locale_pref_checked); |
353 | 357 |
354 // Switch to the locale that |profile| wishes to use and invoke |callback|. | |
355 void RespectLocalePreferenceWrapper(Profile* profile, | |
356 const base::Closure& callback); | |
357 | |
358 static void RunCallbackOnLocaleLoaded( | 358 static void RunCallbackOnLocaleLoaded( |
359 const base::Closure& callback, | 359 const base::Closure& callback, |
360 InputEventsBlocker* input_events_blocker, | 360 InputEventsBlocker* input_events_blocker, |
361 const locale_util::LanguageSwitchResult& result); | 361 const locale_util::LanguageSwitchResult& result); |
362 | 362 |
363 // Test API methods. | 363 // Test API methods. |
364 | 364 |
365 // Injects |user_context| that will be used to create StubAuthenticator | 365 // Injects |user_context| that will be used to create StubAuthenticator |
366 // instance when CreateAuthenticator() is called. | 366 // instance when CreateAuthenticator() is called. |
367 void InjectStubUserContext(const UserContext& user_context); | 367 void InjectStubUserContext(const UserContext& user_context); |
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
451 bool waiting_for_child_account_status_; | 451 bool waiting_for_child_account_status_; |
452 | 452 |
453 base::WeakPtrFactory<UserSessionManager> weak_factory_; | 453 base::WeakPtrFactory<UserSessionManager> weak_factory_; |
454 | 454 |
455 DISALLOW_COPY_AND_ASSIGN(UserSessionManager); | 455 DISALLOW_COPY_AND_ASSIGN(UserSessionManager); |
456 }; | 456 }; |
457 | 457 |
458 } // namespace chromeos | 458 } // namespace chromeos |
459 | 459 |
460 #endif // CHROME_BROWSER_CHROMEOS_LOGIN_SESSION_USER_SESSION_MANAGER_H_ | 460 #endif // CHROME_BROWSER_CHROMEOS_LOGIN_SESSION_USER_SESSION_MANAGER_H_ |
OLD | NEW |