Chromium Code Reviews| 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 fe16fe3ab9274e7c0633d98897f129067ed9759a..c3b3f886b3d683caa059037d283cc640ee6f25a0 100644 |
| --- a/chrome/browser/chromeos/login/session/user_session_manager.cc |
| +++ b/chrome/browser/chromeos/login/session/user_session_manager.cc |
| @@ -581,14 +581,18 @@ void UserSessionManager::InitNonKioskExtensionFeaturesSessionType( |
| // type has be set before kiosk app controller takes over, as at that point |
| // kiosk app profile would already be initialized - feature session type |
| // should be set before that. |
| - // TODO(tbarzic): Note that this does not work well for auto-launched |
| - // sessions, as information about whether session was auto-launched is not |
| - // persisted over session restart - http://crbug.com/677340. |
| if (user->GetType() == user_manager::USER_TYPE_KIOSK_APP) { |
| if (base::CommandLine::ForCurrentProcess()->HasSwitch( |
| switches::kLoginUser)) { |
| + // For kiosk session crash recovery, feature session type has be set |
| + // before kiosk app controller takes over, as at that point iosk app |
| + // profile would already be initialized - feature session type |
| + // should be set before that. |
| + bool autolaunched = base::CommandLine::ForCurrentProcess()->HasSwitch( |
|
xiyuan
2017/01/25 21:06:43
nit: autolaunched -> auto_launched
tbarzic
2017/01/25 21:33:43
Done.
|
| + switches::kAppAutoLaunched); |
| extensions::SetCurrentFeatureSessionType( |
| - extensions::FeatureSessionType::KIOSK); |
| + autolaunched ? extensions::FeatureSessionType::AUTOLAUNCHED_KIOSK |
| + : extensions::FeatureSessionType::KIOSK); |
| } |
| return; |
| } |