Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(272)

Side by Side Diff: chrome/browser/ui/ash/session_controller_client.cc

Issue 2617883002: Add a new BindInterface() method to Connector. (Closed)
Patch Set: . Created 3 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « chrome/browser/ui/ash/media_client.cc ('k') | chrome/browser/ui/ash/system_tray_client.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/ash/media_client.cc ('k') | chrome/browser/ui/ash/system_tray_client.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698