OLD | NEW |
(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 |
OLD | NEW |