Index: ash/wm/shelf_layout_manager_unittest.cc |
diff --git a/ash/wm/shelf_layout_manager_unittest.cc b/ash/wm/shelf_layout_manager_unittest.cc |
index aa2f44a8137615ca5ccfa9530d1d49cc3305114a..1f465e1436b6b274251e07dd28f17723338888c6 100644 |
--- a/ash/wm/shelf_layout_manager_unittest.cc |
+++ b/ash/wm/shelf_layout_manager_unittest.cc |
@@ -9,6 +9,7 @@ |
#include "ash/ash_switches.h" |
#include "ash/focus_cycler.h" |
#include "ash/launcher/launcher.h" |
+#include "ash/root_window_controller.h" |
#include "ash/screen_ash.h" |
#include "ash/shell.h" |
#include "ash/shell_delegate.h" |
@@ -152,6 +153,10 @@ class ShelfLayoutManagerTest : public ash::test::AshTestBase { |
public: |
ShelfLayoutManagerTest() {} |
+ ShelfLayoutManager* shelf_layout_manager() { |
+ return Shell::GetPrimaryRootWindowController()->shelf(); |
+ } |
+ |
void SetState(ShelfLayoutManager* shelf, |
ShelfLayoutManager::VisibilityState state) { |
shelf->SetState(state); |
@@ -270,7 +275,7 @@ TEST_F(ShelfLayoutManagerTest, LayoutShelfWhileAnimating) { |
// Makes sure the launcher is initially sized correctly. |
TEST_F(ShelfLayoutManagerTest, LauncherInitiallySized) { |
- Launcher* launcher = Shell::GetInstance()->launcher(); |
+ Launcher* launcher = Launcher::ForPrimaryDisplay(); |
ASSERT_TRUE(launcher); |
ShelfLayoutManager* shelf_layout_manager = GetShelfLayoutManager(); |
ASSERT_TRUE(shelf_layout_manager); |
@@ -284,7 +289,7 @@ TEST_F(ShelfLayoutManagerTest, LauncherInitiallySized) { |
// Makes sure the launcher is sized when the status area changes size. |
TEST_F(ShelfLayoutManagerTest, LauncherUpdatedWhenStatusAreaChangesSize) { |
- Launcher* launcher = Shell::GetInstance()->launcher(); |
+ Launcher* launcher = Launcher::ForPrimaryDisplay(); |
ASSERT_TRUE(launcher); |
ShelfLayoutManager* shelf_layout_manager = GetShelfLayoutManager(); |
ASSERT_TRUE(shelf_layout_manager); |
@@ -508,7 +513,7 @@ TEST_F(ShelfLayoutManagerTest, VisibleWhenStatusOrLauncherFocused) { |
// state,and toggling app list won't change shelf visibility state. |
TEST_F(ShelfLayoutManagerTest, OpenAppListWithShelfVisibleState) { |
Shell* shell = Shell::GetInstance(); |
- ShelfLayoutManager* shelf = Shell::GetInstance()->shelf(); |
+ ShelfLayoutManager* shelf = shelf_layout_manager(); |
shelf->LayoutShelf(); |
shell->SetShelfAutoHideBehavior(SHELF_AUTO_HIDE_BEHAVIOR_NEVER); |
@@ -535,7 +540,7 @@ TEST_F(ShelfLayoutManagerTest, OpenAppListWithShelfVisibleState) { |
// visibility state. |
TEST_F(ShelfLayoutManagerTest, OpenAppListWithShelfAutoHideState) { |
Shell* shell = Shell::GetInstance(); |
- ShelfLayoutManager* shelf = Shell::GetInstance()->shelf(); |
+ ShelfLayoutManager* shelf = shelf_layout_manager(); |
shelf->LayoutShelf(); |
shell->SetShelfAutoHideBehavior(SHELF_AUTO_HIDE_BEHAVIOR_ALWAYS); |
@@ -569,7 +574,7 @@ TEST_F(ShelfLayoutManagerTest, OpenAppListWithShelfAutoHideState) { |
// state, and toggling app list won't change shelf visibility state. |
TEST_F(ShelfLayoutManagerTest, OpenAppListWithShelfHiddenState) { |
Shell* shell = Shell::GetInstance(); |
- ShelfLayoutManager* shelf = Shell::GetInstance()->shelf(); |
+ ShelfLayoutManager* shelf = shelf_layout_manager(); |
// For shelf to be visible, app list is not open in initial state. |
shelf->LayoutShelf(); |
@@ -597,7 +602,7 @@ TEST_F(ShelfLayoutManagerTest, OpenAppListWithShelfHiddenState) { |
// Tests SHELF_ALIGNMENT_LEFT and SHELF_ALIGNMENT_RIGHT. |
TEST_F(ShelfLayoutManagerTest, SetAlignment) { |
- ShelfLayoutManager* shelf = GetShelfLayoutManager(); |
+ ShelfLayoutManager* shelf = shelf_layout_manager(); |
// Force an initial layout. |
shelf->LayoutShelf(); |
EXPECT_EQ(ShelfLayoutManager::VISIBLE, shelf->visibility_state()); |
@@ -883,39 +888,39 @@ TEST_F(ShelfLayoutManagerTest, WorkAreaChangeWorkspace) { |
// Confirm that the shelf is dimmed only when content is maximized and |
// shelf is not autohidden. |
TEST_F(ShelfLayoutManagerTest, Dimming) { |
- Shell::GetInstance()->shelf()->SetAutoHideBehavior( |
- SHELF_AUTO_HIDE_BEHAVIOR_NEVER); |
+ shelf_layout_manager()->SetAutoHideBehavior(SHELF_AUTO_HIDE_BEHAVIOR_NEVER); |
scoped_ptr<aura::Window> w1(CreateTestWindow()); |
w1->Show(); |
wm::ActivateWindow(w1.get()); |
// Normal window doesn't dim shelf. |
w1->SetProperty(aura::client::kShowStateKey, ui::SHOW_STATE_NORMAL); |
- EXPECT_FALSE(Shell::GetInstance()->launcher()->GetDimsShelf()); |
+ Launcher* launcher = Launcher::ForPrimaryDisplay(); |
+ EXPECT_FALSE(launcher->GetDimsShelf()); |
// Maximized window does. |
w1->SetProperty(aura::client::kShowStateKey, ui::SHOW_STATE_MAXIMIZED); |
- EXPECT_TRUE(Shell::GetInstance()->launcher()->GetDimsShelf()); |
+ EXPECT_TRUE(launcher->GetDimsShelf()); |
// Change back to normal stops dimming. |
w1->SetProperty(aura::client::kShowStateKey, ui::SHOW_STATE_NORMAL); |
- EXPECT_FALSE(Shell::GetInstance()->launcher()->GetDimsShelf()); |
+ EXPECT_FALSE(launcher->GetDimsShelf()); |
// Changing back to maximized dims again. |
w1->SetProperty(aura::client::kShowStateKey, ui::SHOW_STATE_MAXIMIZED); |
- EXPECT_TRUE(Shell::GetInstance()->launcher()->GetDimsShelf()); |
+ EXPECT_TRUE(launcher->GetDimsShelf()); |
// Changing shelf to autohide stops dimming. |
- Shell::GetInstance()->shelf()->SetAutoHideBehavior( |
- SHELF_AUTO_HIDE_BEHAVIOR_ALWAYS); |
- EXPECT_FALSE(Shell::GetInstance()->launcher()->GetDimsShelf()); |
+ shelf_layout_manager()->SetAutoHideBehavior(SHELF_AUTO_HIDE_BEHAVIOR_ALWAYS); |
+ EXPECT_FALSE(launcher->GetDimsShelf()); |
} |
// Make sure that the shelf will not hide if the mouse is between a bubble and |
// the shelf. |
TEST_F(ShelfLayoutManagerTest, BubbleEnlargesShelfMouseHitArea) { |
ShelfLayoutManager* shelf = GetShelfLayoutManager(); |
- StatusAreaWidget* status_area = Shell::GetInstance()->status_area_widget(); |
+ StatusAreaWidget* status_area = |
+ Shell::GetPrimaryRootWindowController()->status_area_widget(); |
SystemTray* tray = Shell::GetInstance()->system_tray(); |
shelf->LayoutShelf(); |