| OLD | NEW |
| 1 // Copyright 2017 The Chromium Authors. All rights reserved. | 1 // Copyright 2017 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/common/test/test_session_controller_client.h" | 5 #include "ash/common/test/test_session_controller_client.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "ash/common/login_status.h" | 10 #include "ash/common/login_status.h" |
| (...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 70 void TestSessionControllerClient::SetShouldLockScreenAutomatically( | 70 void TestSessionControllerClient::SetShouldLockScreenAutomatically( |
| 71 bool should_lock) { | 71 bool should_lock) { |
| 72 session_info_->should_lock_screen_automatically = should_lock; | 72 session_info_->should_lock_screen_automatically = should_lock; |
| 73 controller_->SetSessionInfo(session_info_->Clone()); | 73 controller_->SetSessionInfo(session_info_->Clone()); |
| 74 } | 74 } |
| 75 | 75 |
| 76 void TestSessionControllerClient::SetSessionState( | 76 void TestSessionControllerClient::SetSessionState( |
| 77 session_manager::SessionState state) { | 77 session_manager::SessionState state) { |
| 78 session_info_->state = state; | 78 session_info_->state = state; |
| 79 controller_->SetSessionInfo(session_info_->Clone()); | 79 controller_->SetSessionInfo(session_info_->Clone()); |
| 80 | |
| 81 // TODO(xiyuan): Remove after LoginStatus becomes part of SessionController. | |
| 82 Shell::Get()->UpdateAfterLoginStatusChange( | |
| 83 state == session_manager::SessionState::ACTIVE | |
| 84 ? LoginStatus::USER | |
| 85 : LoginStatus::NOT_LOGGED_IN); | |
| 86 } | 80 } |
| 87 | 81 |
| 88 void TestSessionControllerClient::CreatePredefinedUserSessions(int count) { | 82 void TestSessionControllerClient::CreatePredefinedUserSessions(int count) { |
| 89 DCHECK_GT(count, 0); | 83 DCHECK_GT(count, 0); |
| 90 | 84 |
| 91 // Resets the controller's state. | 85 // Resets the controller's state. |
| 92 Reset(); | 86 Reset(); |
| 93 | 87 |
| 94 // Adds user sessions with numbered emails if more are needed. | 88 // Adds user sessions with numbered emails if more are needed. |
| 95 for (int numbered_user_index = 0; numbered_user_index < count; | 89 for (int numbered_user_index = 0; numbered_user_index < count; |
| (...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 173 if (it == sessions.end()) { | 167 if (it == sessions.end()) { |
| 174 NOTREACHED(); | 168 NOTREACHED(); |
| 175 return; | 169 return; |
| 176 } | 170 } |
| 177 | 171 |
| 178 SwitchActiveUser((*it)->account_id); | 172 SwitchActiveUser((*it)->account_id); |
| 179 } | 173 } |
| 180 | 174 |
| 181 } // namespace test | 175 } // namespace test |
| 182 } // namespace ash | 176 } // namespace ash |
| OLD | NEW |