| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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 "ash/session/session_controller.h" | 5 #include "ash/session/session_controller.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 | 8 |
| 9 #include "ash/session/session_observer.h" | 9 #include "ash/session/session_observer.h" |
| 10 #include "ash/shell.h" | 10 #include "ash/shell.h" |
| (...skipping 128 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 139 } | 139 } |
| 140 | 140 |
| 141 bool SessionController::IsUserChild() const { | 141 bool SessionController::IsUserChild() const { |
| 142 if (!IsActiveUserSessionStarted()) | 142 if (!IsActiveUserSessionStarted()) |
| 143 return false; | 143 return false; |
| 144 | 144 |
| 145 user_manager::UserType active_user_type = GetUserSession(0)->type; | 145 user_manager::UserType active_user_type = GetUserSession(0)->type; |
| 146 return active_user_type == user_manager::USER_TYPE_CHILD; | 146 return active_user_type == user_manager::USER_TYPE_CHILD; |
| 147 } | 147 } |
| 148 | 148 |
| 149 bool SessionController::IsKioskSession() const { |
| 150 if (!IsActiveUserSessionStarted()) |
| 151 return false; |
| 152 |
| 153 user_manager::UserType active_user_type = GetUserSession(0)->type; |
| 154 return active_user_type == user_manager::USER_TYPE_KIOSK_APP || |
| 155 active_user_type == user_manager::USER_TYPE_ARC_KIOSK_APP; |
| 156 } |
| 157 |
| 149 void SessionController::LockScreen() { | 158 void SessionController::LockScreen() { |
| 150 if (client_) | 159 if (client_) |
| 151 client_->RequestLockScreen(); | 160 client_->RequestLockScreen(); |
| 152 } | 161 } |
| 153 | 162 |
| 154 void SessionController::SwitchActiveUser(const AccountId& account_id) { | 163 void SessionController::SwitchActiveUser(const AccountId& account_id) { |
| 155 if (client_) | 164 if (client_) |
| 156 client_->SwitchActiveUser(account_id); | 165 client_->SwitchActiveUser(account_id); |
| 157 } | 166 } |
| 158 | 167 |
| (...skipping 212 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 371 for (auto& observer : observers_) | 380 for (auto& observer : observers_) |
| 372 observer.OnLoginStatusChanged(login_status_); | 381 observer.OnLoginStatusChanged(login_status_); |
| 373 } | 382 } |
| 374 | 383 |
| 375 void SessionController::OnLockAnimationFinished() { | 384 void SessionController::OnLockAnimationFinished() { |
| 376 if (!start_lock_callback_.is_null()) | 385 if (!start_lock_callback_.is_null()) |
| 377 std::move(start_lock_callback_).Run(true /* locked */); | 386 std::move(start_lock_callback_).Run(true /* locked */); |
| 378 } | 387 } |
| 379 | 388 |
| 380 } // namespace ash | 389 } // namespace ash |
| OLD | NEW |