| 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 <stddef.h> | 7 #include <stddef.h> |
| 8 | 8 |
| 9 #include <cstddef> | 9 #include <cstddef> |
| 10 #include <set> | 10 #include <set> |
| (...skipping 778 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 789 if (supervised_user_manager_->CheckForFirstRun(account_id.GetUserEmail())) { | 789 if (supervised_user_manager_->CheckForFirstRun(account_id.GetUserEmail())) { |
| 790 SetIsCurrentUserNew(true); | 790 SetIsCurrentUserNew(true); |
| 791 WallpaperManager::Get()->SetUserWallpaperNow(account_id); | 791 WallpaperManager::Get()->SetUserWallpaperNow(account_id); |
| 792 } else { | 792 } else { |
| 793 SetIsCurrentUserNew(false); | 793 SetIsCurrentUserNew(false); |
| 794 } | 794 } |
| 795 } | 795 } |
| 796 | 796 |
| 797 // Add the user to the front of the user list. | 797 // Add the user to the front of the user list. |
| 798 ListPrefUpdate prefs_users_update(GetLocalState(), kRegularUsers); | 798 ListPrefUpdate prefs_users_update(GetLocalState(), kRegularUsers); |
| 799 prefs_users_update->Insert(0, | 799 prefs_users_update->Insert( |
| 800 new base::StringValue(account_id.GetUserEmail())); | 800 0, base::MakeUnique<base::StringValue>(account_id.GetUserEmail())); |
| 801 users_.insert(users_.begin(), active_user_); | 801 users_.insert(users_.begin(), active_user_); |
| 802 | 802 |
| 803 // Now that user is in the list, save display name. | 803 // Now that user is in the list, save display name. |
| 804 if (IsCurrentUserNew()) { | 804 if (IsCurrentUserNew()) { |
| 805 SaveUserDisplayName(GetActiveUser()->GetAccountId(), | 805 SaveUserDisplayName(GetActiveUser()->GetAccountId(), |
| 806 GetActiveUser()->GetDisplayName()); | 806 GetActiveUser()->GetDisplayName()); |
| 807 } | 807 } |
| 808 | 808 |
| 809 GetUserImageManager(account_id)->UserLoggedIn(IsCurrentUserNew(), true); | 809 GetUserImageManager(account_id)->UserLoggedIn(IsCurrentUserNew(), true); |
| 810 WallpaperManager::Get()->EnsureLoggedInUserWallpaperLoaded(); | 810 WallpaperManager::Get()->EnsureLoggedInUserWallpaperLoaded(); |
| (...skipping 419 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1230 bool ChromeUserManagerImpl::ShouldReportUser(const std::string& user_id) const { | 1230 bool ChromeUserManagerImpl::ShouldReportUser(const std::string& user_id) const { |
| 1231 const base::ListValue& reporting_users = | 1231 const base::ListValue& reporting_users = |
| 1232 *(GetLocalState()->GetList(kReportingUsers)); | 1232 *(GetLocalState()->GetList(kReportingUsers)); |
| 1233 base::StringValue user_id_value(FullyCanonicalize(user_id)); | 1233 base::StringValue user_id_value(FullyCanonicalize(user_id)); |
| 1234 return !(reporting_users.Find(user_id_value) == reporting_users.end()); | 1234 return !(reporting_users.Find(user_id_value) == reporting_users.end()); |
| 1235 } | 1235 } |
| 1236 | 1236 |
| 1237 void ChromeUserManagerImpl::AddReportingUser(const AccountId& account_id) { | 1237 void ChromeUserManagerImpl::AddReportingUser(const AccountId& account_id) { |
| 1238 ListPrefUpdate users_update(GetLocalState(), kReportingUsers); | 1238 ListPrefUpdate users_update(GetLocalState(), kReportingUsers); |
| 1239 users_update->AppendIfNotPresent( | 1239 users_update->AppendIfNotPresent( |
| 1240 new base::StringValue(account_id.GetUserEmail())); | 1240 base::MakeUnique<base::StringValue>(account_id.GetUserEmail())); |
| 1241 } | 1241 } |
| 1242 | 1242 |
| 1243 void ChromeUserManagerImpl::RemoveReportingUser(const AccountId& account_id) { | 1243 void ChromeUserManagerImpl::RemoveReportingUser(const AccountId& account_id) { |
| 1244 ListPrefUpdate users_update(GetLocalState(), kReportingUsers); | 1244 ListPrefUpdate users_update(GetLocalState(), kReportingUsers); |
| 1245 users_update->Remove( | 1245 users_update->Remove( |
| 1246 base::StringValue(FullyCanonicalize(account_id.GetUserEmail())), NULL); | 1246 base::StringValue(FullyCanonicalize(account_id.GetUserEmail())), NULL); |
| 1247 } | 1247 } |
| 1248 | 1248 |
| 1249 void ChromeUserManagerImpl::UpdateLoginState( | 1249 void ChromeUserManagerImpl::UpdateLoginState( |
| 1250 const user_manager::User* active_user, | 1250 const user_manager::User* active_user, |
| (...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1343 break; | 1343 break; |
| 1344 default: | 1344 default: |
| 1345 NOTREACHED(); | 1345 NOTREACHED(); |
| 1346 break; | 1346 break; |
| 1347 } | 1347 } |
| 1348 | 1348 |
| 1349 return user; | 1349 return user; |
| 1350 } | 1350 } |
| 1351 | 1351 |
| 1352 } // namespace chromeos | 1352 } // namespace chromeos |
| OLD | NEW |