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

Side by Side Diff: ash/common/test/test_session_controller_client.cc

Issue 2797743002: ash: Merge LoginStatus update code path (Closed)
Patch Set: for #2 comments Created 3 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
« no previous file with comments | « ash/common/system/user/tray_user.cc ('k') | ash/mus/system_tray_delegate_mus.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « ash/common/system/user/tray_user.cc ('k') | ash/mus/system_tray_delegate_mus.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698