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

Side by Side Diff: trunk/src/ash/test/test_session_state_delegate.cc

Issue 14200034: Revert 194578 "Add ash SessionStateDelegate" (Closed) Base URL: svn://svn.chromium.org/chrome/
Patch Set: Created 7 years, 8 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 | Annotate | Revision Log
OLDNEW
(Empty)
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #include "ash/test/test_session_state_delegate.h"
6
7 namespace ash {
8 namespace test {
9
10 TestSessionStateDelegate::TestSessionStateDelegate()
11 : has_active_user_(true),
12 active_user_session_started_(true),
13 can_lock_screen_(true),
14 screen_locked_(false) {
15 }
16
17 TestSessionStateDelegate::~TestSessionStateDelegate() {
18 }
19
20 bool TestSessionStateDelegate::HasActiveUser() const {
21 return has_active_user_;
22 }
23
24 bool TestSessionStateDelegate::IsActiveUserSessionStarted() const {
25 return active_user_session_started_;
26 }
27
28 bool TestSessionStateDelegate::CanLockScreen() const {
29 return has_active_user_ && can_lock_screen_;
30 }
31
32 bool TestSessionStateDelegate::IsScreenLocked() const {
33 return screen_locked_;
34 }
35
36 void TestSessionStateDelegate::LockScreen() {
37 if (CanLockScreen())
38 screen_locked_ = true;
39 }
40
41 void TestSessionStateDelegate::UnlockScreen() {
42 screen_locked_ = false;
43 }
44
45 void TestSessionStateDelegate::SetHasActiveUser(bool has_active_user) {
46 has_active_user_ = has_active_user;
47 if (!has_active_user)
48 active_user_session_started_ = false;
49 }
50
51 void TestSessionStateDelegate::SetActiveUserSessionStarted(
52 bool active_user_session_started) {
53 active_user_session_started_ = active_user_session_started;
54 if (active_user_session_started)
55 has_active_user_ = true;
56 }
57
58 void TestSessionStateDelegate::SetCanLockScreen(bool can_lock_screen) {
59 can_lock_screen_ = can_lock_screen;
60 }
61
62 } // namespace test
63 } // namespace ash
OLDNEW
« no previous file with comments | « trunk/src/ash/test/test_session_state_delegate.h ('k') | trunk/src/ash/test/test_shell_delegate.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698