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 ee35d78a77e71727709f23c5b682a84824182130..e49ad0a69711315021abd7d8559bd85d62eb7320 100644 |
| --- a/chrome/browser/chromeos/login/session/user_session_manager.cc |
| +++ b/chrome/browser/chromeos/login/session/user_session_manager.cc |
| @@ -113,6 +113,7 @@ |
| #include "content/public/browser/notification_service.h" |
| #include "content/public/browser/storage_partition.h" |
| #include "content/public/common/content_switches.h" |
| +#include "extensions/common/features/feature_session_type.h" |
| #include "net/cert/sth_distributor.h" |
| #include "rlz/features/features.h" |
| #include "ui/base/ime/chromeos/input_method_descriptor.h" |
| @@ -506,6 +507,8 @@ void UserSessionManager::PerformPostUserLoggedInActions() { |
| network_portal_detector::GetInstance()->SetStrategy( |
| PortalDetectorStrategy::STRATEGY_ID_SESSION); |
| } |
| + |
| + InitNonKioskExtensionFeaturesSessionType(user_manager->GetPrimaryUser()); |
| } |
| } |
| @@ -574,6 +577,31 @@ void UserSessionManager::InitRlz(Profile* profile) { |
| #endif |
| } |
| +void UserSessionManager::InitNonKioskExtensionFeaturesSessionType( |
| + const user_manager::User* user) { |
| + // Kiosk session should be set as part of kiosk user session initialization |
| + // in normal circumstances (to be able to properly determine whether kiosk |
| + // was auto-launched); in case of user session restore, feature session |
| + // type has be set before kiosk app controller takes over, as at that point |
| + // kiosk app profile would alredy be initialized - feature session type should |
|
achuithb
2017/01/04 23:25:30
already
tbarzic
2017/01/04 23:39:48
Done.
|
| + // 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)) { |
| + extensions::SetCurrentFeatureSessionType( |
| + extensions::FeatureSessionType::KIOSK); |
| + } |
| + return; |
| + } |
| + |
| + extensions::SetCurrentFeatureSessionType( |
| + user->HasGaiaAccount() ? extensions::FeatureSessionType::REGULAR |
| + : extensions::FeatureSessionType::UNKNOWN); |
| +} |
| + |
| void UserSessionManager::SetFirstLoginPrefs( |
| Profile* profile, |
| const std::string& public_session_locale, |