| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "chrome/browser/chromeos/login/users/chrome_user_manager_impl.h" | 5 #include "chrome/browser/chromeos/login/users/chrome_user_manager_impl.h" |
| 6 | 6 |
| 7 #include <cstddef> | 7 #include <cstddef> |
| 8 #include <set> | 8 #include <set> |
| 9 | 9 |
| 10 #include "ash/multi_profile_uma.h" | 10 #include "ash/multi_profile_uma.h" |
| (...skipping 174 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 185 return ui->second.get(); | 185 return ui->second.get(); |
| 186 linked_ptr<UserImageManagerImpl> mgr(new UserImageManagerImpl(user_id, this)); | 186 linked_ptr<UserImageManagerImpl> mgr(new UserImageManagerImpl(user_id, this)); |
| 187 user_image_managers_[user_id] = mgr; | 187 user_image_managers_[user_id] = mgr; |
| 188 return mgr.get(); | 188 return mgr.get(); |
| 189 } | 189 } |
| 190 | 190 |
| 191 SupervisedUserManager* ChromeUserManagerImpl::GetSupervisedUserManager() { | 191 SupervisedUserManager* ChromeUserManagerImpl::GetSupervisedUserManager() { |
| 192 return supervised_user_manager_.get(); | 192 return supervised_user_manager_.get(); |
| 193 } | 193 } |
| 194 | 194 |
| 195 user_manager::UserList ChromeUserManagerImpl::GetUsersAdmittedForMultiProfile() | 195 user_manager::UserList ChromeUserManagerImpl::GetUsersAllowedForMultiProfile() |
| 196 const { | 196 const { |
| 197 // Supervised users are not allowed to use multi-profiles. | 197 // Supervised users are not allowed to use multi-profiles. |
| 198 if (GetLoggedInUsers().size() == 1 && | 198 if (GetLoggedInUsers().size() == 1 && |
| 199 GetPrimaryUser()->GetType() != user_manager::USER_TYPE_REGULAR) { | 199 GetPrimaryUser()->GetType() != user_manager::USER_TYPE_REGULAR) { |
| 200 return user_manager::UserList(); | 200 return user_manager::UserList(); |
| 201 } | 201 } |
| 202 | 202 |
| 203 user_manager::UserList result; | 203 user_manager::UserList result; |
| 204 const user_manager::UserList& users = GetUsers(); | 204 const user_manager::UserList& users = GetUsers(); |
| 205 for (user_manager::UserList::const_iterator it = users.begin(); | 205 for (user_manager::UserList::const_iterator it = users.begin(); |
| (...skipping 809 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1015 void ChromeUserManagerImpl::OnUserNotAllowed(const std::string& user_email) { | 1015 void ChromeUserManagerImpl::OnUserNotAllowed(const std::string& user_email) { |
| 1016 LOG(ERROR) << "Shutdown session because a user is not allowed to be in the " | 1016 LOG(ERROR) << "Shutdown session because a user is not allowed to be in the " |
| 1017 "current session"; | 1017 "current session"; |
| 1018 chromeos::ShowMultiprofilesSessionAbortedDialog(user_email); | 1018 chromeos::ShowMultiprofilesSessionAbortedDialog(user_email); |
| 1019 } | 1019 } |
| 1020 | 1020 |
| 1021 void ChromeUserManagerImpl::UpdateNumberOfUsers() { | 1021 void ChromeUserManagerImpl::UpdateNumberOfUsers() { |
| 1022 size_t users = GetLoggedInUsers().size(); | 1022 size_t users = GetLoggedInUsers().size(); |
| 1023 if (users) { | 1023 if (users) { |
| 1024 // Write the user number as UMA stat when a multi user session is possible. | 1024 // Write the user number as UMA stat when a multi user session is possible. |
| 1025 if ((users + GetUsersAdmittedForMultiProfile().size()) > 1) | 1025 if ((users + GetUsersAllowedForMultiProfile().size()) > 1) |
| 1026 ash::MultiProfileUMA::RecordUserCount(users); | 1026 ash::MultiProfileUMA::RecordUserCount(users); |
| 1027 } | 1027 } |
| 1028 | 1028 |
| 1029 base::debug::SetCrashKeyValue( | 1029 base::debug::SetCrashKeyValue( |
| 1030 crash_keys::kNumberOfUsers, | 1030 crash_keys::kNumberOfUsers, |
| 1031 base::StringPrintf("%" PRIuS, GetLoggedInUsers().size())); | 1031 base::StringPrintf("%" PRIuS, GetLoggedInUsers().size())); |
| 1032 } | 1032 } |
| 1033 | 1033 |
| 1034 } // namespace chromeos | 1034 } // namespace chromeos |
| OLD | NEW |