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

Unified Diff: ash/common/wm_shell.cc

Issue 2734933004: ash: Use SessionController instead of SessionStateDelegate (Closed)
Patch Set: rebase Created 3 years, 9 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: ash/common/wm_shell.cc
diff --git a/ash/common/wm_shell.cc b/ash/common/wm_shell.cc
index 0ddea52b2de12fd25432d17d42254799a86d6047..d00fa98b53fb88ab090e68110fd07593154edab8 100644
--- a/ash/common/wm_shell.cc
+++ b/ash/common/wm_shell.cc
@@ -83,8 +83,8 @@ ShelfModel* WmShell::shelf_model() {
void WmShell::ShowContextMenu(const gfx::Point& location_in_screen,
ui::MenuSourceType source_type) {
// Bail if there is no active user session or if the screen is locked.
- if (GetSessionStateDelegate()->NumberOfLoggedInUsers() < 1 ||
- GetSessionStateDelegate()->IsScreenLocked()) {
+ if (session_controller()->NumberOfLoggedInUsers() < 1 ||
+ session_controller()->IsScreenLocked()) {
return;
}
@@ -95,8 +95,9 @@ void WmShell::ShowContextMenu(const gfx::Point& location_in_screen,
void WmShell::CreateShelfView() {
// Must occur after SessionStateDelegate creation and user login.
James Cook 2017/03/17 17:14:36 Is this comment still correct?
xiyuan 2017/03/17 22:52:02 Removed. SessionStateDelegate is no longer relevan
- DCHECK(GetSessionStateDelegate());
- DCHECK_GT(GetSessionStateDelegate()->NumberOfLoggedInUsers(), 0);
+ // Must occur after SessionController creation and user login.
+ DCHECK(session_controller());
+ DCHECK_GT(session_controller()->NumberOfLoggedInUsers(), 0);
CreateShelfDelegate();
for (WmWindow* root_window : GetAllRootWindows())
@@ -107,11 +108,11 @@ void WmShell::CreateShelfDelegate() {
// May be called multiple times as shelves are created and destroyed.
if (shelf_delegate_)
return;
- // Must occur after SessionStateDelegate creation and user login because
+ // Must occur after SessionController creation and user login because
// Chrome's implementation of ShelfDelegate assumes it can get information
// about multi-profile login state.
- DCHECK(GetSessionStateDelegate());
- DCHECK_GT(GetSessionStateDelegate()->NumberOfLoggedInUsers(), 0);
+ DCHECK(session_controller());
+ DCHECK_GT(session_controller()->NumberOfLoggedInUsers(), 0);
shelf_delegate_.reset(
Shell::Get()->shell_delegate()->CreateShelfDelegate(shelf_model()));
shelf_window_watcher_.reset(new ShelfWindowWatcher(shelf_model()));

Powered by Google App Engine
This is Rietveld 408576698