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 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
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( | 86 bool SessionStateDelegateChromeos::CanAddUserToMultiProfile( |
87 AddUserError* error) const { | 87 AddUserError* error) const { |
88 if (user_manager::UserManager::Get() | 88 if (user_manager::UserManager::Get() |
89 ->GetUsersAdmittedForMultiProfile() | 89 ->GetUsersAllowedForMultiProfile() |
90 .size() == 0) { | 90 .size() == 0) { |
91 if (error) | 91 if (error) |
92 *error = ADD_USER_ERROR_OUT_OF_USERS; | 92 *error = ADD_USER_ERROR_OUT_OF_USERS; |
93 return false; | 93 return false; |
94 } | 94 } |
95 return SessionStateDelegate::CanAddUserToMultiProfile(error); | 95 return SessionStateDelegate::CanAddUserToMultiProfile(error); |
96 } | 96 } |
97 | 97 |
98 bool SessionStateDelegateChromeos::IsActiveUserSessionStarted() const { | 98 bool SessionStateDelegateChromeos::IsActiveUserSessionStarted() const { |
99 return user_manager::UserManager::Get()->IsSessionStarted(); | 99 return user_manager::UserManager::Get()->IsSessionStarted(); |
(...skipping 184 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 |