| 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 568 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 579 bool UserManagerBase::IsLoggedInAsSupervisedUser() const { | 579 bool UserManagerBase::IsLoggedInAsSupervisedUser() const { |
| 580 DCHECK(task_runner_->RunsTasksOnCurrentThread()); | 580 DCHECK(task_runner_->RunsTasksOnCurrentThread()); |
| 581 return IsUserLoggedIn() && active_user_->GetType() == USER_TYPE_SUPERVISED; | 581 return IsUserLoggedIn() && active_user_->GetType() == USER_TYPE_SUPERVISED; |
| 582 } | 582 } |
| 583 | 583 |
| 584 bool UserManagerBase::IsLoggedInAsKioskApp() const { | 584 bool UserManagerBase::IsLoggedInAsKioskApp() const { |
| 585 DCHECK(task_runner_->RunsTasksOnCurrentThread()); | 585 DCHECK(task_runner_->RunsTasksOnCurrentThread()); |
| 586 return IsUserLoggedIn() && active_user_->GetType() == USER_TYPE_KIOSK_APP; | 586 return IsUserLoggedIn() && active_user_->GetType() == USER_TYPE_KIOSK_APP; |
| 587 } | 587 } |
| 588 | 588 |
| 589 bool UserManagerBase::IsLoggedInAsArcKioskApp() const { |
| 590 DCHECK(task_runner_->RunsTasksOnCurrentThread()); |
| 591 return IsUserLoggedIn() && active_user_->GetType() == USER_TYPE_ARC_KIOSK_APP; |
| 592 } |
| 593 |
| 589 bool UserManagerBase::IsLoggedInAsStub() const { | 594 bool UserManagerBase::IsLoggedInAsStub() const { |
| 590 DCHECK(task_runner_->RunsTasksOnCurrentThread()); | 595 DCHECK(task_runner_->RunsTasksOnCurrentThread()); |
| 591 return IsUserLoggedIn() && IsStubAccountId(active_user_->GetAccountId()); | 596 return IsUserLoggedIn() && IsStubAccountId(active_user_->GetAccountId()); |
| 592 } | 597 } |
| 593 | 598 |
| 594 bool UserManagerBase::IsSessionStarted() const { | 599 bool UserManagerBase::IsSessionStarted() const { |
| 595 DCHECK(task_runner_->RunsTasksOnCurrentThread()); | 600 DCHECK(task_runner_->RunsTasksOnCurrentThread()); |
| 596 return session_started_; | 601 return session_started_; |
| 597 } | 602 } |
| 598 | 603 |
| (...skipping 477 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1076 } | 1081 } |
| 1077 | 1082 |
| 1078 void UserManagerBase::DeleteUser(User* user) { | 1083 void UserManagerBase::DeleteUser(User* user) { |
| 1079 const bool is_active_user = (user == active_user_); | 1084 const bool is_active_user = (user == active_user_); |
| 1080 delete user; | 1085 delete user; |
| 1081 if (is_active_user) | 1086 if (is_active_user) |
| 1082 active_user_ = nullptr; | 1087 active_user_ = nullptr; |
| 1083 } | 1088 } |
| 1084 | 1089 |
| 1085 } // namespace user_manager | 1090 } // namespace user_manager |
| OLD | NEW |