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 383 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
394 } | 394 } |
395 DCHECK(active_user_); | 395 DCHECK(active_user_); |
396 active_user_->set_is_logged_in(true); | 396 active_user_->set_is_logged_in(true); |
397 active_user_->set_is_active(true); | 397 active_user_->set_is_active(true); |
398 active_user_->set_username_hash(username_hash); | 398 active_user_->set_username_hash(username_hash); |
399 | 399 |
400 // Place user who just signed in to the top of the logged in users. | 400 // Place user who just signed in to the top of the logged in users. |
401 logged_in_users_.insert(logged_in_users_.begin(), active_user_); | 401 logged_in_users_.insert(logged_in_users_.begin(), active_user_); |
402 SetLRUUser(active_user_); | 402 SetLRUUser(active_user_); |
403 | 403 |
404 if (!primary_user_) | 404 if (!primary_user_) { |
405 primary_user_ = active_user_; | 405 primary_user_ = active_user_; |
| 406 if (primary_user_->GetType() == User::USER_TYPE_REGULAR) |
| 407 SendRegularUserLoginMetrics(email); |
| 408 } |
406 | 409 |
407 UMA_HISTOGRAM_ENUMERATION("UserManager.LoginUserType", | 410 UMA_HISTOGRAM_ENUMERATION("UserManager.LoginUserType", |
408 active_user_->GetType(), User::NUM_USER_TYPES); | 411 active_user_->GetType(), User::NUM_USER_TYPES); |
409 | 412 |
410 if (active_user_->GetType() == User::USER_TYPE_REGULAR) | 413 if (IsMultipleProfilesAllowed()) { |
411 SendRegularUserLoginMetrics(email); | 414 UMA_HISTOGRAM_COUNTS_100("MultiProfile.UserCount", |
| 415 GetLoggedInUsers().size()); |
| 416 } |
| 417 |
412 g_browser_process->local_state()->SetString(kLastLoggedInRegularUser, | 418 g_browser_process->local_state()->SetString(kLastLoggedInRegularUser, |
413 (active_user_->GetType() == User::USER_TYPE_REGULAR) ? email : ""); | 419 (active_user_->GetType() == User::USER_TYPE_REGULAR) ? email : ""); |
414 | 420 |
415 NotifyOnLogin(); | 421 NotifyOnLogin(); |
416 } | 422 } |
417 | 423 |
418 void UserManagerImpl::SwitchActiveUser(const std::string& email) { | 424 void UserManagerImpl::SwitchActiveUser(const std::string& email) { |
419 if (!CommandLine::ForCurrentProcess()->HasSwitch(::switches::kMultiProfiles)) | 425 if (!CommandLine::ForCurrentProcess()->HasSwitch(::switches::kMultiProfiles)) |
420 return; | 426 return; |
421 | 427 |
(...skipping 1553 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1975 } | 1981 } |
1976 } | 1982 } |
1977 | 1983 |
1978 void UserManagerImpl::OnUserNotAllowed() { | 1984 void UserManagerImpl::OnUserNotAllowed() { |
1979 LOG(ERROR) << "Shutdown session because a user is not allowed to be in the " | 1985 LOG(ERROR) << "Shutdown session because a user is not allowed to be in the " |
1980 "current session"; | 1986 "current session"; |
1981 chrome::AttemptUserExit(); | 1987 chrome::AttemptUserExit(); |
1982 } | 1988 } |
1983 | 1989 |
1984 } // namespace chromeos | 1990 } // namespace chromeos |
OLD | NEW |