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 #include "chrome/browser/chromeos/login/session/restore_after_crash_session_mana
ger_delegate.h" | 5 #include "chrome/browser/chromeos/login/session/restore_after_crash_session_mana
ger_delegate.h" |
6 | 6 |
7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
8 #include "chrome/browser/chrome_notification_types.h" | 8 #include "chrome/browser/chrome_notification_types.h" |
9 #include "chrome/browser/chromeos/login/session/user_session_manager.h" | 9 #include "chrome/browser/chromeos/login/session/user_session_manager.h" |
10 #include "chrome/browser/profiles/profile.h" | 10 #include "chrome/browser/profiles/profile.h" |
(...skipping 20 matching lines...) Expand all Loading... |
31 | 31 |
32 session_manager_->SetSessionState(session_manager::SESSION_STATE_ACTIVE); | 32 session_manager_->SetSessionState(session_manager::SESSION_STATE_ACTIVE); |
33 | 33 |
34 // TODO(nkostylev): Identify tests that do not set this kLoginUser flag but | 34 // TODO(nkostylev): Identify tests that do not set this kLoginUser flag but |
35 // still rely on "stub user" session. Keeping existing behavior to avoid | 35 // still rely on "stub user" session. Keeping existing behavior to avoid |
36 // breaking tests. | 36 // breaking tests. |
37 if (command_line->HasSwitch(chromeos::switches::kLoginUser)) { | 37 if (command_line->HasSwitch(chromeos::switches::kLoginUser)) { |
38 // This is done in SessionManager::OnProfileCreated during normal login. | 38 // This is done in SessionManager::OnProfileCreated during normal login. |
39 UserSessionManager* user_session_mgr = UserSessionManager::GetInstance(); | 39 UserSessionManager* user_session_mgr = UserSessionManager::GetInstance(); |
40 user_session_mgr->InitRlz(profile()); | 40 user_session_mgr->InitRlz(profile()); |
41 user_session_mgr->InitializeCerts(profile()); | |
42 | 41 |
43 // Send the PROFILE_PREPARED notification and call SessionStarted() | 42 // Send the PROFILE_PREPARED notification and call SessionStarted() |
44 // so that the Launcher and other Profile dependent classes are created. | 43 // so that the Launcher and other Profile dependent classes are created. |
45 content::NotificationService::current()->Notify( | 44 content::NotificationService::current()->Notify( |
46 chrome::NOTIFICATION_LOGIN_USER_PROFILE_PREPARED, | 45 chrome::NOTIFICATION_LOGIN_USER_PROFILE_PREPARED, |
47 content::NotificationService::AllSources(), | 46 content::NotificationService::AllSources(), |
48 content::Details<Profile>(profile())); | 47 content::Details<Profile>(profile())); |
49 | 48 |
50 // This call will set session state to SESSION_STATE_ACTIVE (same one). | 49 // This call will set session state to SESSION_STATE_ACTIVE (same one). |
51 user_manager::UserManager::Get()->SessionStarted(); | 50 user_manager::UserManager::Get()->SessionStarted(); |
(...skipping 12 matching lines...) Expand all Loading... |
64 if (chromeos::CrasAudioHandler::IsInitialized()) | 63 if (chromeos::CrasAudioHandler::IsInitialized()) |
65 chromeos::CrasAudioHandler::Get()->LogErrors(); | 64 chromeos::CrasAudioHandler::Get()->LogErrors(); |
66 | 65 |
67 // We did not log in (we crashed or are debugging), so we need to | 66 // We did not log in (we crashed or are debugging), so we need to |
68 // restore Sync. | 67 // restore Sync. |
69 UserSessionManager::GetInstance()->RestoreAuthenticationSession(profile()); | 68 UserSessionManager::GetInstance()->RestoreAuthenticationSession(profile()); |
70 } | 69 } |
71 } | 70 } |
72 | 71 |
73 } // namespace chromeos | 72 } // namespace chromeos |
OLD | NEW |