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

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

Issue 2573703003: chromeos: Fix shelf appearing at login screen under mash (Closed)
Patch Set: msw comments Created 4 years 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 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();
}
« no previous file with comments | « chrome/browser/ui/ash/session_controller_client.h ('k') | chrome/browser/ui/views/ash/chrome_browser_main_extra_parts_ash.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698