| 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/user_session_manager.h" | 5 #include "chrome/browser/chromeos/login/session/user_session_manager.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 | 8 |
| 9 #include <set> | 9 #include <set> |
| 10 #include <string> | 10 #include <string> |
| (...skipping 20 matching lines...) Expand all Loading... |
| 31 #include "chrome/browser/browser_shutdown.h" | 31 #include "chrome/browser/browser_shutdown.h" |
| 32 #include "chrome/browser/chrome_notification_types.h" | 32 #include "chrome/browser/chrome_notification_types.h" |
| 33 #include "chrome/browser/chromeos/arc/arc_migration_guide_notification.h" | 33 #include "chrome/browser/chromeos/arc/arc_migration_guide_notification.h" |
| 34 #include "chrome/browser/chromeos/arc/arc_service_launcher.h" | 34 #include "chrome/browser/chromeos/arc/arc_service_launcher.h" |
| 35 #include "chrome/browser/chromeos/arc/arc_util.h" | 35 #include "chrome/browser/chromeos/arc/arc_util.h" |
| 36 #include "chrome/browser/chromeos/base/locale_util.h" | 36 #include "chrome/browser/chromeos/base/locale_util.h" |
| 37 #include "chrome/browser/chromeos/boot_times_recorder.h" | 37 #include "chrome/browser/chromeos/boot_times_recorder.h" |
| 38 #include "chrome/browser/chromeos/first_run/first_run.h" | 38 #include "chrome/browser/chromeos/first_run/first_run.h" |
| 39 #include "chrome/browser/chromeos/first_run/goodies_displayer.h" | 39 #include "chrome/browser/chromeos/first_run/goodies_displayer.h" |
| 40 #include "chrome/browser/chromeos/input_method/input_method_util.h" | 40 #include "chrome/browser/chromeos/input_method/input_method_util.h" |
| 41 #include "chrome/browser/chromeos/logging.h" |
| 41 #include "chrome/browser/chromeos/login/auth/chrome_cryptohome_authenticator.h" | 42 #include "chrome/browser/chromeos/login/auth/chrome_cryptohome_authenticator.h" |
| 42 #include "chrome/browser/chromeos/login/chrome_restart_request.h" | 43 #include "chrome/browser/chromeos/login/chrome_restart_request.h" |
| 43 #include "chrome/browser/chromeos/login/demo_mode/demo_app_launcher.h" | 44 #include "chrome/browser/chromeos/login/demo_mode/demo_app_launcher.h" |
| 44 #include "chrome/browser/chromeos/login/easy_unlock/easy_unlock_key_manager.h" | 45 #include "chrome/browser/chromeos/login/easy_unlock/easy_unlock_key_manager.h" |
| 45 #include "chrome/browser/chromeos/login/existing_user_controller.h" | 46 #include "chrome/browser/chromeos/login/existing_user_controller.h" |
| 46 #include "chrome/browser/chromeos/login/helper.h" | 47 #include "chrome/browser/chromeos/login/helper.h" |
| 47 #include "chrome/browser/chromeos/login/lock/screen_locker.h" | 48 #include "chrome/browser/chromeos/login/lock/screen_locker.h" |
| 48 #include "chrome/browser/chromeos/login/profile_auth_data.h" | 49 #include "chrome/browser/chromeos/login/profile_auth_data.h" |
| 49 #include "chrome/browser/chromeos/login/saml/saml_offline_signin_limiter.h" | 50 #include "chrome/browser/chromeos/login/saml/saml_offline_signin_limiter.h" |
| 50 #include "chrome/browser/chromeos/login/saml/saml_offline_signin_limiter_factory
.h" | 51 #include "chrome/browser/chromeos/login/saml/saml_offline_signin_limiter_factory
.h" |
| (...skipping 921 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 972 user_context_ = user_context; | 973 user_context_ = user_context; |
| 973 has_auth_cookies_ = has_auth_cookies; | 974 has_auth_cookies_ = has_auth_cookies; |
| 974 InitSessionRestoreStrategy(); | 975 InitSessionRestoreStrategy(); |
| 975 StoreUserContextDataBeforeProfileIsCreated(); | 976 StoreUserContextDataBeforeProfileIsCreated(); |
| 976 session_manager::SessionManager::Get()->CreateSession( | 977 session_manager::SessionManager::Get()->CreateSession( |
| 977 user_context_.GetAccountId(), user_context_.GetUserIDHash()); | 978 user_context_.GetAccountId(), user_context_.GetUserIDHash()); |
| 978 } | 979 } |
| 979 | 980 |
| 980 void UserSessionManager::PreStartSession() { | 981 void UserSessionManager::PreStartSession() { |
| 981 // Switch log file as soon as possible. | 982 // Switch log file as soon as possible. |
| 982 if (base::SysInfo::IsRunningOnChromeOS()) | 983 if (base::SysInfo::IsRunningOnChromeOS()) { |
| 983 logging::RedirectChromeLogging(*(base::CommandLine::ForCurrentProcess())); | 984 base::PostTaskWithTraits( |
| 985 FROM_HERE, {base::MayBlock()}, |
| 986 base::Bind(&logging::RedirectChromeLogging, |
| 987 *base::CommandLine::ForCurrentProcess())); |
| 988 } |
| 984 } | 989 } |
| 985 | 990 |
| 986 void UserSessionManager::StoreUserContextDataBeforeProfileIsCreated() { | 991 void UserSessionManager::StoreUserContextDataBeforeProfileIsCreated() { |
| 987 user_manager::known_user::UpdateId(user_context_.GetAccountId()); | 992 user_manager::known_user::UpdateId(user_context_.GetAccountId()); |
| 988 } | 993 } |
| 989 | 994 |
| 990 void UserSessionManager::StartCrosSession() { | 995 void UserSessionManager::StartCrosSession() { |
| 991 BootTimesRecorder* btl = BootTimesRecorder::Get(); | 996 BootTimesRecorder* btl = BootTimesRecorder::Get(); |
| 992 btl->AddLoginTimeMarker("StartSession-Start", false); | 997 btl->AddLoginTimeMarker("StartSession-Start", false); |
| 993 DBusThreadManager::Get()->GetSessionManagerClient()->StartSession( | 998 DBusThreadManager::Get()->GetSessionManagerClient()->StartSession( |
| (...skipping 964 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1958 ->browser_policy_connector_chromeos() | 1963 ->browser_policy_connector_chromeos() |
| 1959 ->IsEnterpriseManaged()) { | 1964 ->IsEnterpriseManaged()) { |
| 1960 return false; | 1965 return false; |
| 1961 } | 1966 } |
| 1962 | 1967 |
| 1963 // Do not show end of life notification if this is a guest session | 1968 // Do not show end of life notification if this is a guest session |
| 1964 return !profile->IsGuestSession(); | 1969 return !profile->IsGuestSession(); |
| 1965 } | 1970 } |
| 1966 | 1971 |
| 1967 } // namespace chromeos | 1972 } // namespace chromeos |
| OLD | NEW |