| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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_controller_client.h" | 5 #include "chrome/browser/ui/ash/session_controller_client.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 #include <utility> | 8 #include <utility> |
| 9 | 9 |
| 10 #include "ash/public/cpp/session_types.h" | 10 #include "ash/public/cpp/session_types.h" |
| (...skipping 228 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 239 g_instance->session_controller_.FlushForTesting(); | 239 g_instance->session_controller_.FlushForTesting(); |
| 240 } | 240 } |
| 241 | 241 |
| 242 void SessionControllerClient::OnSessionStateChanged() { | 242 void SessionControllerClient::OnSessionStateChanged() { |
| 243 SendSessionInfoIfChanged(); | 243 SendSessionInfoIfChanged(); |
| 244 } | 244 } |
| 245 | 245 |
| 246 void SessionControllerClient::ConnectToSessionControllerAndSetClient() { | 246 void SessionControllerClient::ConnectToSessionControllerAndSetClient() { |
| 247 content::ServiceManagerConnection::GetForProcess() | 247 content::ServiceManagerConnection::GetForProcess() |
| 248 ->GetConnector() | 248 ->GetConnector() |
| 249 ->ConnectToInterface(ash_util::GetAshServiceName(), &session_controller_); | 249 ->BindInterface(ash_util::GetAshServiceName(), &session_controller_); |
| 250 | 250 |
| 251 // Set as |session_controller_|'s client. | 251 // Set as |session_controller_|'s client. |
| 252 session_controller_->SetClient(binding_.CreateInterfacePtrAndBind()); | 252 session_controller_->SetClient(binding_.CreateInterfacePtrAndBind()); |
| 253 } | 253 } |
| 254 | 254 |
| 255 void SessionControllerClient::SendSessionInfoIfChanged() { | 255 void SessionControllerClient::SendSessionInfoIfChanged() { |
| 256 ash::mojom::SessionInfoPtr info = ash::mojom::SessionInfo::New(); | 256 ash::mojom::SessionInfoPtr info = ash::mojom::SessionInfo::New(); |
| 257 info->max_users = kMaxUsers; | 257 info->max_users = kMaxUsers; |
| 258 info->can_lock_screen = CanLockScreen(); | 258 info->can_lock_screen = CanLockScreen(); |
| 259 info->should_lock_screen_automatically = ShouldLockScreenAutomatically(); | 259 info->should_lock_screen_automatically = ShouldLockScreenAutomatically(); |
| (...skipping 13 matching lines...) Expand all Loading... |
| 273 void SessionControllerClient::SendUserSessionOrder() { | 273 void SessionControllerClient::SendUserSessionOrder() { |
| 274 UserManager* const user_manager = UserManager::Get(); | 274 UserManager* const user_manager = UserManager::Get(); |
| 275 | 275 |
| 276 const UserList logged_in_users = user_manager->GetLoggedInUsers(); | 276 const UserList logged_in_users = user_manager->GetLoggedInUsers(); |
| 277 std::vector<uint32_t> user_session_ids; | 277 std::vector<uint32_t> user_session_ids; |
| 278 for (auto* user : user_manager->GetLRULoggedInUsers()) | 278 for (auto* user : user_manager->GetLRULoggedInUsers()) |
| 279 user_session_ids.push_back(GetSessionId(user)); | 279 user_session_ids.push_back(GetSessionId(user)); |
| 280 | 280 |
| 281 session_controller_->SetUserSessionOrder(user_session_ids); | 281 session_controller_->SetUserSessionOrder(user_session_ids); |
| 282 } | 282 } |
| OLD | NEW |