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

Unified Diff: components/arc/arc_util.cc

Issue 2926893002: arc: Start ARC for Public Session users.
Patch Set: Update unit tests. Created 3 years, 6 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: components/arc/arc_util.cc
diff --git a/components/arc/arc_util.cc b/components/arc/arc_util.cc
index 58133783c34f9ad075aba2bcb54fe94445592a1e..ab3faedc9a8a11b949b0d2b717ddecb9e996da95 100644
--- a/components/arc/arc_util.cc
+++ b/components/arc/arc_util.cc
@@ -106,6 +106,11 @@ bool IsArcKioskMode() {
user_manager::UserManager::Get()->IsLoggedInAsArcKioskApp();
}
+bool IsPublicSessionMode() {
+ return user_manager::UserManager::IsInitialized() &&
+ user_manager::UserManager::Get()->IsLoggedInAsPublicAccount();
+}
+
bool IsArcAllowedForUser(const user_manager::User* user) {
if (!user) {
VLOG(1) << "No ARC for nullptr user.";
@@ -116,23 +121,18 @@ bool IsArcAllowedForUser(const user_manager::User* user) {
// - Users have Gaia accounts;
// - Active directory users;
// - ARC kiosk session;
+ // - Public Session users;
// USER_TYPE_ARC_KIOSK_APP check is compatible with IsArcKioskMode()
// above because ARC kiosk user is always the primary/active user of a
- // user session.
+ // user session. The same for USER_TYPE_PUBLIC_ACCOUNT.
if (!user->HasGaiaAccount() && !user->IsActiveDirectoryUser() &&
- user->GetType() != user_manager::USER_TYPE_ARC_KIOSK_APP) {
+ user->GetType() != user_manager::USER_TYPE_ARC_KIOSK_APP &&
+ user->GetType() != user_manager::USER_TYPE_PUBLIC_ACCOUNT) {
VLOG(1) << "Users without GAIA or AD accounts, or not ARC kiosk apps are "
"not supported in ARC.";
return false;
}
- // Do not allow for ephemeral data user. cf) b/26402681
- if (user_manager::UserManager::Get()->IsUserCryptohomeDataEphemeral(
- user->GetAccountId())) {
- VLOG(1) << "Users with ephemeral data are not supported in ARC.";
- return false;
- }
-
return true;
}

Powered by Google App Engine
This is Rietveld 408576698