| 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 276 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 287 | 287 |
| 288 void UserManagerBase::RemoveUserInternal(const AccountId& account_id, | 288 void UserManagerBase::RemoveUserInternal(const AccountId& account_id, |
| 289 RemoveUserDelegate* delegate) { | 289 RemoveUserDelegate* delegate) { |
| 290 RemoveNonOwnerUserInternal(account_id, delegate); | 290 RemoveNonOwnerUserInternal(account_id, delegate); |
| 291 } | 291 } |
| 292 | 292 |
| 293 void UserManagerBase::RemoveNonOwnerUserInternal(const AccountId& account_id, | 293 void UserManagerBase::RemoveNonOwnerUserInternal(const AccountId& account_id, |
| 294 RemoveUserDelegate* delegate) { | 294 RemoveUserDelegate* delegate) { |
| 295 if (delegate) | 295 if (delegate) |
| 296 delegate->OnBeforeUserRemoved(account_id); | 296 delegate->OnBeforeUserRemoved(account_id); |
| 297 AsyncRemoveCryptohome(account_id); |
| 297 RemoveUserFromList(account_id); | 298 RemoveUserFromList(account_id); |
| 298 AsyncRemoveCryptohome(account_id); | |
| 299 | 299 |
| 300 if (delegate) | 300 if (delegate) |
| 301 delegate->OnUserRemoved(account_id); | 301 delegate->OnUserRemoved(account_id); |
| 302 } | 302 } |
| 303 | 303 |
| 304 void UserManagerBase::RemoveUserFromList(const AccountId& account_id) { | 304 void UserManagerBase::RemoveUserFromList(const AccountId& account_id) { |
| 305 DCHECK(task_runner_->RunsTasksOnCurrentThread()); | 305 DCHECK(task_runner_->RunsTasksOnCurrentThread()); |
| 306 RemoveNonCryptohomeData(account_id); | 306 RemoveNonCryptohomeData(account_id); |
| 307 if (user_loading_stage_ == STAGE_LOADED) { | 307 if (user_loading_stage_ == STAGE_LOADED) { |
| 308 DeleteUser(RemoveRegularOrSupervisedUserFromList(account_id)); | 308 DeleteUser(RemoveRegularOrSupervisedUserFromList(account_id)); |
| (...skipping 786 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1095 } | 1095 } |
| 1096 | 1096 |
| 1097 void UserManagerBase::DeleteUser(User* user) { | 1097 void UserManagerBase::DeleteUser(User* user) { |
| 1098 const bool is_active_user = (user == active_user_); | 1098 const bool is_active_user = (user == active_user_); |
| 1099 delete user; | 1099 delete user; |
| 1100 if (is_active_user) | 1100 if (is_active_user) |
| 1101 active_user_ = nullptr; | 1101 active_user_ = nullptr; |
| 1102 } | 1102 } |
| 1103 | 1103 |
| 1104 } // namespace user_manager | 1104 } // namespace user_manager |
| OLD | NEW |