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/multi_profile_uma.h" | 10 #include "ash/multi_profile_uma.h" |
(...skipping 1486 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1497 is_current_user_new_ = true; | 1497 is_current_user_new_ = true; |
1498 active_user_ = User::CreateRetailModeUser(); | 1498 active_user_ = User::CreateRetailModeUser(); |
1499 GetUserImageManager(UserManager::kRetailModeUserName)->UserLoggedIn( | 1499 GetUserImageManager(UserManager::kRetailModeUserName)->UserLoggedIn( |
1500 is_current_user_new_, | 1500 is_current_user_new_, |
1501 true); | 1501 true); |
1502 WallpaperManager::Get()->SetUserWallpaperNow( | 1502 WallpaperManager::Get()->SetUserWallpaperNow( |
1503 UserManager::kRetailModeUserName); | 1503 UserManager::kRetailModeUserName); |
1504 } | 1504 } |
1505 | 1505 |
1506 void UserManagerImpl::NotifyOnLogin() { | 1506 void UserManagerImpl::NotifyOnLogin() { |
| 1507 CHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
| 1508 |
| 1509 // Notify that use of base::GetHomeDir() is now allowed and initialize |
| 1510 // it to primary user home dir. |
| 1511 base::SetUserLoggedIn(true); |
| 1512 if (GetLoggedInUsers().size() == 1) |
| 1513 base::SetPrimaryUserIdHash(active_user_->username_hash()); |
| 1514 |
1507 UpdateNumberOfUsers(); | 1515 UpdateNumberOfUsers(); |
1508 CHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); | |
1509 NotifyActiveUserHashChanged(active_user_->username_hash()); | 1516 NotifyActiveUserHashChanged(active_user_->username_hash()); |
1510 NotifyActiveUserChanged(active_user_); | 1517 NotifyActiveUserChanged(active_user_); |
| 1518 UpdateLoginState(); |
1511 | 1519 |
1512 UpdateLoginState(); | |
1513 // TODO(nkostylev): Deprecate this notification in favor of | 1520 // TODO(nkostylev): Deprecate this notification in favor of |
1514 // ActiveUserChanged() observer call. | 1521 // ActiveUserChanged() observer call. |
1515 content::NotificationService::current()->Notify( | 1522 content::NotificationService::current()->Notify( |
1516 chrome::NOTIFICATION_LOGIN_USER_CHANGED, | 1523 chrome::NOTIFICATION_LOGIN_USER_CHANGED, |
1517 content::Source<UserManager>(this), | 1524 content::Source<UserManager>(this), |
1518 content::Details<const User>(active_user_)); | 1525 content::Details<const User>(active_user_)); |
1519 | 1526 |
1520 // Owner must be first user in session. DeviceSettingsService can't deal with | 1527 // Owner must be first user in session. DeviceSettingsService can't deal with |
1521 // multiple user and will mix up ownership, crbug.com/230018. | 1528 // multiple user and will mix up ownership, crbug.com/230018. |
1522 if (GetLoggedInUsers().size() == 1) { | 1529 if (GetLoggedInUsers().size() == 1) { |
(...skipping 526 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2049 } | 2056 } |
2050 | 2057 |
2051 void UserManagerImpl::DeleteUser(User* user) { | 2058 void UserManagerImpl::DeleteUser(User* user) { |
2052 const bool is_active_user = (user == active_user_); | 2059 const bool is_active_user = (user == active_user_); |
2053 delete user; | 2060 delete user; |
2054 if (is_active_user) | 2061 if (is_active_user) |
2055 active_user_ = NULL; | 2062 active_user_ = NULL; |
2056 } | 2063 } |
2057 | 2064 |
2058 } // namespace chromeos | 2065 } // namespace chromeos |
OLD | NEW |