Chromium Code Reviews| 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 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 76 // actually added to a session. | 76 // actually added to a session. |
| 77 // TODO(nkostylev): Adjust this limitation based on device capabilites. | 77 // TODO(nkostylev): Adjust this limitation based on device capabilites. |
| 78 // http://crbug.com/230865 | 78 // http://crbug.com/230865 |
| 79 return 10; | 79 return 10; |
| 80 } | 80 } |
| 81 | 81 |
| 82 int SessionStateDelegateChromeos::NumberOfLoggedInUsers() const { | 82 int SessionStateDelegateChromeos::NumberOfLoggedInUsers() const { |
| 83 return user_manager::UserManager::Get()->GetLoggedInUsers().size(); | 83 return user_manager::UserManager::Get()->GetLoggedInUsers().size(); |
| 84 } | 84 } |
| 85 | 85 |
| 86 int SessionStateDelegateChromeos::GetNumberOfAdmittedForMultiProfileUsers() | |
| 87 const { | |
| 88 return user_manager::UserManager::Get() | |
| 89 ->GetUsersAdmittedForMultiProfile() | |
| 90 .size(); | |
|
dzhioev (left Google)
2014/09/18 07:14:22
Such formatting looks strange. Can you please appp
Roman Sorokin (ftl)
2014/09/22 08:36:06
'git cl format' have done that.
On 2014/09/18 07:1
| |
| 91 } | |
| 92 | |
| 86 bool SessionStateDelegateChromeos::IsActiveUserSessionStarted() const { | 93 bool SessionStateDelegateChromeos::IsActiveUserSessionStarted() const { |
| 87 return user_manager::UserManager::Get()->IsSessionStarted(); | 94 return user_manager::UserManager::Get()->IsSessionStarted(); |
| 88 } | 95 } |
| 89 | 96 |
| 90 bool SessionStateDelegateChromeos::CanLockScreen() const { | 97 bool SessionStateDelegateChromeos::CanLockScreen() const { |
| 91 const user_manager::UserList unlock_users = | 98 const user_manager::UserList unlock_users = |
| 92 user_manager::UserManager::Get()->GetUnlockUsers(); | 99 user_manager::UserManager::Get()->GetUnlockUsers(); |
| 93 return !unlock_users.empty(); | 100 return !unlock_users.empty(); |
| 94 } | 101 } |
| 95 | 102 |
| (...skipping 176 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 272 } | 279 } |
| 273 | 280 |
| 274 void DoSwitchUser(const std::string& user_id) { | 281 void DoSwitchUser(const std::string& user_id) { |
| 275 user_manager::UserManager::Get()->SwitchActiveUser(user_id); | 282 user_manager::UserManager::Get()->SwitchActiveUser(user_id); |
| 276 } | 283 } |
| 277 | 284 |
| 278 void SessionStateDelegateChromeos::TryToSwitchUser( | 285 void SessionStateDelegateChromeos::TryToSwitchUser( |
| 279 const std::string& user_id) { | 286 const std::string& user_id) { |
| 280 ash::TrySwitchingActiveUser(base::Bind(&DoSwitchUser, user_id)); | 287 ash::TrySwitchingActiveUser(base::Bind(&DoSwitchUser, user_id)); |
| 281 } | 288 } |
| OLD | NEW |