Commit c21feee5 authored by rsorokin's avatar rsorokin Committed by Commit bot

Rename GetUsersAdmittedForMultiProfile to GetUsersAllowedForMultiProfile

BUG=397105

Review URL: https://codereview.chromium.org/600733004

Cr-Commit-Position: refs/heads/master@{#297400}
parent c9081e09
......@@ -584,7 +584,7 @@ void LoginDisplayHostImpl::StartUserAdding(
SetOobeProgressBarVisible(oobe_progress_bar_visible_ = false);
SetStatusAreaVisible(true);
sign_in_controller_->Init(
user_manager::UserManager::Get()->GetUsersAdmittedForMultiProfile());
user_manager::UserManager::Get()->GetUsersAllowedForMultiProfile());
CHECK(webui_login_display_);
GetOobeUI()->ShowSigninScreen(LoginScreenContext(),
webui_login_display_,
......
......@@ -192,7 +192,7 @@ SupervisedUserManager* ChromeUserManagerImpl::GetSupervisedUserManager() {
return supervised_user_manager_.get();
}
user_manager::UserList ChromeUserManagerImpl::GetUsersAdmittedForMultiProfile()
user_manager::UserList ChromeUserManagerImpl::GetUsersAllowedForMultiProfile()
const {
// Supervised users are not allowed to use multi-profiles.
if (GetLoggedInUsers().size() == 1 &&
......@@ -1028,7 +1028,7 @@ void ChromeUserManagerImpl::UpdateNumberOfUsers() {
size_t users = GetLoggedInUsers().size();
if (users) {
// Write the user number as UMA stat when a multi user session is possible.
if ((users + GetUsersAdmittedForMultiProfile().size()) > 1)
if ((users + GetUsersAllowedForMultiProfile().size()) > 1)
ash::MultiProfileUMA::RecordUserCount(users);
}
......
......@@ -76,7 +76,7 @@ class ChromeUserManagerImpl
// UserManager implementation:
virtual void Shutdown() OVERRIDE;
virtual user_manager::UserList GetUsersAdmittedForMultiProfile()
virtual user_manager::UserList GetUsersAllowedForMultiProfile()
const OVERRIDE;
virtual user_manager::UserList GetUnlockUsers() const OVERRIDE;
virtual void SessionStarted() OVERRIDE;
......
......@@ -101,8 +101,7 @@ const user_manager::UserList& FakeUserManager::GetUsers() const {
return user_list_;
}
user_manager::UserList FakeUserManager::GetUsersAdmittedForMultiProfile()
const {
user_manager::UserList FakeUserManager::GetUsersAllowedForMultiProfile() const {
user_manager::UserList result;
for (user_manager::UserList::const_iterator it = user_list_.begin();
it != user_list_.end();
......
......@@ -49,7 +49,7 @@ class FakeUserManager : public ChromeUserManager {
// UserManager overrides.
virtual const user_manager::UserList& GetUsers() const OVERRIDE;
virtual user_manager::UserList GetUsersAdmittedForMultiProfile()
virtual user_manager::UserList GetUsersAllowedForMultiProfile()
const OVERRIDE;
virtual const user_manager::UserList& GetLoggedInUsers() const OVERRIDE;
......
......@@ -26,7 +26,7 @@ class MockUserManager : public ChromeUserManager {
virtual ~MockUserManager();
MOCK_METHOD0(Shutdown, void(void));
MOCK_CONST_METHOD0(GetUsersAdmittedForMultiProfile,
MOCK_CONST_METHOD0(GetUsersAllowedForMultiProfile,
user_manager::UserList(void));
MOCK_CONST_METHOD0(GetLoggedInUsers, const user_manager::UserList&(void));
MOCK_CONST_METHOD0(GetLRULoggedInUsers, const user_manager::UserList&(void));
......
......@@ -40,7 +40,7 @@ bool AvatarMenuActionsChromeOS::ShouldShowAddNewProfileLink() const {
// |browser_| can be NULL in unit_tests.
return (!browser_ || !browser_->profile()->IsSupervised()) &&
user_manager::UserManager::Get()
->GetUsersAdmittedForMultiProfile()
->GetUsersAllowedForMultiProfile()
.size();
}
......
......@@ -50,9 +50,8 @@ bool ChromeShellDelegate::IsMultiProfilesEnabled() const {
// simultaneous users to allow this feature.
if (!user_manager::UserManager::IsInitialized())
return false;
size_t admitted_users_to_be_added = user_manager::UserManager::Get()
->GetUsersAdmittedForMultiProfile()
.size();
size_t admitted_users_to_be_added =
user_manager::UserManager::Get()->GetUsersAllowedForMultiProfile().size();
size_t logged_in_users =
user_manager::UserManager::Get()->GetLoggedInUsers().size();
if (!logged_in_users) {
......
......@@ -86,7 +86,7 @@ int SessionStateDelegateChromeos::NumberOfLoggedInUsers() const {
bool SessionStateDelegateChromeos::CanAddUserToMultiProfile(
AddUserError* error) const {
if (user_manager::UserManager::Get()
->GetUsersAdmittedForMultiProfile()
->GetUsersAllowedForMultiProfile()
.size() == 0) {
if (error)
*error = ADD_USER_ERROR_OUT_OF_USERS;
......
......@@ -560,7 +560,7 @@ void SystemTrayDelegateChromeOS::ShowUserLogin() {
// Launch sign in screen to add another user to current session.
if (user_manager::UserManager::Get()
->GetUsersAdmittedForMultiProfile()
->GetUsersAllowedForMultiProfile()
.size()) {
// Don't show dialog if any logged in user in multi-profiles session
// dismissed it.
......
......@@ -105,13 +105,13 @@ class USER_MANAGER_EXPORT UserManager {
// is sorted by last login date with the most recent user at the beginning.
virtual const UserList& GetUsers() const = 0;
// Returns list of users admitted for logging in into multi-profile session.
// Returns list of users allowed for logging in into multi-profile session.
// Users that have a policy that prevents them from being added to the
// multi-profile session will still be part of this list as long as they
// are regular users (i.e. not a public session/supervised etc.).
// Returns an empty list in case when primary user is not a regular one or
// has a policy that prohibids it to be part of multi-profile session.
virtual UserList GetUsersAdmittedForMultiProfile() const = 0;
virtual UserList GetUsersAllowedForMultiProfile() const = 0;
// Returns a list of users who are currently logged in.
virtual const UserList& GetLoggedInUsers() const = 0;
......
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