OLD | NEW |
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 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 | 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/test/test_session_state_delegate.h" | 5 #include "ash/test/test_session_state_delegate.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "ash/shell.h" | 10 #include "ash/shell.h" |
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
84 | 84 |
85 void TestSessionStateDelegate::UnlockScreen() { | 85 void TestSessionStateDelegate::UnlockScreen() { |
86 screen_locked_ = false; | 86 screen_locked_ = false; |
87 } | 87 } |
88 | 88 |
89 bool TestSessionStateDelegate::IsUserSessionBlocked() const { | 89 bool TestSessionStateDelegate::IsUserSessionBlocked() const { |
90 return !IsActiveUserSessionStarted() || IsScreenLocked() || | 90 return !IsActiveUserSessionStarted() || IsScreenLocked() || |
91 user_adding_screen_running_; | 91 user_adding_screen_running_; |
92 } | 92 } |
93 | 93 |
| 94 SessionStateDelegate::SessionState TestSessionStateDelegate::GetSessionState() |
| 95 const { |
| 96 if (user_adding_screen_running_) |
| 97 return SESSION_STATE_LOGIN_SECONDARY; |
| 98 |
| 99 // Assuming that if session is not active we're at login. |
| 100 return IsActiveUserSessionStarted() ? |
| 101 SESSION_STATE_ACTIVE : SESSION_STATE_LOGIN_PRIMARY; |
| 102 } |
| 103 |
94 void TestSessionStateDelegate::SetHasActiveUser(bool has_active_user) { | 104 void TestSessionStateDelegate::SetHasActiveUser(bool has_active_user) { |
95 has_active_user_ = has_active_user; | 105 has_active_user_ = has_active_user; |
96 if (!has_active_user) | 106 if (!has_active_user) |
97 active_user_session_started_ = false; | 107 active_user_session_started_ = false; |
98 else | 108 else |
99 Shell::GetInstance()->ShowShelf(); | 109 Shell::GetInstance()->ShowShelf(); |
100 } | 110 } |
101 | 111 |
102 void TestSessionStateDelegate::SetActiveUserSessionStarted( | 112 void TestSessionStateDelegate::SetActiveUserSessionStarted( |
103 bool active_user_session_started) { | 113 bool active_user_session_started) { |
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
176 void TestSessionStateDelegate::AddSessionStateObserver( | 186 void TestSessionStateDelegate::AddSessionStateObserver( |
177 SessionStateObserver* observer) { | 187 SessionStateObserver* observer) { |
178 } | 188 } |
179 | 189 |
180 void TestSessionStateDelegate::RemoveSessionStateObserver( | 190 void TestSessionStateDelegate::RemoveSessionStateObserver( |
181 SessionStateObserver* observer) { | 191 SessionStateObserver* observer) { |
182 } | 192 } |
183 | 193 |
184 } // namespace test | 194 } // namespace test |
185 } // namespace ash | 195 } // namespace ash |
OLD | NEW |