| 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 222 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 233 | 233 |
| 234 UserImageManager* UserManagerImpl::GetUserImageManager() { | 234 UserImageManager* UserManagerImpl::GetUserImageManager() { |
| 235 return user_image_manager_.get(); | 235 return user_image_manager_.get(); |
| 236 } | 236 } |
| 237 | 237 |
| 238 const UserList& UserManagerImpl::GetUsers() const { | 238 const UserList& UserManagerImpl::GetUsers() const { |
| 239 const_cast<UserManagerImpl*>(this)->EnsureUsersLoaded(); | 239 const_cast<UserManagerImpl*>(this)->EnsureUsersLoaded(); |
| 240 return users_; | 240 return users_; |
| 241 } | 241 } |
| 242 | 242 |
| 243 UserList UserManagerImpl::GetUsersAdmittedForMultiProfile() const { |
| 244 UserList result; |
| 245 const UserList& users = GetUsers(); |
| 246 for (UserList::const_iterator it = users.begin(); it != users.end(); ++it) { |
| 247 if ((*it)->GetType() == User::USER_TYPE_REGULAR && !(*it)->is_logged_in()) |
| 248 result.push_back(*it); |
| 249 } |
| 250 return result; |
| 251 } |
| 252 |
| 243 const UserList& UserManagerImpl::GetLoggedInUsers() const { | 253 const UserList& UserManagerImpl::GetLoggedInUsers() const { |
| 244 return logged_in_users_; | 254 return logged_in_users_; |
| 245 } | 255 } |
| 246 | 256 |
| 247 const UserList& UserManagerImpl::GetLRULoggedInUsers() { | 257 const UserList& UserManagerImpl::GetLRULoggedInUsers() { |
| 248 // If there is no user logged in, we return the active user as the only one. | 258 // If there is no user logged in, we return the active user as the only one. |
| 249 if (lru_logged_in_users_.empty() && active_user_) { | 259 if (lru_logged_in_users_.empty() && active_user_) { |
| 250 temp_single_logged_in_users_.clear(); | 260 temp_single_logged_in_users_.clear(); |
| 251 temp_single_logged_in_users_.insert(temp_single_logged_in_users_.begin(), | 261 temp_single_logged_in_users_.insert(temp_single_logged_in_users_.begin(), |
| 252 active_user_); | 262 active_user_); |
| (...skipping 1295 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1548 // TODO(nkostylev): Restore all user sessions (in the background). | 1558 // TODO(nkostylev): Restore all user sessions (in the background). |
| 1549 // This requires first refactoring this flow out of LoginUtils. | 1559 // This requires first refactoring this flow out of LoginUtils. |
| 1550 // 1. UserManager::UserLoggedIn() | 1560 // 1. UserManager::UserLoggedIn() |
| 1551 // 2. InitSessionRestoreStrategy() (OAuth) | 1561 // 2. InitSessionRestoreStrategy() (OAuth) |
| 1552 // 2. ProfileManager::CreateDefaultProfileAsync() | 1562 // 2. ProfileManager::CreateDefaultProfileAsync() |
| 1553 // 3. InitProfilePreferences | 1563 // 3. InitProfilePreferences |
| 1554 // 4. chrome::NOTIFICATION_LOGIN_USER_PROFILE_PREPARED | 1564 // 4. chrome::NOTIFICATION_LOGIN_USER_PROFILE_PREPARED |
| 1555 } | 1565 } |
| 1556 | 1566 |
| 1557 } // namespace chromeos | 1567 } // namespace chromeos |
| OLD | NEW |