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

Unified Diff: chrome/browser/ui/ash/session_controller_client.cc

Issue 2625733003: Re-reland: chromeos: Fix shelf appearing at login screen under mash (Closed)
Patch Set: remove include 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 side-by-side diff with in-line comments
Download patch
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 b171cf2fb7707f3345cb3223abd6af7582f7aaee..fad60d44bd2d2948fd93239636db007fd33bbb8a 100644
--- a/chrome/browser/ui/ash/session_controller_client.cc
+++ b/chrome/browser/ui/ash/session_controller_client.cc
@@ -34,6 +34,8 @@ using user_manager::UserList;
namespace {
+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
@@ -83,9 +85,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;
+
SessionManager::Get()->RemoveObserver(this);
UserManager::Get()->RemoveSessionStateObserver(this);
}
@@ -225,6 +233,11 @@ void SessionControllerClient::DoCycleActiveUser(bool next_user) {
DoSwitchActiveUser(account_id);
}
+// static
+void SessionControllerClient::FlushForTesting() {
+ g_instance->session_controller_.FlushForTesting();
+}
+
void SessionControllerClient::OnSessionStateChanged() {
SendSessionInfoIfChanged();
}

Powered by Google App Engine
This is Rietveld 408576698