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 "chrome/browser/ui/ash/session_state_delegate_chromeos.h" | 5 #include "chrome/browser/ui/ash/session_state_delegate_chromeos.h" |
6 | 6 |
7 #include "ash/multi_profile_uma.h" | 7 #include "ash/multi_profile_uma.h" |
8 #include "ash/session/session_state_observer.h" | 8 #include "ash/session/session_state_observer.h" |
9 #include "ash/system/chromeos/multi_user/user_switch_util.h" | 9 #include "ash/system/chromeos/multi_user/user_switch_util.h" |
10 #include "base/bind.h" | 10 #include "base/bind.h" |
(...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
133 chromeos::DBusThreadManager::Get()->GetSessionManagerClient()-> | 133 chromeos::DBusThreadManager::Get()->GetSessionManagerClient()-> |
134 RequestLockScreen(); | 134 RequestLockScreen(); |
135 } | 135 } |
136 | 136 |
137 void SessionStateDelegateChromeos::UnlockScreen() { | 137 void SessionStateDelegateChromeos::UnlockScreen() { |
138 // This is used only for testing thus far. | 138 // This is used only for testing thus far. |
139 NOTIMPLEMENTED(); | 139 NOTIMPLEMENTED(); |
140 } | 140 } |
141 | 141 |
142 bool SessionStateDelegateChromeos::IsUserSessionBlocked() const { | 142 bool SessionStateDelegateChromeos::IsUserSessionBlocked() const { |
143 bool has_login_manager = CommandLine::ForCurrentProcess()->HasSwitch( | 143 bool has_login_manager = base::CommandLine::ForCurrentProcess()->HasSwitch( |
144 chromeos::switches::kLoginManager); | 144 chromeos::switches::kLoginManager); |
145 return (has_login_manager && !IsActiveUserSessionStarted()) || | 145 return (has_login_manager && !IsActiveUserSessionStarted()) || |
146 IsScreenLocked() || | 146 IsScreenLocked() || |
147 chromeos::UserAddingScreen::Get()->IsRunning(); | 147 chromeos::UserAddingScreen::Get()->IsRunning(); |
148 } | 148 } |
149 | 149 |
150 ash::SessionStateDelegate::SessionState | 150 ash::SessionStateDelegate::SessionState |
151 SessionStateDelegateChromeos::GetSessionState() const { | 151 SessionStateDelegateChromeos::GetSessionState() const { |
152 return session_state_; | 152 return session_state_; |
153 } | 153 } |
154 | 154 |
(...skipping 129 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
284 } | 284 } |
285 | 285 |
286 void DoSwitchUser(const std::string& user_id) { | 286 void DoSwitchUser(const std::string& user_id) { |
287 user_manager::UserManager::Get()->SwitchActiveUser(user_id); | 287 user_manager::UserManager::Get()->SwitchActiveUser(user_id); |
288 } | 288 } |
289 | 289 |
290 void SessionStateDelegateChromeos::TryToSwitchUser( | 290 void SessionStateDelegateChromeos::TryToSwitchUser( |
291 const std::string& user_id) { | 291 const std::string& user_id) { |
292 ash::TrySwitchingActiveUser(base::Bind(&DoSwitchUser, user_id)); | 292 ash::TrySwitchingActiveUser(base::Bind(&DoSwitchUser, user_id)); |
293 } | 293 } |
OLD | NEW |