| 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 "components/user_manager/user_manager_base.h" | 5 #include "components/user_manager/user_manager_base.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 #include <set> | 8 #include <set> |
| 9 #include <utility> | 9 #include <utility> |
| 10 | 10 |
| (...skipping 238 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 249 // Make sure that this function gets run only once. | 249 // Make sure that this function gets run only once. |
| 250 last_session_active_account_id_.clear(); | 250 last_session_active_account_id_.clear(); |
| 251 } | 251 } |
| 252 | 252 |
| 253 void UserManagerBase::SessionStarted() { | 253 void UserManagerBase::SessionStarted() { |
| 254 DCHECK(task_runner_->RunsTasksOnCurrentThread()); | 254 DCHECK(task_runner_->RunsTasksOnCurrentThread()); |
| 255 session_started_ = true; | 255 session_started_ = true; |
| 256 | 256 |
| 257 CallUpdateLoginState(); | 257 CallUpdateLoginState(); |
| 258 session_manager::SessionManager::Get()->SetSessionState( | 258 session_manager::SessionManager::Get()->SetSessionState( |
| 259 session_manager::SESSION_STATE_ACTIVE); | 259 session_manager::SessionState::ACTIVE); |
| 260 | 260 |
| 261 GetLocalState()->CommitPendingWrite(); | 261 GetLocalState()->CommitPendingWrite(); |
| 262 } | 262 } |
| 263 | 263 |
| 264 void UserManagerBase::RemoveUser(const AccountId& account_id, | 264 void UserManagerBase::RemoveUser(const AccountId& account_id, |
| 265 RemoveUserDelegate* delegate) { | 265 RemoveUserDelegate* delegate) { |
| 266 DCHECK(task_runner_->RunsTasksOnCurrentThread()); | 266 DCHECK(task_runner_->RunsTasksOnCurrentThread()); |
| 267 | 267 |
| 268 if (!CanUserBeRemoved(FindUser(account_id))) | 268 if (!CanUserBeRemoved(FindUser(account_id))) |
| 269 return; | 269 return; |
| (...skipping 806 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1076 } | 1076 } |
| 1077 | 1077 |
| 1078 void UserManagerBase::DeleteUser(User* user) { | 1078 void UserManagerBase::DeleteUser(User* user) { |
| 1079 const bool is_active_user = (user == active_user_); | 1079 const bool is_active_user = (user == active_user_); |
| 1080 delete user; | 1080 delete user; |
| 1081 if (is_active_user) | 1081 if (is_active_user) |
| 1082 active_user_ = nullptr; | 1082 active_user_ = nullptr; |
| 1083 } | 1083 } |
| 1084 | 1084 |
| 1085 } // namespace user_manager | 1085 } // namespace user_manager |
| OLD | NEW |