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 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
93 | 93 |
94 SessionControllerClient::~SessionControllerClient() { | 94 SessionControllerClient::~SessionControllerClient() { |
95 DCHECK_EQ(this, g_instance); | 95 DCHECK_EQ(this, g_instance); |
96 g_instance = nullptr; | 96 g_instance = nullptr; |
97 | 97 |
98 SessionManager::Get()->RemoveObserver(this); | 98 SessionManager::Get()->RemoveObserver(this); |
99 UserManager::Get()->RemoveObserver(this); | 99 UserManager::Get()->RemoveObserver(this); |
100 UserManager::Get()->RemoveSessionStateObserver(this); | 100 UserManager::Get()->RemoveSessionStateObserver(this); |
101 } | 101 } |
102 | 102 |
| 103 // static |
| 104 SessionControllerClient* SessionControllerClient::Get() { |
| 105 return g_instance; |
| 106 } |
| 107 |
| 108 void SessionControllerClient::RunUnlockAnimation( |
| 109 base::Closure animation_finished_callback) { |
| 110 session_controller_->RunUnlockAnimation(animation_finished_callback); |
| 111 } |
| 112 |
103 void SessionControllerClient::RequestLockScreen() { | 113 void SessionControllerClient::RequestLockScreen() { |
104 DoLockScreen(); | 114 DoLockScreen(); |
105 } | 115 } |
106 | 116 |
107 void SessionControllerClient::SwitchActiveUser(const AccountId& account_id) { | 117 void SessionControllerClient::SwitchActiveUser(const AccountId& account_id) { |
108 DoSwitchActiveUser(account_id); | 118 DoSwitchActiveUser(account_id); |
109 } | 119 } |
110 | 120 |
111 void SessionControllerClient::CycleActiveUser( | 121 void SessionControllerClient::CycleActiveUser( |
112 ash::CycleUserDirection direction) { | 122 ash::CycleUserDirection direction) { |
(...skipping 176 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
289 const UserList logged_in_users = user_manager->GetLoggedInUsers(); | 299 const UserList logged_in_users = user_manager->GetLoggedInUsers(); |
290 std::vector<uint32_t> user_session_ids; | 300 std::vector<uint32_t> user_session_ids; |
291 for (auto* user : user_manager->GetLRULoggedInUsers()) { | 301 for (auto* user : user_manager->GetLRULoggedInUsers()) { |
292 const uint32_t user_session_id = GetSessionId(*user); | 302 const uint32_t user_session_id = GetSessionId(*user); |
293 DCHECK_NE(0u, user_session_id); | 303 DCHECK_NE(0u, user_session_id); |
294 user_session_ids.push_back(user_session_id); | 304 user_session_ids.push_back(user_session_id); |
295 } | 305 } |
296 | 306 |
297 session_controller_->SetUserSessionOrder(user_session_ids); | 307 session_controller_->SetUserSessionOrder(user_session_ids); |
298 } | 308 } |
OLD | NEW |