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

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

Issue 14295008: Add ash SessionStateDelegate (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Ready for review. 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
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 screen_locked_ = true;
Daniel Erat 2013/04/16 17:34:15 does it make sense to CHECK(can_lock_screen_) here
bartfab (slow) 2013/04/17 08:14:41 It's not an error to request a screen lock when sc
38 }
39
40 void TestSessionStateDelegate::UnlockScreen() {
41 screen_locked_ = false;
42 }
43
44 void TestSessionStateDelegate::SetHasActiveUser(bool has_active_user) {
45 has_active_user_ = has_active_user;
46 if (!has_active_user)
47 active_user_session_started_ = false;
48 }
49
50 void TestSessionStateDelegate::SetActiveUserSessionStarted(
51 bool active_user_session_started) {
52 active_user_session_started_ = active_user_session_started;
53 if (active_user_session_started)
54 has_active_user_ = true;
55 }
56
57 void TestSessionStateDelegate::SetCanLockScreen(bool can_lock_screen) {
58 can_lock_screen_ = can_lock_screen;
59 }
60
61 } // namespace test
62 } // namespace ash
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698