diff options
author | oshima@chromium.org <oshima@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-07-12 07:55:38 +0000 |
---|---|---|
committer | oshima@chromium.org <oshima@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-07-12 07:55:38 +0000 |
commit | b8984249eaca42461fc3266cc2b1d0057c71c840 (patch) | |
tree | d194b4a6214f7f2849c61c5197e47dbb7293c31b /ash/shelf | |
parent | 072865b7e912c0962ccbe999bba78f8631e3c730 (diff) | |
download | chromium_src-b8984249eaca42461fc3266cc2b1d0057c71c840.zip chromium_src-b8984249eaca42461fc3266cc2b1d0057c71c840.tar.gz chromium_src-b8984249eaca42461fc3266cc2b1d0057c71c840.tar.bz2 |
[Cleanup]
* Remove aura from DisplayManager
-Introduced DislayManager::Delegate to decouple DisplayController
- Moved methods that requires aura to DisplayController
- Changed to use DisplayInfo to get native bounds instead of
RootWindow.
* Moved mirror_window_controller_ from Shell to DisplayControlller.
This should belong to DC rather than Shell.
BUG=253991
Review URL: https://chromiumcodereview.appspot.com/19038002
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@211357 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ash/shelf')
-rw-r--r-- | ash/shelf/shelf_layout_manager_unittest.cc | 52 |
1 files changed, 26 insertions, 26 deletions
diff --git a/ash/shelf/shelf_layout_manager_unittest.cc b/ash/shelf/shelf_layout_manager_unittest.cc index e065bda..c778f08 100644 --- a/ash/shelf/shelf_layout_manager_unittest.cc +++ b/ash/shelf/shelf_layout_manager_unittest.cc @@ -593,13 +593,12 @@ TEST_F(ShelfLayoutManagerTest, MAYBE_SetVisible) { gfx::Rect launcher_bounds( shelf->GetWindowBoundsInScreen()); int shelf_height = manager->GetIdealBounds().height(); - - const gfx::Display& display = Shell::GetInstance()->display_manager()-> - GetDisplayNearestWindow(Shell::GetPrimaryRootWindow()); + gfx::Screen* screen = Shell::GetScreen(); + gfx::Display display = screen->GetDisplayNearestWindow( + Shell::GetPrimaryRootWindow()); ASSERT_NE(-1, display.id()); // Bottom inset should be the max of widget heights. - EXPECT_EQ(shelf_height, - display.bounds().bottom() - display.work_area().bottom()); + EXPECT_EQ(shelf_height, display.GetWorkAreaInsets().bottom()); // Hide the shelf. SetState(manager, SHELF_HIDDEN); @@ -607,14 +606,16 @@ TEST_F(ShelfLayoutManagerTest, MAYBE_SetVisible) { StepWidgetLayerAnimatorToEnd(shelf); StepWidgetLayerAnimatorToEnd(shelf->status_area_widget()); EXPECT_EQ(SHELF_HIDDEN, manager->visibility_state()); - EXPECT_EQ(0, - display.bounds().bottom() - display.work_area().bottom()); + display = screen->GetDisplayNearestWindow( + Shell::GetPrimaryRootWindow()); + + EXPECT_EQ(0, display.GetWorkAreaInsets().bottom()); // Make sure the bounds of the two widgets changed. EXPECT_GE(shelf->GetNativeView()->bounds().y(), - Shell::GetScreen()->GetPrimaryDisplay().bounds().bottom()); + screen->GetPrimaryDisplay().bounds().bottom()); EXPECT_GE(shelf->status_area_widget()->GetNativeView()->bounds().y(), - Shell::GetScreen()->GetPrimaryDisplay().bounds().bottom()); + screen->GetPrimaryDisplay().bounds().bottom()); // And show it again. SetState(manager, SHELF_VISIBLE); @@ -622,13 +623,14 @@ TEST_F(ShelfLayoutManagerTest, MAYBE_SetVisible) { StepWidgetLayerAnimatorToEnd(shelf); StepWidgetLayerAnimatorToEnd(shelf->status_area_widget()); EXPECT_EQ(SHELF_VISIBLE, manager->visibility_state()); - EXPECT_EQ(shelf_height, - display.bounds().bottom() - display.work_area().bottom()); + display = screen->GetDisplayNearestWindow( + Shell::GetPrimaryRootWindow()); + EXPECT_EQ(shelf_height, display.GetWorkAreaInsets().bottom()); // Make sure the bounds of the two widgets changed. launcher_bounds = shelf->GetNativeView()->bounds(); int bottom = - Shell::GetScreen()->GetPrimaryDisplay().bounds().bottom() - shelf_height; + screen->GetPrimaryDisplay().bounds().bottom() - shelf_height; EXPECT_EQ(launcher_bounds.y(), bottom + (manager->GetIdealBounds().height() - launcher_bounds.height()) / 2); @@ -644,14 +646,13 @@ TEST_F(ShelfLayoutManagerTest, LayoutShelfWhileAnimating) { shelf->shelf_layout_manager()->LayoutShelf(); EXPECT_EQ(SHELF_VISIBLE, shelf->shelf_layout_manager()->visibility_state()); - const gfx::Display& display = Shell::GetInstance()->display_manager()-> - GetDisplayNearestWindow(Shell::GetPrimaryRootWindow()); - // Hide the shelf. SetState(shelf->shelf_layout_manager(), SHELF_HIDDEN); shelf->shelf_layout_manager()->LayoutShelf(); EXPECT_EQ(SHELF_HIDDEN, shelf->shelf_layout_manager()->visibility_state()); - EXPECT_EQ(0, display.bounds().bottom() - display.work_area().bottom()); + gfx::Display display = Shell::GetScreen()->GetDisplayNearestWindow( + Shell::GetPrimaryRootWindow()); + EXPECT_EQ(0, display.GetWorkAreaInsets().bottom()); // Make sure the bounds of the two widgets changed. EXPECT_GE(shelf->GetNativeView()->bounds().y(), @@ -1163,10 +1164,9 @@ TEST_F(ShelfLayoutManagerTest, MAYBE_SetAlignment) { shelf->SetAlignment(SHELF_ALIGNMENT_LEFT); gfx::Rect launcher_bounds( GetShelfWidget()->GetWindowBoundsInScreen()); - const internal::DisplayManager* manager = - Shell::GetInstance()->display_manager(); + const gfx::Screen* screen = Shell::GetScreen(); gfx::Display display = - manager->GetDisplayNearestWindow(Shell::GetPrimaryRootWindow()); + screen->GetDisplayNearestWindow(Shell::GetPrimaryRootWindow()); ASSERT_NE(-1, display.id()); EXPECT_EQ(shelf->GetIdealBounds().width(), display.GetWorkAreaInsets().left()); @@ -1187,16 +1187,16 @@ TEST_F(ShelfLayoutManagerTest, MAYBE_SetAlignment) { EXPECT_EQ(display.bounds().y(), launcher_bounds.y()); EXPECT_EQ(display.bounds().height(), launcher_bounds.height()); shelf->SetAutoHideBehavior(SHELF_AUTO_HIDE_BEHAVIOR_ALWAYS); - display = manager->GetDisplayNearestWindow(Shell::GetPrimaryRootWindow()); + display = screen->GetDisplayNearestWindow(Shell::GetPrimaryRootWindow()); EXPECT_EQ(ShelfLayoutManager::kAutoHideSize, display.GetWorkAreaInsets().left()); EXPECT_EQ(ShelfLayoutManager::kAutoHideSize, display.work_area().x()); shelf->SetAutoHideBehavior(SHELF_AUTO_HIDE_BEHAVIOR_NEVER); shelf->SetAlignment(SHELF_ALIGNMENT_RIGHT); - display = manager->GetDisplayNearestWindow(Shell::GetPrimaryRootWindow()); + display = screen->GetDisplayNearestWindow(Shell::GetPrimaryRootWindow()); launcher_bounds = GetShelfWidget()->GetWindowBoundsInScreen(); - display = manager->GetDisplayNearestWindow(Shell::GetPrimaryRootWindow()); + display = screen->GetDisplayNearestWindow(Shell::GetPrimaryRootWindow()); ASSERT_NE(-1, display.id()); EXPECT_EQ(shelf->GetIdealBounds().width(), display.GetWorkAreaInsets().right()); @@ -1215,7 +1215,7 @@ TEST_F(ShelfLayoutManagerTest, MAYBE_SetAlignment) { EXPECT_EQ(display.bounds().y(), launcher_bounds.y()); EXPECT_EQ(display.bounds().height(), launcher_bounds.height()); shelf->SetAutoHideBehavior(SHELF_AUTO_HIDE_BEHAVIOR_ALWAYS); - display = manager->GetDisplayNearestWindow(Shell::GetPrimaryRootWindow()); + display = screen->GetDisplayNearestWindow(Shell::GetPrimaryRootWindow()); EXPECT_EQ(ShelfLayoutManager::kAutoHideSize, display.GetWorkAreaInsets().right()); EXPECT_EQ(ShelfLayoutManager::kAutoHideSize, @@ -1223,9 +1223,9 @@ TEST_F(ShelfLayoutManagerTest, MAYBE_SetAlignment) { shelf->SetAutoHideBehavior(SHELF_AUTO_HIDE_BEHAVIOR_NEVER); shelf->SetAlignment(SHELF_ALIGNMENT_TOP); - display = manager->GetDisplayNearestWindow(Shell::GetPrimaryRootWindow()); + display = screen->GetDisplayNearestWindow(Shell::GetPrimaryRootWindow()); launcher_bounds = GetShelfWidget()->GetWindowBoundsInScreen(); - display = manager->GetDisplayNearestWindow(Shell::GetPrimaryRootWindow()); + display = screen->GetDisplayNearestWindow(Shell::GetPrimaryRootWindow()); ASSERT_NE(-1, display.id()); EXPECT_EQ(shelf->GetIdealBounds().height(), display.GetWorkAreaInsets().top()); @@ -1244,7 +1244,7 @@ TEST_F(ShelfLayoutManagerTest, MAYBE_SetAlignment) { EXPECT_EQ(display.bounds().x(), launcher_bounds.x()); EXPECT_EQ(display.bounds().width(), launcher_bounds.width()); shelf->SetAutoHideBehavior(SHELF_AUTO_HIDE_BEHAVIOR_ALWAYS); - display = manager->GetDisplayNearestWindow(Shell::GetPrimaryRootWindow()); + display = screen->GetDisplayNearestWindow(Shell::GetPrimaryRootWindow()); EXPECT_EQ(ShelfLayoutManager::kAutoHideSize, display.GetWorkAreaInsets().top()); EXPECT_EQ(ShelfLayoutManager::kAutoHideSize, |