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.h" | 5 #include "chrome/browser/chromeos/login/users/chrome_user_manager.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 615 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
626 if (!GetActiveUser()) { | 626 if (!GetActiveUser()) { |
627 SetIsCurrentUserNew(true); | 627 SetIsCurrentUserNew(true); |
628 active_user_ = user_manager::User::CreateSupervisedUser(user_id); | 628 active_user_ = user_manager::User::CreateSupervisedUser(user_id); |
629 // Leaving OAuth token status at the default state = unknown. | 629 // Leaving OAuth token status at the default state = unknown. |
630 WallpaperManager::Get()->SetUserWallpaperNow(user_id); | 630 WallpaperManager::Get()->SetUserWallpaperNow(user_id); |
631 } else { | 631 } else { |
632 if (supervised_user_manager_->CheckForFirstRun(user_id)) { | 632 if (supervised_user_manager_->CheckForFirstRun(user_id)) { |
633 SetIsCurrentUserNew(true); | 633 SetIsCurrentUserNew(true); |
634 WallpaperManager::Get()->SetUserWallpaperNow(user_id); | 634 WallpaperManager::Get()->SetUserWallpaperNow(user_id); |
635 } else { | 635 } else { |
636 SetIsCurrentUserNew(true); | 636 SetIsCurrentUserNew(false); |
637 } | 637 } |
638 } | 638 } |
639 | 639 |
640 // Add the user to the front of the user list. | 640 // Add the user to the front of the user list. |
641 ListPrefUpdate prefs_users_update(GetLocalState(), kRegularUsers); | 641 ListPrefUpdate prefs_users_update(GetLocalState(), kRegularUsers); |
642 prefs_users_update->Insert(0, new base::StringValue(user_id)); | 642 prefs_users_update->Insert(0, new base::StringValue(user_id)); |
643 users_.insert(users_.begin(), active_user_); | 643 users_.insert(users_.begin(), active_user_); |
644 | 644 |
645 // Now that user is in the list, save display name. | 645 // Now that user is in the list, save display name. |
646 if (IsCurrentUserNew()) { | 646 if (IsCurrentUserNew()) { |
(...skipping 360 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1007 if ((users + GetUsersAdmittedForMultiProfile().size()) > 1) | 1007 if ((users + GetUsersAdmittedForMultiProfile().size()) > 1) |
1008 ash::MultiProfileUMA::RecordUserCount(users); | 1008 ash::MultiProfileUMA::RecordUserCount(users); |
1009 } | 1009 } |
1010 | 1010 |
1011 base::debug::SetCrashKeyValue( | 1011 base::debug::SetCrashKeyValue( |
1012 crash_keys::kNumberOfUsers, | 1012 crash_keys::kNumberOfUsers, |
1013 base::StringPrintf("%" PRIuS, GetLoggedInUsers().size())); | 1013 base::StringPrintf("%" PRIuS, GetLoggedInUsers().size())); |
1014 } | 1014 } |
1015 | 1015 |
1016 } // namespace chromeos | 1016 } // namespace chromeos |
OLD | NEW |