| 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 STATE_LOGIN_SECONDARY; |
| 98 |
| 99 // Assuming that if session is not active we're at login. |
| 100 return IsActiveUserSessionStarted() ? STATE_SESSION : STATE_LOGIN_PRIMARY; |
| 101 } |
| 102 |
| 94 void TestSessionStateDelegate::SetHasActiveUser(bool has_active_user) { | 103 void TestSessionStateDelegate::SetHasActiveUser(bool has_active_user) { |
| 95 has_active_user_ = has_active_user; | 104 has_active_user_ = has_active_user; |
| 96 if (!has_active_user) | 105 if (!has_active_user) |
| 97 active_user_session_started_ = false; | 106 active_user_session_started_ = false; |
| 98 else | 107 else |
| 99 Shell::GetInstance()->ShowShelf(); | 108 Shell::GetInstance()->ShowShelf(); |
| 100 } | 109 } |
| 101 | 110 |
| 102 void TestSessionStateDelegate::SetActiveUserSessionStarted( | 111 void TestSessionStateDelegate::SetActiveUserSessionStarted( |
| 103 bool active_user_session_started) { | 112 bool active_user_session_started) { |
| (...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 171 void TestSessionStateDelegate::AddSessionStateObserver( | 180 void TestSessionStateDelegate::AddSessionStateObserver( |
| 172 SessionStateObserver* observer) { | 181 SessionStateObserver* observer) { |
| 173 } | 182 } |
| 174 | 183 |
| 175 void TestSessionStateDelegate::RemoveSessionStateObserver( | 184 void TestSessionStateDelegate::RemoveSessionStateObserver( |
| 176 SessionStateObserver* observer) { | 185 SessionStateObserver* observer) { |
| 177 } | 186 } |
| 178 | 187 |
| 179 } // namespace test | 188 } // namespace test |
| 180 } // namespace ash | 189 } // namespace ash |
| OLD | NEW |