mash: Move SystemTrayDelegate ownership to WmShell
This makes it possible to use inside //ash/common.
(SystemTrayDelegate is a dependency of TrayUpdate, which I'm in the process
of moving to //ash/common.)
* Make WmShell non-pure-virtual
* Fix now-unneeded includes of shell.h
* Fix some unnecessary ash:: qualifiers along the way
BUG=615155
TEST=existing ash_unittests, chrome unit_tests and browser_tests
[email protected] for mechanical changes to //chrome/browser
Review-Url: https://codereview.chromium.org/2058173002
Cr-Commit-Position: refs/heads/master@{#399277}
diff --git a/ash/root_window_controller_unittest.cc b/ash/root_window_controller_unittest.cc
index 6f974ddd..ee08285 100644
--- a/ash/root_window_controller_unittest.cc
+++ b/ash/root_window_controller_unittest.cc
@@ -10,6 +10,7 @@
#include "ash/common/shell_window_ids.h"
#include "ash/common/system/tray/system_tray_delegate.h"
#include "ash/common/wm/window_state.h"
+#include "ash/common/wm_shell.h"
#include "ash/display/display_manager.h"
#include "ash/shell.h"
#include "ash/test/ash_test_base.h"
@@ -370,9 +371,10 @@
TEST_F(RootWindowControllerTest, ModalContainer) {
UpdateDisplay("600x600");
Shell* shell = Shell::GetInstance();
+ WmShell* wm_shell = WmShell::Get();
RootWindowController* controller = shell->GetPrimaryRootWindowController();
EXPECT_EQ(LoginStatus::USER,
- shell->system_tray_delegate()->GetUserLoginStatus());
+ wm_shell->system_tray_delegate()->GetUserLoginStatus());
EXPECT_EQ(controller->GetContainer(kShellWindowId_SystemModalContainer)
->layout_manager(),
controller->GetSystemModalLayoutManager(NULL));
@@ -386,7 +388,7 @@
shell->session_state_delegate()->LockScreen();
EXPECT_EQ(LoginStatus::LOCKED,
- shell->system_tray_delegate()->GetUserLoginStatus());
+ wm_shell->system_tray_delegate()->GetUserLoginStatus());
EXPECT_EQ(controller->GetContainer(kShellWindowId_LockSystemModalContainer)
->layout_manager(),
controller->GetSystemModalLayoutManager(NULL));
@@ -410,11 +412,12 @@
TEST_F(RootWindowControllerTest, ModalContainerNotLoggedInLoggedIn) {
UpdateDisplay("600x600");
Shell* shell = Shell::GetInstance();
+ WmShell* wm_shell = WmShell::Get();
// Configure login screen environment.
SetUserLoggedIn(false);
EXPECT_EQ(LoginStatus::NOT_LOGGED_IN,
- shell->system_tray_delegate()->GetUserLoginStatus());
+ wm_shell->system_tray_delegate()->GetUserLoginStatus());
EXPECT_EQ(0, shell->session_state_delegate()->NumberOfLoggedInUsers());
EXPECT_FALSE(shell->session_state_delegate()->IsActiveUserSessionStarted());
@@ -437,7 +440,7 @@
SetUserLoggedIn(true);
SetSessionStarted(true);
EXPECT_EQ(LoginStatus::USER,
- shell->system_tray_delegate()->GetUserLoginStatus());
+ wm_shell->system_tray_delegate()->GetUserLoginStatus());
EXPECT_EQ(1, shell->session_state_delegate()->NumberOfLoggedInUsers());
EXPECT_TRUE(shell->session_state_delegate()->IsActiveUserSessionStarted());
EXPECT_EQ(controller->GetContainer(kShellWindowId_SystemModalContainer)