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/user_manager_impl.h" | 5 #include "chrome/browser/chromeos/login/users/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 1944 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1955 login_user_type = LoginState::LOGGED_IN_USER_RETAIL_MODE; | 1955 login_user_type = LoginState::LOGGED_IN_USER_RETAIL_MODE; |
1956 else if (active_user_->GetType() == User::USER_TYPE_PUBLIC_ACCOUNT) | 1956 else if (active_user_->GetType() == User::USER_TYPE_PUBLIC_ACCOUNT) |
1957 login_user_type = LoginState::LOGGED_IN_USER_PUBLIC_ACCOUNT; | 1957 login_user_type = LoginState::LOGGED_IN_USER_PUBLIC_ACCOUNT; |
1958 else if (active_user_->GetType() == User::USER_TYPE_LOCALLY_MANAGED) | 1958 else if (active_user_->GetType() == User::USER_TYPE_LOCALLY_MANAGED) |
1959 login_user_type = LoginState::LOGGED_IN_USER_LOCALLY_MANAGED; | 1959 login_user_type = LoginState::LOGGED_IN_USER_LOCALLY_MANAGED; |
1960 else if (active_user_->GetType() == User::USER_TYPE_KIOSK_APP) | 1960 else if (active_user_->GetType() == User::USER_TYPE_KIOSK_APP) |
1961 login_user_type = LoginState::LOGGED_IN_USER_KIOSK_APP; | 1961 login_user_type = LoginState::LOGGED_IN_USER_KIOSK_APP; |
1962 else | 1962 else |
1963 login_user_type = LoginState::LOGGED_IN_USER_REGULAR; | 1963 login_user_type = LoginState::LOGGED_IN_USER_REGULAR; |
1964 | 1964 |
1965 LoginState::Get()->SetLoggedInState(logged_in_state, login_user_type); | 1965 if (primary_user_) { |
| 1966 LoginState::Get()->SetLoggedInStateAndPrimaryUser( |
| 1967 logged_in_state, login_user_type, primary_user_->username_hash()); |
| 1968 } else { |
| 1969 LoginState::Get()->SetLoggedInState(logged_in_state, login_user_type); |
| 1970 } |
1966 } | 1971 } |
1967 | 1972 |
1968 void UserManagerImpl::SetLRUUser(User* user) { | 1973 void UserManagerImpl::SetLRUUser(User* user) { |
1969 UserList::iterator it = std::find(lru_logged_in_users_.begin(), | 1974 UserList::iterator it = std::find(lru_logged_in_users_.begin(), |
1970 lru_logged_in_users_.end(), | 1975 lru_logged_in_users_.end(), |
1971 user); | 1976 user); |
1972 if (it != lru_logged_in_users_.end()) | 1977 if (it != lru_logged_in_users_.end()) |
1973 lru_logged_in_users_.erase(it); | 1978 lru_logged_in_users_.erase(it); |
1974 lru_logged_in_users_.insert(lru_logged_in_users_.begin(), user); | 1979 lru_logged_in_users_.insert(lru_logged_in_users_.begin(), user); |
1975 } | 1980 } |
(...skipping 124 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2100 } | 2105 } |
2101 | 2106 |
2102 void UserManagerImpl::DeleteUser(User* user) { | 2107 void UserManagerImpl::DeleteUser(User* user) { |
2103 const bool is_active_user = (user == active_user_); | 2108 const bool is_active_user = (user == active_user_); |
2104 delete user; | 2109 delete user; |
2105 if (is_active_user) | 2110 if (is_active_user) |
2106 active_user_ = NULL; | 2111 active_user_ = NULL; |
2107 } | 2112 } |
2108 | 2113 |
2109 } // namespace chromeos | 2114 } // namespace chromeos |
OLD | NEW |