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 "base/bind.h" | 10 #include "base/bind.h" |
(...skipping 341 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
352 User* user = FindUserInListAndModify(email); | 352 User* user = FindUserInListAndModify(email); |
353 if (active_user_ && user) { | 353 if (active_user_ && user) { |
354 user->set_is_logged_in(true); | 354 user->set_is_logged_in(true); |
355 user->set_username_hash(username_hash); | 355 user->set_username_hash(username_hash); |
356 logged_in_users_.push_back(user); | 356 logged_in_users_.push_back(user); |
357 lru_logged_in_users_.push_back(user); | 357 lru_logged_in_users_.push_back(user); |
358 // Reset the new user flag if the user already exists. | 358 // Reset the new user flag if the user already exists. |
359 is_current_user_new_ = false; | 359 is_current_user_new_ = false; |
360 // Set active user wallpaper back. | 360 // Set active user wallpaper back. |
361 WallpaperManager::Get()->SetUserWallpaper(active_user_->email()); | 361 WallpaperManager::Get()->SetUserWallpaper(active_user_->email()); |
| 362 NotifyUserAddedToSession(user); |
362 return; | 363 return; |
363 } | 364 } |
364 | 365 |
365 policy::DeviceLocalAccount::Type device_local_account_type; | 366 policy::DeviceLocalAccount::Type device_local_account_type; |
366 if (email == UserManager::kGuestUserName) { | 367 if (email == UserManager::kGuestUserName) { |
367 GuestUserLoggedIn(); | 368 GuestUserLoggedIn(); |
368 } else if (email == UserManager::kRetailModeUserName) { | 369 } else if (email == UserManager::kRetailModeUserName) { |
369 RetailModeUserLoggedIn(); | 370 RetailModeUserLoggedIn(); |
370 } else if (policy::IsDeviceLocalAccountUser(email, | 371 } else if (policy::IsDeviceLocalAccountUser(email, |
371 &device_local_account_type) && | 372 &device_local_account_type) && |
(...skipping 1485 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1857 content::NotificationService::NoDetails()); | 1858 content::NotificationService::NoDetails()); |
1858 } | 1859 } |
1859 | 1860 |
1860 void UserManagerImpl::NotifyActiveUserChanged(const User* active_user) { | 1861 void UserManagerImpl::NotifyActiveUserChanged(const User* active_user) { |
1861 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); | 1862 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
1862 FOR_EACH_OBSERVER(UserManager::UserSessionStateObserver, | 1863 FOR_EACH_OBSERVER(UserManager::UserSessionStateObserver, |
1863 session_state_observer_list_, | 1864 session_state_observer_list_, |
1864 ActiveUserChanged(active_user)); | 1865 ActiveUserChanged(active_user)); |
1865 } | 1866 } |
1866 | 1867 |
| 1868 void UserManagerImpl::NotifyUserAddedToSession(const User* added_user) { |
| 1869 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
| 1870 FOR_EACH_OBSERVER(UserManager::UserSessionStateObserver, |
| 1871 session_state_observer_list_, |
| 1872 UserAddedToSession(added_user)); |
| 1873 } |
| 1874 |
1867 void UserManagerImpl::NotifyActiveUserHashChanged(const std::string& hash) { | 1875 void UserManagerImpl::NotifyActiveUserHashChanged(const std::string& hash) { |
1868 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); | 1876 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
1869 FOR_EACH_OBSERVER(UserManager::UserSessionStateObserver, | 1877 FOR_EACH_OBSERVER(UserManager::UserSessionStateObserver, |
1870 session_state_observer_list_, | 1878 session_state_observer_list_, |
1871 ActiveUserHashChanged(hash)); | 1879 ActiveUserHashChanged(hash)); |
1872 } | 1880 } |
1873 | 1881 |
1874 void UserManagerImpl::NotifyPendingUserSessionsRestoreFinished() { | 1882 void UserManagerImpl::NotifyPendingUserSessionsRestoreFinished() { |
1875 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); | 1883 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
1876 user_sessions_restored_ = true; | 1884 user_sessions_restored_ = true; |
(...skipping 125 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2002 } | 2010 } |
2003 } | 2011 } |
2004 | 2012 |
2005 void UserManagerImpl::OnUserNotAllowed() { | 2013 void UserManagerImpl::OnUserNotAllowed() { |
2006 LOG(ERROR) << "Shutdown session because a user is not allowed to be in the " | 2014 LOG(ERROR) << "Shutdown session because a user is not allowed to be in the " |
2007 "current session"; | 2015 "current session"; |
2008 chrome::AttemptUserExit(); | 2016 chrome::AttemptUserExit(); |
2009 } | 2017 } |
2010 | 2018 |
2011 } // namespace chromeos | 2019 } // namespace chromeos |
OLD | NEW |