| Index: chrome/browser/ui/ash/session_controller_client.cc
|
| diff --git a/chrome/browser/ui/ash/session_controller_client.cc b/chrome/browser/ui/ash/session_controller_client.cc
|
| index 9406ff4fc33aa52e6d836b3a91857bad3037cdc0..372cf906f3ca0634b9c86179b8543580e83758f2 100644
|
| --- a/chrome/browser/ui/ash/session_controller_client.cc
|
| +++ b/chrome/browser/ui/ash/session_controller_client.cc
|
| @@ -36,6 +36,8 @@ namespace {
|
| // Limits the number of logged in users to 10 due to memory constraints.
|
| constexpr uint32_t kMaxUsers = 10;
|
|
|
| +SessionControllerClient* g_instance = nullptr;
|
| +
|
| uint32_t GetSessionId(const User* user) {
|
| const UserList logged_in_users = UserManager::Get()->GetLoggedInUsers();
|
| // TODO(xiyuan): Update with real session id when user session tracking
|
| @@ -85,9 +87,15 @@ SessionControllerClient::SessionControllerClient() : binding_(this) {
|
| SendSessionInfoIfChanged();
|
| // User sessions and their order will be sent via UserSessionStateObserver
|
| // even for crash-n-restart.
|
| +
|
| + DCHECK(!g_instance);
|
| + g_instance = this;
|
| }
|
|
|
| SessionControllerClient::~SessionControllerClient() {
|
| + DCHECK_EQ(this, g_instance);
|
| + g_instance = nullptr;
|
| +
|
| session_manager::SessionManager::Get()->RemoveObserver(this);
|
| UserManager::Get()->RemoveSessionStateObserver(this);
|
| }
|
| @@ -226,6 +234,11 @@ void SessionControllerClient::DoCycleActiveUser(bool next_user) {
|
| DoSwitchActiveUser(account_id);
|
| }
|
|
|
| +// static
|
| +void SessionControllerClient::FlushForTesting() {
|
| + g_instance->session_controller_.FlushForTesting();
|
| +}
|
| +
|
| void SessionControllerClient::OnSessionStateChanged() {
|
| SendSessionInfoIfChanged();
|
| }
|
|
|