Commit 6f8f4132 authored by Kamila Śledź's avatar Kamila Śledź Committed by Commit Bot

Add visible account pods for SAML public accounts on login screen.

SAML public account user type was merged into regular public account user type, which allows SAML public session pods to be shown on the login screen the same way as regular public session pods.

Bug: 876287
Change-Id: Ib1e969b9b66efa5ae166aaec58fb94d2bb8c1a13
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1710323
Commit-Queue: Kamila Śledź <kamilasledz@google.com>
Reviewed-by: default avatarAlexander Alekseev <alemate@chromium.org>
Reviewed-by: default avatarRoman Sorokin [CET] <rsorokin@chromium.org>
Cr-Commit-Position: refs/heads/master@{#682625}
parent bdb30701
......@@ -750,7 +750,8 @@ void ChromeUserManagerImpl::LoadDeviceLocalAccounts(
users_.push_back(
CreateUserFromDeviceLocalAccount(account_id, type).release());
if (type == policy::DeviceLocalAccount::TYPE_PUBLIC_SESSION)
if (type == policy::DeviceLocalAccount::TYPE_PUBLIC_SESSION ||
type == policy::DeviceLocalAccount::TYPE_SAML_PUBLIC_SESSION)
UpdatePublicAccountDisplayName(account_id.GetUserEmail());
}
}
......@@ -1205,7 +1206,8 @@ bool ChromeUserManagerImpl::UpdateAndCleanUpDeviceLocalAccounts(
AccountId::FromUserEmail(it->user_id), it->type)
.release());
}
if (it->type == policy::DeviceLocalAccount::TYPE_PUBLIC_SESSION) {
if (it->type == policy::DeviceLocalAccount::TYPE_PUBLIC_SESSION ||
it->type == policy::DeviceLocalAccount::TYPE_SAML_PUBLIC_SESSION) {
UpdatePublicAccountDisplayName(it->user_id);
}
}
......@@ -1547,6 +1549,10 @@ ChromeUserManagerImpl::CreateUserFromDeviceLocalAccount(
case policy::DeviceLocalAccount::TYPE_PUBLIC_SESSION:
user.reset(user_manager::User::CreatePublicAccountUser(account_id));
break;
case policy::DeviceLocalAccount::TYPE_SAML_PUBLIC_SESSION:
user.reset(user_manager::User::CreatePublicAccountUser(
account_id, /*is_using_saml=*/true));
break;
case policy::DeviceLocalAccount::TYPE_KIOSK_APP:
user.reset(user_manager::User::CreateKioskAppUser(account_id));
break;
......
......@@ -242,6 +242,10 @@ std::vector<DeviceLocalAccount> GetDeviceLocalAccounts(
accounts.push_back(DeviceLocalAccount(
DeviceLocalAccount::TYPE_PUBLIC_SESSION, account_id, "", ""));
break;
case DeviceLocalAccount::TYPE_SAML_PUBLIC_SESSION:
accounts.push_back(DeviceLocalAccount(
DeviceLocalAccount::TYPE_SAML_PUBLIC_SESSION, account_id, "", ""));
break;
case DeviceLocalAccount::TYPE_KIOSK_APP: {
std::string kiosk_app_id;
std::string kiosk_app_update_url;
......@@ -292,7 +296,7 @@ std::vector<DeviceLocalAccount> GetDeviceLocalAccounts(
accounts.push_back(DeviceLocalAccount(arc_kiosk_app, account_id));
break;
}
case DeviceLocalAccount::TYPE_COUNT:
default:
NOTREACHED();
}
}
......
......@@ -28,7 +28,8 @@ DeviceLocalAccountExtensionTracker::DeviceLocalAccountExtensionTracker(
// This is easy: Just add a component for the app id.
PolicyNamespace ns(POLICY_DOMAIN_EXTENSIONS, account.kiosk_app_id);
schema_registry_->RegisterComponent(ns, Schema());
} else if (account.type == DeviceLocalAccount::TYPE_PUBLIC_SESSION) {
} else if (account.type == DeviceLocalAccount::TYPE_PUBLIC_SESSION ||
account.type == DeviceLocalAccount::TYPE_SAML_PUBLIC_SESSION) {
// For public sessions, track the value of the ExtensionInstallForcelist
// policy.
store_->AddObserver(this);
......
......@@ -309,8 +309,11 @@ User* User::CreateSupervisedUser(const AccountId& account_id) {
return new SupervisedUser(account_id);
}
User* User::CreatePublicAccountUser(const AccountId& account_id) {
return new PublicAccountUser(account_id);
User* User::CreatePublicAccountUser(const AccountId& account_id,
bool is_using_saml) {
User* user = new PublicAccountUser(account_id);
user->set_using_saml(is_using_saml);
return user;
}
void User::SetAccountLocale(const std::string& resolved_account_locale) {
......
......@@ -217,7 +217,8 @@ class USER_MANAGER_EXPORT User : public UserInfo {
static User* CreateKioskAppUser(const AccountId& kiosk_app_account_id);
static User* CreateArcKioskAppUser(const AccountId& arc_kiosk_account_id);
static User* CreateSupervisedUser(const AccountId& account_id);
static User* CreatePublicAccountUser(const AccountId& account_id);
static User* CreatePublicAccountUser(const AccountId& account_id,
bool is_using_saml = false);
const std::string* GetAccountLocale() const { return account_locale_.get(); }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment