| 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 94406b4049edf6560e3a4b34d2339b24f923842d..ccdb0c901df525d035cc81baf8df56545f16281a 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
|
| + // 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,
|
|
|