Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(56)

Side by Side Diff: chrome/browser/chromeos/login/session/user_session_manager.h

Issue 1055863002: ChromeOS: switch UI language before apps are loaded. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fixed CREATE_MODE_SYNCHRONOUS mode. Created 5 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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 // If |synchronous| is true, wait for language switched.
196 void RespectLocalePreferenceWrapper(Profile* profile,
197 const base::Closure& callback,
198 bool synchronous);
199
194 // Restarts Chrome if needed. This happens when user session has custom 200 // Restarts Chrome if needed. This happens when user session has custom
195 // flags/switches enabled. Another case when owner has setup custom flags, 201 // 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. 202 // 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 203 // |early_restart| is true if this restart attempt happens before user profile
198 // is fully initialized. 204 // is fully initialized.
199 // Might not return if restart is possible right now. 205 // Might not return if restart is possible right now.
200 // Returns true if restart was scheduled. 206 // Returns true if restart was scheduled.
201 // Returns false if no restart is needed. 207 // Returns false if no restart is needed.
202 bool RestartToApplyPerSessionFlagsIfNeed(Profile* profile, 208 bool RestartToApplyPerSessionFlagsIfNeed(Profile* profile,
203 bool early_restart); 209 bool early_restart);
(...skipping 140 matching lines...) Expand 10 before | Expand all | Expand 10 after
344 bool success); 350 bool success);
345 351
346 // Internal implementation of DoBrowserLaunch. Initially should be called with 352 // Internal implementation of DoBrowserLaunch. Initially should be called with
347 // |locale_pref_checked| set to false which will result in postponing browser 353 // |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 354 // 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. 355 // completed this method is called with |locale_pref_checked| set to true.
350 void DoBrowserLaunchInternal(Profile* profile, 356 void DoBrowserLaunchInternal(Profile* profile,
351 LoginDisplayHost* login_host, 357 LoginDisplayHost* login_host,
352 bool locale_pref_checked); 358 bool locale_pref_checked);
353 359
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( 360 static void RunCallbackOnLocaleLoaded(
359 const base::Closure& callback, 361 const base::Closure& callback,
360 InputEventsBlocker* input_events_blocker, 362 InputEventsBlocker* input_events_blocker,
361 const locale_util::LanguageSwitchResult& result); 363 const locale_util::LanguageSwitchResult& result);
362 364
363 // Test API methods. 365 // Test API methods.
364 366
365 // Injects |user_context| that will be used to create StubAuthenticator 367 // Injects |user_context| that will be used to create StubAuthenticator
366 // instance when CreateAuthenticator() is called. 368 // instance when CreateAuthenticator() is called.
367 void InjectStubUserContext(const UserContext& user_context); 369 void InjectStubUserContext(const UserContext& user_context);
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after
451 bool waiting_for_child_account_status_; 453 bool waiting_for_child_account_status_;
452 454
453 base::WeakPtrFactory<UserSessionManager> weak_factory_; 455 base::WeakPtrFactory<UserSessionManager> weak_factory_;
454 456
455 DISALLOW_COPY_AND_ASSIGN(UserSessionManager); 457 DISALLOW_COPY_AND_ASSIGN(UserSessionManager);
456 }; 458 };
457 459
458 } // namespace chromeos 460 } // namespace chromeos
459 461
460 #endif // CHROME_BROWSER_CHROMEOS_LOGIN_SESSION_USER_SESSION_MANAGER_H_ 462 #endif // CHROME_BROWSER_CHROMEOS_LOGIN_SESSION_USER_SESSION_MANAGER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698