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/extended_desktop_unittest.cc | |
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/extended_desktop_unittest.cc')
-rw-r--r-- | ash/extended_desktop_unittest.cc | 24 |
1 files changed, 10 insertions, 14 deletions
diff --git a/ash/extended_desktop_unittest.cc b/ash/extended_desktop_unittest.cc index 4115523..36161e0 100644 --- a/ash/extended_desktop_unittest.cc +++ b/ash/extended_desktop_unittest.cc @@ -43,6 +43,10 @@ void SetSecondaryDisplayLayout(DisplayLayout::Position position) { display_controller->SetLayoutForCurrentDisplays(layout); } +internal::DisplayManager* GetDisplayManager() { + return Shell::GetInstance()->display_manager(); +} + class ModalWidgetDelegate : public views::WidgetDelegateView { public: ModalWidgetDelegate() {} @@ -60,10 +64,6 @@ class ModalWidgetDelegate : public views::WidgetDelegateView { DISALLOW_COPY_AND_ASSIGN(ModalWidgetDelegate); }; -internal::DisplayManager* GetDisplayManager() { - return Shell::GetInstance()->display_manager(); -} - // An event handler which moves the target window to the secondary root window // at pre-handle phase of a mouse release event. class MoveWindowByClickEventHandler : public ui::EventHandler { @@ -608,20 +608,17 @@ TEST_F(ExtendedDesktopTest, MoveWindowWithTransient) { w1_t1->GetWindowBoundsInScreen().ToString()); } -namespace internal { // Test if the Window::ConvertPointToTarget works across root windows. // TODO(oshima): Move multiple display suport and this test to aura. TEST_F(ExtendedDesktopTest, ConvertPoint) { if (!SupportsMultipleDisplays()) return; - + gfx::Screen* screen = Shell::GetInstance()->screen(); UpdateDisplay("1000x600,600x400"); Shell::RootWindowList root_windows = Shell::GetAllRootWindows(); - gfx::Display& display_1 = - GetDisplayManager()->FindDisplayForRootWindow(root_windows[0]); + gfx::Display display_1 = screen->GetDisplayNearestWindow(root_windows[0]); EXPECT_EQ("0,0", display_1.bounds().origin().ToString()); - gfx::Display& display_2 = - GetDisplayManager()->FindDisplayForRootWindow(root_windows[1]); + gfx::Display display_2 = screen->GetDisplayNearestWindow(root_windows[1]); EXPECT_EQ("1000,0", display_2.bounds().origin().ToString()); aura::Window* d1 = @@ -650,7 +647,7 @@ TEST_F(ExtendedDesktopTest, ConvertPoint) { // Move the 2nd display to the bottom and test again. SetSecondaryDisplayLayout(DisplayLayout::BOTTOM); - display_2 = GetDisplayManager()->FindDisplayForRootWindow(root_windows[1]); + display_2 = screen->GetDisplayNearestWindow(root_windows[1]); EXPECT_EQ("0,600", display_2.bounds().origin().ToString()); // Convert point in Root2's window to Root1's window Coord. @@ -730,7 +727,7 @@ TEST_F(ExtendedDesktopTest, StayInSameRootWindow) { // not move to another root window regardles of the bounds specified. aura::Window* settings_bubble_container = Shell::GetPrimaryRootWindowController()->GetContainer( - kShellWindowId_SettingBubbleContainer); + internal::kShellWindowId_SettingBubbleContainer); aura::Window* window = aura::test::CreateTestWindowWithId( 100, settings_bubble_container); window->SetBoundsInScreen(gfx::Rect(150, 10, 50, 50), @@ -739,7 +736,7 @@ TEST_F(ExtendedDesktopTest, StayInSameRootWindow) { aura::Window* status_container = Shell::GetPrimaryRootWindowController()->GetContainer( - kShellWindowId_StatusContainer); + internal::kShellWindowId_StatusContainer); window = aura::test::CreateTestWindowWithId(100, status_container); window->SetBoundsInScreen(gfx::Rect(150, 10, 50, 50), ScreenAsh::GetSecondaryDisplay()); @@ -850,5 +847,4 @@ TEST_F(ExtendedDesktopTest, PassiveGrab) { ash::Shell::GetInstance()->RemovePreTargetHandler(&event_handler); } -} // namespace internal } // namespace ash |