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

Unified Diff: chrome/browser/chromeos/login/session/user_session_manager.cc

Issue 527353002: Fix crash on ChromeOS: ActiveUserChanged might happen before profile is created. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 3 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/chromeos/login/session/user_session_manager.cc
diff --git a/chrome/browser/chromeos/login/session/user_session_manager.cc b/chrome/browser/chromeos/login/session/user_session_manager.cc
index 3f25494a1ed3cd5371dda6e53b78d884df1257e4..dd33e3830b5e9cff299fb1ec3319f69cbb3f3fd6 100644
--- a/chrome/browser/chromeos/login/session/user_session_manager.cc
+++ b/chrome/browser/chromeos/login/session/user_session_manager.cc
@@ -651,6 +651,12 @@ void UserSessionManager::OnProfileCreated(const UserContext& user_context,
void UserSessionManager::InitProfilePreferences(
Profile* profile,
const UserContext& user_context) {
+ user_manager::User* user = ProfileHelper::Get()->GetUserByProfile(profile);
+ if (user->is_active()) {
+ input_method::InputMethodManager* manager =
+ input_method::InputMethodManager::Get();
+ manager->SetState(GetDefaultIMEState(profile));
+ }
if (user_manager::UserManager::Get()->IsCurrentUserNew()) {
SetFirstLoginPrefs(profile,
user_context.GetPublicSessionLocale(),
@@ -993,6 +999,11 @@ void UserSessionManager::NotifyPendingUserSessionsRestoreFinished() {
void UserSessionManager::ActiveUserChanged(
const user_manager::User* active_user) {
+ Profile* profile = ProfileHelper::Get()->GetProfileByUser(active_user);
+ // If profile has not yet been initialized, delay initialization of IME.
+ if (!profile)
+ return;
+
input_method::InputMethodManager* manager =
input_method::InputMethodManager::Get();
manager->SetState(
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698