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 "base/bind.h" | 11 #include "base/bind.h" |
11 #include "base/bind_helpers.h" | 12 #include "base/bind_helpers.h" |
12 #include "base/command_line.h" | 13 #include "base/command_line.h" |
13 #include "base/compiler_specific.h" | 14 #include "base/compiler_specific.h" |
14 #include "base/files/file_path.h" | 15 #include "base/files/file_path.h" |
15 #include "base/format_macros.h" | 16 #include "base/format_macros.h" |
16 #include "base/logging.h" | 17 #include "base/logging.h" |
17 #include "base/metrics/histogram.h" | 18 #include "base/metrics/histogram.h" |
18 #include "base/prefs/pref_registry_simple.h" | 19 #include "base/prefs/pref_registry_simple.h" |
19 #include "base/prefs/pref_service.h" | 20 #include "base/prefs/pref_service.h" |
(...skipping 2015 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2035 } | 2036 } |
2036 | 2037 |
2037 void UserManagerImpl::DoUpdateAccountLocale( | 2038 void UserManagerImpl::DoUpdateAccountLocale( |
2038 const std::string& user_id, | 2039 const std::string& user_id, |
2039 const std::string& resolved_locale) { | 2040 const std::string& resolved_locale) { |
2040 if (User* user = FindUserAndModify(user_id)) | 2041 if (User* user = FindUserAndModify(user_id)) |
2041 user->SetAccountLocale(resolved_locale); | 2042 user->SetAccountLocale(resolved_locale); |
2042 } | 2043 } |
2043 | 2044 |
2044 void UserManagerImpl::UpdateNumberOfUsers() { | 2045 void UserManagerImpl::UpdateNumberOfUsers() { |
| 2046 size_t users = GetLoggedInUsers().size(); |
| 2047 if (users) { |
| 2048 // Write the user number as UMA stat when a multi user session is possible. |
| 2049 if ((users + GetUsersAdmittedForMultiProfile().size()) > 1) |
| 2050 ash::MultiProfileUMA::RecordUserCount(users); |
| 2051 } |
| 2052 |
2045 base::debug::SetCrashKeyValue(crash_keys::kNumberOfUsers, | 2053 base::debug::SetCrashKeyValue(crash_keys::kNumberOfUsers, |
2046 base::StringPrintf("%" PRIuS, GetLoggedInUsers().size())); | 2054 base::StringPrintf("%" PRIuS, GetLoggedInUsers().size())); |
2047 } | 2055 } |
2048 | 2056 |
2049 } // namespace chromeos | 2057 } // namespace chromeos |
OLD | NEW |