[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
diff --git a/ash/extended_desktop_unittest.cc b/ash/extended_desktop_unittest.cc
index 4115523..36161e04 100644
--- a/ash/extended_desktop_unittest.cc
+++ b/ash/extended_desktop_unittest.cc
@@ -43,6 +43,10 @@
display_controller->SetLayoutForCurrentDisplays(layout);
}
+internal::DisplayManager* GetDisplayManager() {
+ return Shell::GetInstance()->display_manager();
+}
+
class ModalWidgetDelegate : public views::WidgetDelegateView {
public:
ModalWidgetDelegate() {}
@@ -60,10 +64,6 @@
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 @@
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 @@
// 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 @@
// 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 @@
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 @@
ash::Shell::GetInstance()->RemovePreTargetHandler(&event_handler);
}
-} // namespace internal
} // namespace ash