| 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/common/session/session_state_observer.h" | 7 #include "ash/common/session/session_state_observer.h" |
| 8 #include "ash/common/wm_window.h" | 8 #include "ash/common/wm_window.h" |
| 9 #include "ash/content/shell_content_state.h" | 9 #include "ash/content/shell_content_state.h" |
| 10 #include "base/bind.h" | 10 #include "base/bind.h" |
| (...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 59 if (chromeos::LoginState::IsInitialized()) | 59 if (chromeos::LoginState::IsInitialized()) |
| 60 chromeos::LoginState::Get()->RemoveObserver(this); | 60 chromeos::LoginState::Get()->RemoveObserver(this); |
| 61 } | 61 } |
| 62 | 62 |
| 63 int SessionStateDelegateChromeos::GetMaximumNumberOfLoggedInUsers() const { | 63 int SessionStateDelegateChromeos::GetMaximumNumberOfLoggedInUsers() const { |
| 64 // We limit list of logged in users to 10 due to memory constraints. | 64 // We limit list of logged in users to 10 due to memory constraints. |
| 65 // Note that 10 seems excessive, but we want to test how many users are | 65 // Note that 10 seems excessive, but we want to test how many users are |
| 66 // actually added to a session. | 66 // actually added to a session. |
| 67 // TODO(nkostylev): Adjust this limitation based on device capabilites. | 67 // TODO(nkostylev): Adjust this limitation based on device capabilites. |
| 68 // http://crbug.com/230865 | 68 // http://crbug.com/230865 |
| 69 return 10; | 69 return session_manager::kMaxmiumNumberOfUserSessions; |
| 70 } | 70 } |
| 71 | 71 |
| 72 int SessionStateDelegateChromeos::NumberOfLoggedInUsers() const { | 72 int SessionStateDelegateChromeos::NumberOfLoggedInUsers() const { |
| 73 return user_manager::UserManager::Get()->GetLoggedInUsers().size(); | 73 return user_manager::UserManager::Get()->GetLoggedInUsers().size(); |
| 74 } | 74 } |
| 75 | 75 |
| 76 ash::AddUserSessionPolicy | 76 ash::AddUserSessionPolicy |
| 77 SessionStateDelegateChromeos::GetAddUserSessionPolicy() const { | 77 SessionStateDelegateChromeos::GetAddUserSessionPolicy() const { |
| 78 return SessionControllerClient::GetAddUserSessionPolicy(); | 78 return SessionControllerClient::GetAddUserSessionPolicy(); |
| 79 } | 79 } |
| (...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 197 return; | 197 return; |
| 198 | 198 |
| 199 session_state_ = new_state; | 199 session_state_ = new_state; |
| 200 NotifySessionStateChanged(); | 200 NotifySessionStateChanged(); |
| 201 } | 201 } |
| 202 | 202 |
| 203 void SessionStateDelegateChromeos::NotifySessionStateChanged() { | 203 void SessionStateDelegateChromeos::NotifySessionStateChanged() { |
| 204 for (ash::SessionStateObserver& observer : session_state_observer_list_) | 204 for (ash::SessionStateObserver& observer : session_state_observer_list_) |
| 205 observer.SessionStateChanged(session_state_); | 205 observer.SessionStateChanged(session_state_); |
| 206 } | 206 } |
| OLD | NEW |