| OLD | NEW |
| 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 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/user_manager_impl.h" | 5 #include "chrome/browser/chromeos/login/user_manager_impl.h" |
| 6 | 6 |
| 7 #include <cstddef> | 7 #include <cstddef> |
| 8 #include <set> | 8 #include <set> |
| 9 | 9 |
| 10 #include "ash/shell.h" | 10 #include "ash/shell.h" |
| (...skipping 224 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 235 | 235 |
| 236 UserImageManager* UserManagerImpl::GetUserImageManager() { | 236 UserImageManager* UserManagerImpl::GetUserImageManager() { |
| 237 return user_image_manager_.get(); | 237 return user_image_manager_.get(); |
| 238 } | 238 } |
| 239 | 239 |
| 240 const UserList& UserManagerImpl::GetUsers() const { | 240 const UserList& UserManagerImpl::GetUsers() const { |
| 241 const_cast<UserManagerImpl*>(this)->EnsureUsersLoaded(); | 241 const_cast<UserManagerImpl*>(this)->EnsureUsersLoaded(); |
| 242 return users_; | 242 return users_; |
| 243 } | 243 } |
| 244 | 244 |
| 245 UserList UserManagerImpl::GetUsersAdmittedForMultiProfile() const { |
| 246 UserList result; |
| 247 const UserList& users = GetUsers(); |
| 248 for (UserList::const_iterator it = users.begin(); it != users.end(); ++it) { |
| 249 if ((*it)->GetType() == User::USER_TYPE_REGULAR && !(*it)->is_logged_in()) |
| 250 result.push_back(*it); |
| 251 } |
| 252 return result; |
| 253 } |
| 254 |
| 245 const UserList& UserManagerImpl::GetLoggedInUsers() const { | 255 const UserList& UserManagerImpl::GetLoggedInUsers() const { |
| 246 return logged_in_users_; | 256 return logged_in_users_; |
| 247 } | 257 } |
| 248 | 258 |
| 249 const UserList& UserManagerImpl::GetLRULoggedInUsers() { | 259 const UserList& UserManagerImpl::GetLRULoggedInUsers() { |
| 250 // If there is no user logged in, we return the active user as the only one. | 260 // If there is no user logged in, we return the active user as the only one. |
| 251 if (lru_logged_in_users_.empty() && active_user_) { | 261 if (lru_logged_in_users_.empty() && active_user_) { |
| 252 temp_single_logged_in_users_.clear(); | 262 temp_single_logged_in_users_.clear(); |
| 253 temp_single_logged_in_users_.insert(temp_single_logged_in_users_.begin(), | 263 temp_single_logged_in_users_.insert(temp_single_logged_in_users_.begin(), |
| 254 active_user_); | 264 active_user_); |
| (...skipping 1386 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1641 false, // using_oauth | 1651 false, // using_oauth |
| 1642 false, // has_cookies | 1652 false, // has_cookies |
| 1643 true, // has_active_session | 1653 true, // has_active_session |
| 1644 this); | 1654 this); |
| 1645 } else { | 1655 } else { |
| 1646 RestorePendingUserSessions(); | 1656 RestorePendingUserSessions(); |
| 1647 } | 1657 } |
| 1648 } | 1658 } |
| 1649 | 1659 |
| 1650 } // namespace chromeos | 1660 } // namespace chromeos |
| OLD | NEW |