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/chrome_session_manager.h" | 5 #include "chrome/browser/chromeos/login/session/chrome_session_manager.h" |
6 | 6 |
7 #include <memory> | 7 #include <memory> |
8 | 8 |
9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
10 #include "base/logging.h" | 10 #include "base/logging.h" |
(...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
127 session_manager::SessionManager::Get()->SessionStarted(); | 127 session_manager::SessionManager::Get()->SessionStarted(); |
128 | 128 |
129 // Now is the good time to retrieve other logged in users for this session. | 129 // Now is the good time to retrieve other logged in users for this session. |
130 // First user has been already marked as logged in and active in | 130 // First user has been already marked as logged in and active in |
131 // PreProfileInit(). Restore sessions for other users in the background. | 131 // PreProfileInit(). Restore sessions for other users in the background. |
132 user_session_mgr->RestoreActiveSessions(); | 132 user_session_mgr->RestoreActiveSessions(); |
133 } | 133 } |
134 | 134 |
135 bool is_running_test = command_line->HasSwitch(::switches::kTestName) || | 135 bool is_running_test = command_line->HasSwitch(::switches::kTestName) || |
136 command_line->HasSwitch(::switches::kTestType); | 136 command_line->HasSwitch(::switches::kTestType); |
| 137 |
137 if (!is_running_test) { | 138 if (!is_running_test) { |
138 // Enable CrasAudioHandler logging when chrome restarts after crashing. | 139 // Enable CrasAudioHandler logging when chrome restarts after crashing. |
139 if (chromeos::CrasAudioHandler::IsInitialized()) | 140 if (chromeos::CrasAudioHandler::IsInitialized()) |
140 chromeos::CrasAudioHandler::Get()->LogErrors(); | 141 chromeos::CrasAudioHandler::Get()->LogErrors(); |
141 | 142 |
142 // We did not log in (we crashed or are debugging), so we need to | 143 // We did not log in (we crashed or are debugging), so we need to |
143 // restore Sync. | 144 // restore Sync. |
144 UserSessionManager::GetInstance()->RestoreAuthenticationSession( | 145 UserSessionManager::GetInstance()->RestoreAuthenticationSession( |
145 user_profile); | 146 user_profile); |
146 } | 147 } |
(...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
244 const std::string& user_id_hash, | 245 const std::string& user_id_hash, |
245 bool browser_restart) { | 246 bool browser_restart) { |
246 BootTimesRecorder* btl = BootTimesRecorder::Get(); | 247 BootTimesRecorder* btl = BootTimesRecorder::Get(); |
247 btl->AddLoginTimeMarker("UserLoggedIn-Start", false); | 248 btl->AddLoginTimeMarker("UserLoggedIn-Start", false); |
248 session_manager::SessionManager::NotifyUserLoggedIn( | 249 session_manager::SessionManager::NotifyUserLoggedIn( |
249 user_account_id, user_id_hash, browser_restart); | 250 user_account_id, user_id_hash, browser_restart); |
250 btl->AddLoginTimeMarker("UserLoggedIn-End", false); | 251 btl->AddLoginTimeMarker("UserLoggedIn-End", false); |
251 } | 252 } |
252 | 253 |
253 } // namespace chromeos | 254 } // namespace chromeos |
OLD | NEW |