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

Unified Diff: ash/session/session_controller.cc

Issue 2829813002: cros: Move IsUserSupervised and IsUserChild off SystemTrayDelegate (Closed)
Patch Set: review comments Created 3 years, 8 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
« no previous file with comments | « ash/session/session_controller.h ('k') | ash/session/session_controller_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ash/session/session_controller.cc
diff --git a/ash/session/session_controller.cc b/ash/session/session_controller.cc
index b546c92beb460d343e225adc25238ff112ea1449..873f5776316b3a1ef2e1b3e26da39876dad18853 100644
--- a/ash/session/session_controller.cc
+++ b/ash/session/session_controller.cc
@@ -14,6 +14,7 @@
#include "base/command_line.h"
#include "chromeos/chromeos_switches.h"
#include "components/signin/core/account_id/account_id.h"
+#include "components/user_manager/user_type.h"
#include "services/service_manager/public/cpp/connector.h"
using session_manager::SessionState;
@@ -126,6 +127,23 @@ const mojom::UserSession* SessionController::GetUserSession(
return user_sessions_[index].get();
}
+bool SessionController::IsUserSupervised() const {
+ if (!IsActiveUserSessionStarted())
+ return false;
+
+ user_manager::UserType active_user_type = GetUserSession(0)->type;
+ return active_user_type == user_manager::USER_TYPE_SUPERVISED ||
+ active_user_type == user_manager::USER_TYPE_CHILD;
+}
+
+bool SessionController::IsUserChild() const {
+ if (!IsActiveUserSessionStarted())
+ return false;
+
+ user_manager::UserType active_user_type = GetUserSession(0)->type;
+ return active_user_type == user_manager::USER_TYPE_CHILD;
+}
+
void SessionController::LockScreen() {
if (client_)
client_->RequestLockScreen();
« no previous file with comments | « ash/session/session_controller.h ('k') | ash/session/session_controller_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698