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 bool SessionStateDelegateChromeos::CanAddUserToMultiProfile( | |
87 MultiProfileAddUserError* error) const { | |
88 if (user_manager::UserManager::Get() | |
89 ->GetUsersAdmittedForMultiProfile() | |
James Cook
2014/09/23 16:02:12
I know this was not added in this CL, but the name
Roman Sorokin (ftl)
2014/09/24 08:30:47
Ok, I'll do it in another CL.
On 2014/09/23 16:02:
| |
90 .size() == 0) { | |
91 if (error) | |
92 *error = MULTIPROFILE_ADD_USER_ERROR_OUT_OF_USERS; | |
93 return false; | |
94 } | |
95 return SessionStateDelegate::CanAddUserToMultiProfile(error); | |
96 } | |
97 | |
86 bool SessionStateDelegateChromeos::IsActiveUserSessionStarted() const { | 98 bool SessionStateDelegateChromeos::IsActiveUserSessionStarted() const { |
87 return user_manager::UserManager::Get()->IsSessionStarted(); | 99 return user_manager::UserManager::Get()->IsSessionStarted(); |
88 } | 100 } |
89 | 101 |
90 bool SessionStateDelegateChromeos::CanLockScreen() const { | 102 bool SessionStateDelegateChromeos::CanLockScreen() const { |
91 const user_manager::UserList unlock_users = | 103 const user_manager::UserList unlock_users = |
92 user_manager::UserManager::Get()->GetUnlockUsers(); | 104 user_manager::UserManager::Get()->GetUnlockUsers(); |
93 return !unlock_users.empty(); | 105 return !unlock_users.empty(); |
94 } | 106 } |
95 | 107 |
(...skipping 176 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
272 } | 284 } |
273 | 285 |
274 void DoSwitchUser(const std::string& user_id) { | 286 void DoSwitchUser(const std::string& user_id) { |
275 user_manager::UserManager::Get()->SwitchActiveUser(user_id); | 287 user_manager::UserManager::Get()->SwitchActiveUser(user_id); |
276 } | 288 } |
277 | 289 |
278 void SessionStateDelegateChromeos::TryToSwitchUser( | 290 void SessionStateDelegateChromeos::TryToSwitchUser( |
279 const std::string& user_id) { | 291 const std::string& user_id) { |
280 ash::TrySwitchingActiveUser(base::Bind(&DoSwitchUser, user_id)); | 292 ash::TrySwitchingActiveUser(base::Bind(&DoSwitchUser, user_id)); |
281 } | 293 } |
OLD | NEW |