Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(65)

Side by Side Diff: ash/session/session_controller.cc

Issue 2864663002: cros: Merge SystemTrayDelegate::GetUserLoginStatus (Closed)
Patch Set: update PaletteTray to exclude ARC kiosk Created 3 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « ash/session/session_controller.h ('k') | ash/shelf/wm_shelf.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « ash/session/session_controller.h ('k') | ash/shelf/wm_shelf.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698