Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(3849)

Unified Diff: chrome/browser/chromeos/login/session/user_session_manager.cc

Issue 2601803003: Introduce kiosk.autolaunched feature session type (Closed)
Patch Set: . Created 3 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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 f8a60b7f09d073642d7d35f2785ae3f5f4db8c76..bd509844daf12c690d031873779fa1190a00cc8c 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 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)) {
+ 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,

Powered by Google App Engine
This is Rietveld 408576698