diff options
61 files changed, 272 insertions, 261 deletions
diff --git a/ash/accelerators/accelerator_controller.cc b/ash/accelerators/accelerator_controller.cc index efb9098..b4acff9 100644 --- a/ash/accelerators/accelerator_controller.cc +++ b/ash/accelerators/accelerator_controller.cc @@ -329,10 +329,11 @@ bool HandleMediaPrevTrack() { } bool HandlePrintLayerHierarchy() { - Shell::RootWindowList root_windows = Shell::GetAllRootWindows(); + aura::Window::Windows root_windows = Shell::GetAllRootWindows(); for (size_t i = 0; i < root_windows.size(); ++i) { - ui::PrintLayerHierarchy(root_windows[i]->layer(), - root_windows[i]->GetLastMouseLocationInRoot()); + ui::PrintLayerHierarchy( + root_windows[i]->layer(), + root_windows[i]->GetDispatcher()->GetLastMouseLocationInRoot()); } return true; } diff --git a/ash/accelerators/accelerator_filter.cc b/ash/accelerators/accelerator_filter.cc index 57ac695..1ce80c7 100644 --- a/ash/accelerators/accelerator_filter.cc +++ b/ash/accelerators/accelerator_filter.cc @@ -58,7 +58,7 @@ bool ShouldProcessAcceleratorsNow(const ui::Accelerator& accelerator, if (!target) return true; - Shell::RootWindowList root_windows = Shell::GetAllRootWindows(); + aura::Window::Windows root_windows = Shell::GetAllRootWindows(); if (std::find(root_windows.begin(), root_windows.end(), target) != root_windows.end()) return true; diff --git a/ash/autoclick/autoclick_unittest.cc b/ash/autoclick/autoclick_unittest.cc index f081c32b..96f17cf 100644 --- a/ash/autoclick/autoclick_unittest.cc +++ b/ash/autoclick/autoclick_unittest.cc @@ -218,7 +218,7 @@ TEST_F(AutoclickTest, KeyModifiersReleased) { TEST_F(AutoclickTest, ExtendedDisplay) { UpdateDisplay("1280x1024,800x600"); RunAllPendingInMessageLoop(); - Shell::RootWindowList root_windows = Shell::GetAllRootWindows(); + aura::Window::Windows root_windows = Shell::GetAllRootWindows(); EXPECT_EQ(2u, root_windows.size()); GetAutoclickController()->SetEnabled(true); diff --git a/ash/debug.cc b/ash/debug.cc index 060627c..f5c6220 100644 --- a/ash/debug.cc +++ b/ash/debug.cc @@ -13,12 +13,12 @@ namespace ash { namespace debug { void ToggleShowDebugBorders() { - Shell::RootWindowList root_windows = + aura::Window::Windows root_windows = Shell::GetInstance()->GetAllRootWindows(); scoped_ptr<bool> value; - for (Shell::RootWindowList::iterator it = root_windows.begin(); + for (aura::Window::Windows::iterator it = root_windows.begin(); it != root_windows.end(); ++it) { - ui::Compositor* compositor = (*it)->compositor(); + ui::Compositor* compositor = (*it)->GetDispatcher()->compositor(); cc::LayerTreeDebugState state = compositor->GetLayerTreeDebugState(); if (!value.get()) value.reset(new bool(!state.show_debug_borders)); @@ -28,12 +28,12 @@ void ToggleShowDebugBorders() { } void ToggleShowFpsCounter() { - Shell::RootWindowList root_windows = + aura::Window::Windows root_windows = Shell::GetInstance()->GetAllRootWindows(); scoped_ptr<bool> value; - for (Shell::RootWindowList::iterator it = root_windows.begin(); + for (aura::Window::Windows::iterator it = root_windows.begin(); it != root_windows.end(); ++it) { - ui::Compositor* compositor = (*it)->compositor(); + ui::Compositor* compositor = (*it)->GetDispatcher()->compositor(); cc::LayerTreeDebugState state = compositor->GetLayerTreeDebugState(); if (!value.get()) value.reset(new bool(!state.show_fps_counter)); @@ -43,12 +43,12 @@ void ToggleShowFpsCounter() { } void ToggleShowPaintRects() { - Shell::RootWindowList root_windows = + aura::Window::Windows root_windows = Shell::GetInstance()->GetAllRootWindows(); scoped_ptr<bool> value; - for (Shell::RootWindowList::iterator it = root_windows.begin(); + for (aura::Window::Windows::iterator it = root_windows.begin(); it != root_windows.end(); ++it) { - ui::Compositor* compositor = (*it)->compositor(); + ui::Compositor* compositor = (*it)->GetDispatcher()->compositor(); cc::LayerTreeDebugState state = compositor->GetLayerTreeDebugState(); if (!value.get()) value.reset(new bool(!state.show_paint_rects)); diff --git a/ash/desktop_background/desktop_background_controller.cc b/ash/desktop_background/desktop_background_controller.cc index 0959bb6..8673d0f 100644 --- a/ash/desktop_background/desktop_background_controller.cc +++ b/ash/desktop_background/desktop_background_controller.cc @@ -362,7 +362,7 @@ void DesktopBackgroundController::OnDefaultWallpaperLoadCompleted( } void DesktopBackgroundController::InstallDesktopController( - aura::RootWindow* root_window) { + aura::Window* root_window) { internal::DesktopBackgroundWidgetController* component = NULL; int container_id = GetBackgroundContainerId(locked_); @@ -385,8 +385,8 @@ void DesktopBackgroundController::InstallDesktopController( } void DesktopBackgroundController::InstallDesktopControllerForAllWindows() { - Shell::RootWindowList root_windows = Shell::GetAllRootWindows(); - for (Shell::RootWindowList::iterator iter = root_windows.begin(); + aura::Window::Windows root_windows = Shell::GetAllRootWindows(); + for (aura::Window::Windows::iterator iter = root_windows.begin(); iter != root_windows.end(); ++iter) { InstallDesktopController(*iter); } diff --git a/ash/desktop_background/desktop_background_controller.h b/ash/desktop_background/desktop_background_controller.h index fdcd748..55a816a 100644 --- a/ash/desktop_background/desktop_background_controller.h +++ b/ash/desktop_background/desktop_background_controller.h @@ -160,7 +160,7 @@ class ASH_EXPORT DesktopBackgroundController // Creates and adds component for current mode (either Widget or Layer) to // |root_window|. - void InstallDesktopController(aura::RootWindow* root_window); + void InstallDesktopController(aura::Window* root_window); // Creates and adds component for current mode (either Widget or Layer) to // all root windows. diff --git a/ash/desktop_background/desktop_background_view.cc b/ash/desktop_background/desktop_background_view.cc index db1b27d..5eb5072 100644 --- a/ash/desktop_background/desktop_background_view.cc +++ b/ash/desktop_background/desktop_background_view.cc @@ -174,7 +174,7 @@ void DesktopBackgroundView::ShowContextMenuForView( Shell::GetInstance()->ShowContextMenu(point, source_type); } -views::Widget* CreateDesktopBackground(aura::RootWindow* root_window, +views::Widget* CreateDesktopBackground(aura::Window* root_window, int container_id) { DesktopBackgroundController* controller = Shell::GetInstance()->desktop_background_controller(); diff --git a/ash/display/display_controller.cc b/ash/display/display_controller.cc index 8a0b6b9..4d73983 100644 --- a/ash/display/display_controller.cc +++ b/ash/display/display_controller.cc @@ -341,8 +341,8 @@ void DisplayController::CloseChildWindows() { } } -std::vector<aura::RootWindow*> DisplayController::GetAllRootWindows() { - std::vector<aura::RootWindow*> windows; +aura::Window::Windows DisplayController::GetAllRootWindows() { + aura::Window::Windows windows; for (std::map<int64, aura::RootWindow*>::const_iterator it = root_windows_.begin(); it != root_windows_.end(); ++it) { DCHECK(it->second); @@ -790,7 +790,7 @@ void DisplayController::UpdateHostWindowNames() { // to "aura_root_0" so gtalk can find the primary root window to broadcast. // TODO(jhorwich) Remove this once Chrome supports window-based broadcasting. aura::Window* primary = Shell::GetPrimaryRootWindow(); - Shell::RootWindowList root_windows = Shell::GetAllRootWindows(); + aura::Window::Windows root_windows = Shell::GetAllRootWindows(); for (size_t i = 0; i < root_windows.size(); ++i) { std::string name = root_windows[i] == primary ? "aura_root_0" : "aura_root_x"; diff --git a/ash/display/display_controller.h b/ash/display/display_controller.h index ec84a58..07c4fa1 100644 --- a/ash/display/display_controller.h +++ b/ash/display/display_controller.h @@ -17,6 +17,7 @@ #include "base/observer_list.h" #include "base/time/time.h" #include "ui/aura/root_window_observer.h" +#include "ui/aura/window.h" #include "ui/gfx/display_observer.h" #include "ui/gfx/point.h" @@ -118,7 +119,7 @@ class ASH_EXPORT DisplayController : public gfx::DisplayObserver, // Returns all root windows. In non extended desktop mode, this // returns the primary root window only. - std::vector<aura::RootWindow*> GetAllRootWindows(); + aura::Window::Windows GetAllRootWindows(); // Returns all oot window controllers. In non extended desktop // mode, this return a RootWindowController for the primary root window only. diff --git a/ash/display/display_controller_unittest.cc b/ash/display/display_controller_unittest.cc index a422109..e45db13 100644 --- a/ash/display/display_controller_unittest.cc +++ b/ash/display/display_controller_unittest.cc @@ -282,7 +282,7 @@ float GetStoredUIScale(int64 id) { void GetPrimaryAndSeconary(aura::Window** primary, aura::Window** secondary) { *primary = Shell::GetPrimaryRootWindow(); - Shell::RootWindowList root_windows = Shell::GetAllRootWindows(); + aura::Window::Windows root_windows = Shell::GetAllRootWindows(); *secondary = root_windows[0] == *primary ? root_windows[1] : root_windows[0]; } @@ -905,7 +905,7 @@ TEST_F(DisplayControllerTest, OverscanInsets) { UpdateDisplay("120x200,300x400*2"); gfx::Display display1 = Shell::GetScreen()->GetPrimaryDisplay(); - Shell::RootWindowList root_windows = Shell::GetAllRootWindows(); + aura::Window::Windows root_windows = Shell::GetAllRootWindows(); display_controller->SetOverscanInsets(display1.id(), gfx::Insets(10, 15, 20, 25)); @@ -931,12 +931,14 @@ TEST_F(DisplayControllerTest, OverscanInsets) { UpdateDisplay("400x300*2,600x400/o"); root_windows = Shell::GetAllRootWindows(); gfx::Point point; - Shell::GetAllRootWindows()[1]->GetRootTransform().TransformPoint(&point); + Shell::GetAllRootWindows()[1]->GetDispatcher()-> + GetRootTransform().TransformPoint(&point); EXPECT_EQ("15,10", point.ToString()); display_controller->SwapPrimaryDisplay(); point.SetPoint(0, 0); - Shell::GetAllRootWindows()[1]->GetRootTransform().TransformPoint(&point); + Shell::GetAllRootWindows()[1]->GetDispatcher()-> + GetRootTransform().TransformPoint(&point); EXPECT_EQ("15,10", point.ToString()); Shell::GetInstance()->RemovePreTargetHandler(&event_handler); @@ -954,7 +956,7 @@ TEST_F(DisplayControllerTest, Rotate) { UpdateDisplay("120x200,300x400*2"); gfx::Display display1 = Shell::GetScreen()->GetPrimaryDisplay(); int64 display2_id = ScreenAsh::GetSecondaryDisplay().id(); - Shell::RootWindowList root_windows = Shell::GetAllRootWindows(); + aura::Window::Windows root_windows = Shell::GetAllRootWindows(); aura::test::EventGenerator generator1(root_windows[0]); EXPECT_EQ("120x200", root_windows[0]->bounds().size().ToString()); @@ -1026,7 +1028,7 @@ TEST_F(DisplayControllerTest, ScaleRootWindow) { gfx::Display::SetInternalDisplayId(display1.id()); gfx::Display display2 = ScreenAsh::GetSecondaryDisplay(); - Shell::RootWindowList root_windows = Shell::GetAllRootWindows(); + aura::Window::Windows root_windows = Shell::GetAllRootWindows(); EXPECT_EQ("0,0 450x300", display1.bounds().ToString()); EXPECT_EQ("0,0 450x300", root_windows[0]->bounds().ToString()); EXPECT_EQ("450,0 500x300", display2.bounds().ToString()); @@ -1060,8 +1062,8 @@ TEST_F(DisplayControllerTest, TouchScale) { UpdateDisplay("200x200*2"); gfx::Display display = Shell::GetScreen()->GetPrimaryDisplay(); - Shell::RootWindowList root_windows = Shell::GetAllRootWindows(); - aura::RootWindow* root_window = root_windows[0]; + aura::Window::Windows root_windows = Shell::GetAllRootWindows(); + aura::Window* root_window = root_windows[0]; aura::test::EventGenerator generator(root_window); generator.PressMoveAndReleaseTouchTo(50, 50); @@ -1093,7 +1095,7 @@ TEST_F(DisplayControllerTest, ConvertHostToRootCoords) { UpdateDisplay("600x400*2/r@1.5"); gfx::Display display1 = Shell::GetScreen()->GetPrimaryDisplay(); - Shell::RootWindowList root_windows = Shell::GetAllRootWindows(); + aura::Window::Windows root_windows = Shell::GetAllRootWindows(); EXPECT_EQ("0,0 300x450", display1.bounds().ToString()); EXPECT_EQ("0,0 300x450", root_windows[0]->bounds().ToString()); EXPECT_EQ(1.5f, GetStoredUIScale(display1.id())); diff --git a/ash/display/display_manager_unittest.cc b/ash/display/display_manager_unittest.cc index 2af8d06..92f5ca6 100644 --- a/ash/display/display_manager_unittest.cc +++ b/ash/display/display_manager_unittest.cc @@ -605,7 +605,7 @@ TEST_F(DisplayManagerTest, MAYBE_TestNativeDisplaysChangedNoInternal) { TEST_F(DisplayManagerTest, MAYBE_EnsurePointerInDisplays) { UpdateDisplay("200x200,300x300"); - Shell::RootWindowList root_windows = Shell::GetAllRootWindows(); + aura::Window::Windows root_windows = Shell::GetAllRootWindows(); aura::Env* env = aura::Env::GetInstance(); @@ -652,7 +652,7 @@ TEST_F(DisplayManagerTest, MAYBE_EnsurePointerInDisplays_2ndOnLeft) { layout_store->SetDefaultDisplayLayout(layout); UpdateDisplay("200x200,300x300"); - Shell::RootWindowList root_windows = Shell::GetAllRootWindows(); + aura::Window::Windows root_windows = Shell::GetAllRootWindows(); EXPECT_EQ("-300,0 300x300", ScreenAsh::GetSecondaryDisplay().bounds().ToString()); @@ -881,7 +881,7 @@ TEST_F(DisplayManagerTest, UIScale) { TEST_F(DisplayManagerTest, MAYBE_UpdateMouseCursorAfterRotateZoom) { // Make sure just rotating will not change native location. UpdateDisplay("300x200,200x150"); - Shell::RootWindowList root_windows = Shell::GetAllRootWindows(); + aura::Window::Windows root_windows = Shell::GetAllRootWindows(); aura::Env* env = aura::Env::GetInstance(); aura::test::EventGenerator generator1(root_windows[0]); @@ -1080,35 +1080,38 @@ TEST_F(DisplayManagerTest, InvertLayout) { TEST_F(DisplayManagerTest, MAYBE_UpdateDisplayWithHostOrigin) { UpdateDisplay("100x200,300x400"); ASSERT_EQ(2, Shell::GetScreen()->GetNumDisplays()); - Shell::RootWindowList root_windows = + aura::Window::Windows root_windows = Shell::GetInstance()->GetAllRootWindows(); ASSERT_EQ(2U, root_windows.size()); - EXPECT_EQ("1,1", root_windows[0]->GetHostOrigin().ToString()); - EXPECT_EQ("100x200", root_windows[0]->GetHostSize().ToString()); + aura::WindowEventDispatcher* dispatcher0 = root_windows[0]->GetDispatcher(); + aura::WindowEventDispatcher* dispatcher1 = root_windows[1]->GetDispatcher(); + + EXPECT_EQ("1,1", dispatcher0->GetHostOrigin().ToString()); + EXPECT_EQ("100x200", dispatcher0->GetHostSize().ToString()); // UpdateDisplay set the origin if it's not set. - EXPECT_NE("1,1", root_windows[1]->GetHostOrigin().ToString()); - EXPECT_EQ("300x400", root_windows[1]->GetHostSize().ToString()); + EXPECT_NE("1,1", dispatcher1->GetHostOrigin().ToString()); + EXPECT_EQ("300x400", dispatcher1->GetHostSize().ToString()); UpdateDisplay("100x200,200+300-300x400"); ASSERT_EQ(2, Shell::GetScreen()->GetNumDisplays()); - EXPECT_EQ("0,0", root_windows[0]->GetHostOrigin().ToString()); - EXPECT_EQ("100x200", root_windows[0]->GetHostSize().ToString()); - EXPECT_EQ("200,300", root_windows[1]->GetHostOrigin().ToString()); - EXPECT_EQ("300x400", root_windows[1]->GetHostSize().ToString()); + EXPECT_EQ("0,0", dispatcher0->GetHostOrigin().ToString()); + EXPECT_EQ("100x200", dispatcher0->GetHostSize().ToString()); + EXPECT_EQ("200,300", dispatcher1->GetHostOrigin().ToString()); + EXPECT_EQ("300x400", dispatcher1->GetHostSize().ToString()); UpdateDisplay("400+500-200x300,300x400"); ASSERT_EQ(2, Shell::GetScreen()->GetNumDisplays()); - EXPECT_EQ("400,500", root_windows[0]->GetHostOrigin().ToString()); - EXPECT_EQ("200x300", root_windows[0]->GetHostSize().ToString()); - EXPECT_EQ("0,0", root_windows[1]->GetHostOrigin().ToString()); - EXPECT_EQ("300x400", root_windows[1]->GetHostSize().ToString()); + EXPECT_EQ("400,500", dispatcher0->GetHostOrigin().ToString()); + EXPECT_EQ("200x300", dispatcher0->GetHostSize().ToString()); + EXPECT_EQ("0,0", dispatcher1->GetHostOrigin().ToString()); + EXPECT_EQ("300x400", dispatcher1->GetHostSize().ToString()); UpdateDisplay("100+200-100x200,300+500-200x300"); ASSERT_EQ(2, Shell::GetScreen()->GetNumDisplays()); - EXPECT_EQ("100,200", root_windows[0]->GetHostOrigin().ToString()); - EXPECT_EQ("100x200", root_windows[0]->GetHostSize().ToString()); - EXPECT_EQ("300,500", root_windows[1]->GetHostOrigin().ToString()); - EXPECT_EQ("200x300", root_windows[1]->GetHostSize().ToString()); + EXPECT_EQ("100,200", dispatcher0->GetHostOrigin().ToString()); + EXPECT_EQ("100x200", dispatcher0->GetHostSize().ToString()); + EXPECT_EQ("300,500", dispatcher1->GetHostOrigin().ToString()); + EXPECT_EQ("200x300", dispatcher1->GetHostSize().ToString()); } } // namespace internal diff --git a/ash/display/mouse_cursor_event_filter_unittest.cc b/ash/display/mouse_cursor_event_filter_unittest.cc index d08095d..294cbf1 100644 --- a/ash/display/mouse_cursor_event_filter_unittest.cc +++ b/ash/display/mouse_cursor_event_filter_unittest.cc @@ -40,7 +40,7 @@ class MouseCursorEventFilterTest : public test::AshTestBase { return Shell::GetInstance()->mouse_cursor_filter(); } - bool WarpMouseCursorIfNecessary(aura::RootWindow* target_root, + bool WarpMouseCursorIfNecessary(aura::Window* target_root, gfx::Point point_in_screen) { bool is_warped = event_filter()->WarpMouseCursorIfNecessary( target_root, point_in_screen); @@ -49,8 +49,8 @@ class MouseCursorEventFilterTest : public test::AshTestBase { } bool WarpMouseCursorIfNecessaryWithDragRoot( - aura::RootWindow* drag_source_root, - aura::RootWindow* target_root, + aura::Window* drag_source_root, + aura::Window* target_root, gfx::Point point_in_screen) { gfx::Point location = drag_source_root->bounds().CenterPoint(); ui::MouseEvent pressed(ui::ET_MOUSE_PRESSED, location, @@ -87,7 +87,7 @@ TEST_F(MouseCursorEventFilterTest, WarpMouse) { Shell::GetInstance()->display_manager()->layout_store()-> default_display_layout().position); - Shell::RootWindowList root_windows = Shell::GetAllRootWindows(); + aura::Window::Windows root_windows = Shell::GetAllRootWindows(); EXPECT_FALSE(WarpMouseCursorIfNecessary(root_windows[0], gfx::Point(11, 11))); EXPECT_FALSE(WarpMouseCursorIfNecessary(root_windows[1], gfx::Point(11, 11))); @@ -131,7 +131,7 @@ TEST_F(MouseCursorEventFilterTest, WarpMouseDifferentSizeDisplays) { Shell::GetInstance()->display_manager()-> GetCurrentDisplayLayout().position); - Shell::RootWindowList root_windows = Shell::GetAllRootWindows(); + aura::Window::Windows root_windows = Shell::GetAllRootWindows(); aura::Env::GetInstance()->set_last_mouse_location(gfx::Point(623, 123)); // Touch the left edge of the secondary root window. Pointer should NOT warp @@ -161,7 +161,7 @@ TEST_F(MouseCursorEventFilterTest, WarpMouseDifferentScaleDisplays) { Shell::GetInstance()->display_manager()-> GetCurrentDisplayLayout().position); - Shell::RootWindowList root_windows = Shell::GetAllRootWindows(); + aura::Window::Windows root_windows = Shell::GetAllRootWindows(); aura::Env::GetInstance()->set_last_mouse_location(gfx::Point(900, 123)); // This emulates the dragging to the 2nd display, which has @@ -199,7 +199,7 @@ TEST_F(MouseCursorEventFilterTest, DoNotWarpTwice) { UpdateDisplay("500x500,600x600"); - Shell::RootWindowList root_windows = Shell::GetAllRootWindows(); + aura::Window::Windows root_windows = Shell::GetAllRootWindows(); aura::Env::GetInstance()->set_last_mouse_location(gfx::Point(623, 123)); // Touch the right edge of the primary root window. Pointer should warp. @@ -228,7 +228,7 @@ TEST_F(MouseCursorEventFilterTest, SetMouseWarpModeFlag) { UpdateDisplay("500x500,500x500"); - Shell::RootWindowList root_windows = Shell::GetAllRootWindows(); + aura::Window::Windows root_windows = Shell::GetAllRootWindows(); aura::Env::GetInstance()->set_last_mouse_location(gfx::Point(1, 1)); event_filter()->set_mouse_warp_mode(MouseCursorEventFilter::WARP_NONE); @@ -249,7 +249,7 @@ TEST_F(MouseCursorEventFilterTest, IndicatorBoundsTestOnRight) { return; UpdateDisplay("360x360,700x700"); - Shell::RootWindowList root_windows = Shell::GetAllRootWindows(); + aura::Window::Windows root_windows = Shell::GetAllRootWindows(); DisplayManager* display_manager = Shell::GetInstance()->display_manager(); DisplayLayout layout(DisplayLayout::RIGHT, 0); @@ -304,7 +304,7 @@ TEST_F(MouseCursorEventFilterTest, IndicatorBoundsTestOnLeft) { return; UpdateDisplay("360x360,700x700"); - Shell::RootWindowList root_windows = Shell::GetAllRootWindows(); + aura::Window::Windows root_windows = Shell::GetAllRootWindows(); DisplayManager* display_manager = Shell::GetInstance()->display_manager(); DisplayLayout layout(DisplayLayout::LEFT, 0); @@ -332,7 +332,7 @@ TEST_F(MouseCursorEventFilterTest, IndicatorBoundsTestOnTopBottom) { return; UpdateDisplay("360x360,700x700"); - Shell::RootWindowList root_windows = Shell::GetAllRootWindows(); + aura::Window::Windows root_windows = Shell::GetAllRootWindows(); DisplayManager* display_manager = Shell::GetInstance()->display_manager(); DisplayLayout layout(DisplayLayout::TOP, 0); @@ -377,7 +377,7 @@ TEST_F(MouseCursorEventFilterTest, CursorDeviceScaleFactor) { DisplayManager* display_manager = Shell::GetInstance()->display_manager(); display_manager->SetLayoutForCurrentDisplays( DisplayLayout(DisplayLayout::RIGHT, 0)); - Shell::RootWindowList root_windows = Shell::GetAllRootWindows(); + aura::Window::Windows root_windows = Shell::GetAllRootWindows(); ASSERT_EQ(2U, root_windows.size()); test::CursorManagerTestApi cursor_test_api( Shell::GetInstance()->cursor_manager()); diff --git a/ash/display/output_configurator_animation.cc b/ash/display/output_configurator_animation.cc index 5e58497..2fb5d52 100644 --- a/ash/display/output_configurator_animation.cc +++ b/ash/display/output_configurator_animation.cc @@ -114,11 +114,11 @@ void OutputConfiguratorAnimation::StartFadeOutAnimation( // hiding the root windows, we put a black layer over a root window for // safety. These layers remain to hide root windows and will be deleted // after the animation of OnDisplayModeChanged(). - Shell::RootWindowList root_windows = + aura::Window::Windows root_windows = Shell::GetInstance()->GetAllRootWindows(); - for (Shell::RootWindowList::const_iterator it = root_windows.begin(); + for (aura::Window::Windows::const_iterator it = root_windows.begin(); it != root_windows.end(); ++it) { - aura::RootWindow* root_window = *it; + aura::Window* root_window = *it; ui::Layer* hiding_layer = new ui::Layer(ui::LAYER_SOLID_COLOR); hiding_layer->SetColor(SK_ColorBLACK); hiding_layer->SetBounds(root_window->bounds()); @@ -158,7 +158,7 @@ void OutputConfiguratorAnimation::StartFadeInAnimation() { base::Unretained(this))); // Ensure that layers are not animating. - for (std::map<aura::RootWindow*, ui::Layer*>::iterator it = + for (std::map<aura::Window*, ui::Layer*>::iterator it = hiding_layers_.begin(); it != hiding_layers_.end(); ++it) { ui::LayerAnimator* animator = it->second->GetAnimator(); if (animator->is_animating()) @@ -168,11 +168,11 @@ void OutputConfiguratorAnimation::StartFadeInAnimation() { // Schedules the fade-in effect for all root windows. Because we put the // black layers for fade-out, here we actually turn those black layers // invisible. - Shell::RootWindowList root_windows = + aura::Window::Windows root_windows = Shell::GetInstance()->GetAllRootWindows(); - for (Shell::RootWindowList::const_iterator it = root_windows.begin(); + for (aura::Window::Windows::const_iterator it = root_windows.begin(); it != root_windows.end(); ++it) { - aura::RootWindow* root_window = *it; + aura::Window* root_window = *it; ui::Layer* hiding_layer = NULL; if (hiding_layers_.find(root_window) == hiding_layers_.end()) { // In case of the transition from mirroring->non-mirroring, new root diff --git a/ash/display/output_configurator_animation.h b/ash/display/output_configurator_animation.h index 42a66ef..f53ffa5 100644 --- a/ash/display/output_configurator_animation.h +++ b/ash/display/output_configurator_animation.h @@ -14,6 +14,7 @@ namespace aura { class RootWindow; +class Window; } // namespace aura namespace ui { @@ -54,7 +55,7 @@ class ASH_EXPORT OutputConfiguratorAnimation // and *not* call the registered callback. void ClearHidingLayers(); - std::map<aura::RootWindow*, ui::Layer*> hiding_layers_; + std::map<aura::Window*, ui::Layer*> hiding_layers_; scoped_ptr<base::OneShotTimer<OutputConfiguratorAnimation> > timer_; DISALLOW_COPY_AND_ASSIGN(OutputConfiguratorAnimation); diff --git a/ash/display/root_window_transformers_unittest.cc b/ash/display/root_window_transformers_unittest.cc index 38e2cf3..5029e20 100644 --- a/ash/display/root_window_transformers_unittest.cc +++ b/ash/display/root_window_transformers_unittest.cc @@ -144,7 +144,7 @@ TEST_F(RootWindowTransformersTest, MAYBE_RotateAndMagnify) { gfx::Display display1 = Shell::GetScreen()->GetPrimaryDisplay(); int64 display2_id = ScreenAsh::GetSecondaryDisplay().id(); - Shell::RootWindowList root_windows = Shell::GetAllRootWindows(); + aura::Window::Windows root_windows = Shell::GetAllRootWindows(); aura::test::EventGenerator generator1(root_windows[0]); aura::test::EventGenerator generator2(root_windows[1]); @@ -236,7 +236,7 @@ TEST_F(RootWindowTransformersTest, ScaleAndMagnify) { gfx::Display display1 = Shell::GetScreen()->GetPrimaryDisplay(); gfx::Display::SetInternalDisplayId(display1.id()); gfx::Display display2 = ScreenAsh::GetSecondaryDisplay(); - Shell::RootWindowList root_windows = Shell::GetAllRootWindows(); + aura::Window::Windows root_windows = Shell::GetAllRootWindows(); MagnificationController* magnifier = Shell::GetInstance()->magnification_controller(); @@ -275,8 +275,8 @@ TEST_F(RootWindowTransformersTest, MAYBE_TouchScaleAndMagnify) { UpdateDisplay("200x200*2"); gfx::Display display = Shell::GetScreen()->GetPrimaryDisplay(); - Shell::RootWindowList root_windows = Shell::GetAllRootWindows(); - aura::RootWindow* root_window = root_windows[0]; + aura::Window::Windows root_windows = Shell::GetAllRootWindows(); + aura::Window* root_window = root_windows[0]; aura::test::EventGenerator generator(root_window); MagnificationController* magnifier = Shell::GetInstance()->magnification_controller(); @@ -315,7 +315,7 @@ TEST_F(RootWindowTransformersTest, MAYBE_ConvertHostToRootCoords) { UpdateDisplay("600x400*2/r@1.5"); gfx::Display display1 = Shell::GetScreen()->GetPrimaryDisplay(); - Shell::RootWindowList root_windows = Shell::GetAllRootWindows(); + aura::Window::Windows root_windows = Shell::GetAllRootWindows(); EXPECT_EQ("0,0 300x450", display1.bounds().ToString()); EXPECT_EQ("0,0 300x450", root_windows[0]->bounds().ToString()); EXPECT_EQ(1.5f, GetStoredUIScale(display1.id())); diff --git a/ash/display/screen_position_controller.cc b/ash/display/screen_position_controller.cc index c8b8c1d..7f61d1a 100644 --- a/ash/display/screen_position_controller.cc +++ b/ash/display/screen_position_controller.cc @@ -92,16 +92,16 @@ std::pair<aura::RootWindow*, gfx::Point> GetRootWindowRelativeToWindow( root_window->GetDispatcher()->ConvertPointToNativeScreen( &location_in_native); - Shell::RootWindowList root_windows = Shell::GetAllRootWindows(); + aura::Window::Windows root_windows = Shell::GetAllRootWindows(); for (size_t i = 0; i < root_windows.size(); ++i) { + aura::WindowEventDispatcher* dispatcher = + root_windows[i]->GetDispatcher(); const gfx::Rect native_bounds( - root_windows[i]->GetHostOrigin(), - root_windows[i]->GetHostSize()); // in px. + dispatcher->GetHostOrigin(), + dispatcher->GetHostSize()); // in px. if (native_bounds.Contains(location_in_native)) { - root_window = root_windows[i]; location_in_root = location_in_native; - root_window->GetDispatcher()->ConvertPointFromNativeScreen( - &location_in_root); + dispatcher->ConvertPointFromNativeScreen(&location_in_root); break; } } diff --git a/ash/display/screen_position_controller_unittest.cc b/ash/display/screen_position_controller_unittest.cc index 2cd6133..f3b8d65 100644 --- a/ash/display/screen_position_controller_unittest.cc +++ b/ash/display/screen_position_controller_unittest.cc @@ -87,12 +87,16 @@ class ScreenPositionControllerTest : public test::AshTestBase { TEST_F(ScreenPositionControllerTest, MAYBE_ConvertHostPointToScreen) { UpdateDisplay("100+100-200x200,100+500-200x200"); - Shell::RootWindowList root_windows = + aura::Window::Windows root_windows = Shell::GetInstance()->GetAllRootWindows(); - EXPECT_EQ("100,100", root_windows[0]->GetHostOrigin().ToString()); - EXPECT_EQ("200x200", root_windows[0]->GetHostSize().ToString()); - EXPECT_EQ("100,500", root_windows[1]->GetHostOrigin().ToString()); - EXPECT_EQ("200x200", root_windows[1]->GetHostSize().ToString()); + EXPECT_EQ("100,100", + root_windows[0]->GetDispatcher()->GetHostOrigin().ToString()); + EXPECT_EQ("200x200", + root_windows[0]->GetDispatcher()->GetHostSize().ToString()); + EXPECT_EQ("100,500", + root_windows[1]->GetDispatcher()->GetHostOrigin().ToString()); + EXPECT_EQ("200x200", + root_windows[1]->GetDispatcher()->GetHostSize().ToString()); const gfx::Point window_pos(100, 100); window_->SetBoundsInScreen( @@ -171,12 +175,16 @@ TEST_F(ScreenPositionControllerTest, MAYBE_ConvertHostPointToScreen) { TEST_F(ScreenPositionControllerTest, MAYBE_ConvertHostPointToScreenHiDPI) { UpdateDisplay("100+100-200x200*2,100+500-200x200"); - Shell::RootWindowList root_windows = + aura::Window::Windows root_windows = Shell::GetInstance()->GetAllRootWindows(); - EXPECT_EQ("100,100", root_windows[0]->GetHostOrigin().ToString()); - EXPECT_EQ("200x200", root_windows[0]->GetHostSize().ToString()); - EXPECT_EQ("100,500", root_windows[1]->GetHostOrigin().ToString()); - EXPECT_EQ("200x200", root_windows[1]->GetHostSize().ToString()); + EXPECT_EQ("100,100", + root_windows[0]->GetDispatcher()->GetHostOrigin().ToString()); + EXPECT_EQ("200x200", + root_windows[0]->GetDispatcher()->GetHostSize().ToString()); + EXPECT_EQ("100,500", + root_windows[1]->GetDispatcher()->GetHostOrigin().ToString()); + EXPECT_EQ("200x200", + root_windows[1]->GetDispatcher()->GetHostSize().ToString()); // Put |window_| to the primary 2x display. window_->SetBoundsInScreen(gfx::Rect(20, 20, 50, 50), @@ -219,7 +227,7 @@ TEST_F(ScreenPositionControllerTest, MAYBE_ConvertHostPointToScreenRotate) { // Move |window_| to the 2nd. window_->SetBoundsInScreen(gfx::Rect(300, 20, 50, 50), ScreenAsh::GetSecondaryDisplay()); - Shell::RootWindowList root_windows = + aura::Window::Windows root_windows = Shell::GetInstance()->GetAllRootWindows(); EXPECT_EQ(root_windows[1], window_->GetRootWindow()); @@ -251,7 +259,7 @@ TEST_F(ScreenPositionControllerTest, MAYBE_ConvertHostPointToScreenUIScale) { // Move |window_| to the 2nd. window_->SetBoundsInScreen(gfx::Rect(300, 20, 50, 50), ScreenAsh::GetSecondaryDisplay()); - Shell::RootWindowList root_windows = + aura::Window::Windows root_windows = Shell::GetInstance()->GetAllRootWindows(); EXPECT_EQ(root_windows[1], window_->GetRootWindow()); diff --git a/ash/drag_drop/drag_drop_controller_unittest.cc b/ash/drag_drop/drag_drop_controller_unittest.cc index fa4f2bc..6e13a44 100644 --- a/ash/drag_drop/drag_drop_controller_unittest.cc +++ b/ash/drag_drop/drag_drop_controller_unittest.cc @@ -1020,9 +1020,9 @@ TEST_F(DragDropControllerTest, DragCancelAcrossDisplays) { return; UpdateDisplay("400x400,400x400"); - Shell::RootWindowList root_windows = + aura::Window::Windows root_windows = Shell::GetInstance()->GetAllRootWindows(); - for (Shell::RootWindowList::iterator iter = root_windows.begin(); + for (aura::Window::Windows::iterator iter = root_windows.begin(); iter != root_windows.end(); ++iter) { aura::client::SetDragDropClient(*iter, drag_drop_controller_.get()); } @@ -1099,7 +1099,7 @@ TEST_F(DragDropControllerTest, DragCancelAcrossDisplays) { EXPECT_EQ("405,405", observer.window_location_on_destroying().ToString()); } - for (Shell::RootWindowList::iterator iter = root_windows.begin(); + for (aura::Window::Windows::iterator iter = root_windows.begin(); iter != root_windows.end(); ++iter) { aura::client::SetDragDropClient(*iter, NULL); } diff --git a/ash/drag_drop/drag_drop_interactive_uitest.cc b/ash/drag_drop/drag_drop_interactive_uitest.cc index 5f13c5b..73422f3 100644 --- a/ash/drag_drop/drag_drop_interactive_uitest.cc +++ b/ash/drag_drop/drag_drop_interactive_uitest.cc @@ -133,7 +133,7 @@ TEST_F(DragDropTest, MAYBE_DragDropAcrossMultiDisplay) { return; UpdateDisplay("400x400,400x400"); - Shell::RootWindowList root_windows = + aura::Window::Windows root_windows = Shell::GetInstance()->GetAllRootWindows(); views::View* draggable_view = new DraggableView(); draggable_view->set_drag_controller(NULL); diff --git a/ash/drag_drop/drag_drop_tracker_unittest.cc b/ash/drag_drop/drag_drop_tracker_unittest.cc index 1c485b3..ec2bc15 100644 --- a/ash/drag_drop/drag_drop_tracker_unittest.cc +++ b/ash/drag_drop/drag_drop_tracker_unittest.cc @@ -61,7 +61,7 @@ class DragDropTrackerTest : public test::AshTestBase { #endif TEST_F(DragDropTrackerTest, MAYBE_GetTarget) { - Shell::RootWindowList root_windows = Shell::GetAllRootWindows(); + aura::Window::Windows root_windows = Shell::GetAllRootWindows(); EXPECT_EQ(2U, root_windows.size()); scoped_ptr<aura::Window> window0( @@ -128,7 +128,7 @@ TEST_F(DragDropTrackerTest, MAYBE_GetTarget) { #endif TEST_F(DragDropTrackerTest, MAYBE_ConvertEvent) { - Shell::RootWindowList root_windows = Shell::GetAllRootWindows(); + aura::Window::Windows root_windows = Shell::GetAllRootWindows(); EXPECT_EQ(2U, root_windows.size()); scoped_ptr<aura::Window> window0( diff --git a/ash/extended_desktop_unittest.cc b/ash/extended_desktop_unittest.cc index 689c546..d6b5db2 100644 --- a/ash/extended_desktop_unittest.cc +++ b/ash/extended_desktop_unittest.cc @@ -75,7 +75,7 @@ class MoveWindowByClickEventHandler : public ui::EventHandler { // ui::EventHandler overrides: virtual void OnMouseEvent(ui::MouseEvent* event) OVERRIDE { if (event->type() == ui::ET_MOUSE_RELEASED) { - Shell::RootWindowList root_windows = Shell::GetAllRootWindows(); + aura::Window::Windows root_windows = Shell::GetAllRootWindows(); DCHECK_LT(1u, root_windows.size()); root_windows[1]->AddChild(target_); } @@ -161,11 +161,11 @@ TEST_F(ExtendedDesktopTest, Basic) { return; UpdateDisplay("1000x600,600x400"); - Shell::RootWindowList root_windows = Shell::GetAllRootWindows(); + aura::Window::Windows root_windows = Shell::GetAllRootWindows(); // All root windows must have the root window controller. ASSERT_EQ(2U, root_windows.size()); - for (Shell::RootWindowList::const_iterator iter = root_windows.begin(); + for (aura::Window::Windows::const_iterator iter = root_windows.begin(); iter != root_windows.end(); ++iter) { EXPECT_TRUE(internal::GetRootWindowController(*iter) != NULL); } @@ -183,7 +183,7 @@ TEST_F(ExtendedDesktopTest, Activation) { return; UpdateDisplay("1000x600,600x400"); - Shell::RootWindowList root_windows = Shell::GetAllRootWindows(); + aura::Window::Windows root_windows = Shell::GetAllRootWindows(); views::Widget* widget_on_1st = CreateTestWidget(gfx::Rect(10, 10, 100, 100)); views::Widget* widget_on_2nd = @@ -217,7 +217,7 @@ TEST_F(ExtendedDesktopTest, SystemModal) { return; UpdateDisplay("1000x600,600x400"); - Shell::RootWindowList root_windows = Shell::GetAllRootWindows(); + aura::Window::Windows root_windows = Shell::GetAllRootWindows(); views::Widget* widget_on_1st = CreateTestWidget(gfx::Rect(10, 10, 100, 100)); EXPECT_TRUE(wm::IsActiveWindow(widget_on_1st->GetNativeView())); @@ -255,12 +255,14 @@ TEST_F(ExtendedDesktopTest, TestCursor) { return; UpdateDisplay("1000x600,600x400"); - Shell::RootWindowList root_windows = Shell::GetAllRootWindows(); - EXPECT_EQ(ui::kCursorPointer, root_windows[0]->last_cursor().native_type()); - EXPECT_EQ(ui::kCursorPointer, root_windows[1]->last_cursor().native_type()); + aura::Window::Windows root_windows = Shell::GetAllRootWindows(); + aura::WindowEventDispatcher* dispatcher0 = root_windows[0]->GetDispatcher(); + aura::WindowEventDispatcher* dispatcher1 = root_windows[1]->GetDispatcher(); + EXPECT_EQ(ui::kCursorPointer, dispatcher0->last_cursor().native_type()); + EXPECT_EQ(ui::kCursorPointer, dispatcher1->last_cursor().native_type()); Shell::GetInstance()->cursor_manager()->SetCursor(ui::kCursorCopy); - EXPECT_EQ(ui::kCursorCopy, root_windows[0]->last_cursor().native_type()); - EXPECT_EQ(ui::kCursorCopy, root_windows[1]->last_cursor().native_type()); + EXPECT_EQ(ui::kCursorCopy, dispatcher0->last_cursor().native_type()); + EXPECT_EQ(ui::kCursorCopy, dispatcher1->last_cursor().native_type()); } TEST_F(ExtendedDesktopTest, TestCursorLocation) { @@ -268,7 +270,7 @@ TEST_F(ExtendedDesktopTest, TestCursorLocation) { return; UpdateDisplay("1000x600,600x400"); - Shell::RootWindowList root_windows = Shell::GetAllRootWindows(); + aura::Window::Windows root_windows = Shell::GetAllRootWindows(); aura::test::WindowTestApi root_window0_test_api(root_windows[0]); aura::test::WindowTestApi root_window1_test_api(root_windows[1]); @@ -291,7 +293,7 @@ TEST_F(ExtendedDesktopTest, CycleWindows) { return; UpdateDisplay("700x500,500x500"); - Shell::RootWindowList root_windows = Shell::GetAllRootWindows(); + aura::Window::Windows root_windows = Shell::GetAllRootWindows(); WindowCycleController* controller = Shell::GetInstance()->window_cycle_controller(); @@ -343,7 +345,7 @@ TEST_F(ExtendedDesktopTest, GetRootWindowAt) { UpdateDisplay("700x500,500x500"); SetSecondaryDisplayLayout(DisplayLayout::LEFT); - Shell::RootWindowList root_windows = Shell::GetAllRootWindows(); + aura::Window::Windows root_windows = Shell::GetAllRootWindows(); EXPECT_EQ(root_windows[1], wm::GetRootWindowAt(gfx::Point(-400, 100))); EXPECT_EQ(root_windows[1], wm::GetRootWindowAt(gfx::Point(-1, 100))); @@ -365,7 +367,7 @@ TEST_F(ExtendedDesktopTest, GetRootWindowMatching) { UpdateDisplay("700x500,500x500"); SetSecondaryDisplayLayout(DisplayLayout::LEFT); - Shell::RootWindowList root_windows = Shell::GetAllRootWindows(); + aura::Window::Windows root_windows = Shell::GetAllRootWindows(); // Containing rect. EXPECT_EQ(root_windows[1], @@ -403,7 +405,7 @@ TEST_F(ExtendedDesktopTest, Capture) { return; UpdateDisplay("1000x600,600x400"); - Shell::RootWindowList root_windows = Shell::GetAllRootWindows(); + aura::Window::Windows root_windows = Shell::GetAllRootWindows(); aura::test::EventCountDelegate r1_d1; aura::test::EventCountDelegate r1_d2; @@ -462,7 +464,7 @@ TEST_F(ExtendedDesktopTest, MoveWindow) { return; UpdateDisplay("1000x600,600x400"); - Shell::RootWindowList root_windows = Shell::GetAllRootWindows(); + aura::Window::Windows root_windows = Shell::GetAllRootWindows(); views::Widget* d1 = CreateTestWidget(gfx::Rect(10, 10, 100, 100)); EXPECT_EQ(root_windows[0], d1->GetNativeView()->GetRootWindow()); @@ -500,7 +502,7 @@ TEST_F(ExtendedDesktopTest, MoveWindowByMouseClick) { UpdateDisplay("1000x600,600x400"); - Shell::RootWindowList root_windows = Shell::GetAllRootWindows(); + aura::Window::Windows root_windows = Shell::GetAllRootWindows(); aura::test::EventCountDelegate delegate; scoped_ptr<aura::Window> window(aura::test::CreateTestWindowWithDelegate( &delegate, 0, gfx::Rect(10, 10, 100, 100), root_windows[0])); @@ -522,7 +524,7 @@ TEST_F(ExtendedDesktopTest, MoveWindowToDisplay) { return; UpdateDisplay("1000x1000,1000x1000"); - Shell::RootWindowList root_windows = Shell::GetAllRootWindows(); + aura::Window::Windows root_windows = Shell::GetAllRootWindows(); gfx::Display display0 = Shell::GetScreen()->GetDisplayMatching( root_windows[0]->GetBoundsInScreen()); @@ -554,7 +556,7 @@ TEST_F(ExtendedDesktopTest, MoveWindowWithTransient) { return; UpdateDisplay("1000x600,600x400"); - Shell::RootWindowList root_windows = Shell::GetAllRootWindows(); + aura::Window::Windows root_windows = Shell::GetAllRootWindows(); views::Widget* w1 = CreateTestWidget(gfx::Rect(10, 10, 100, 100)); views::Widget* w1_t1 = CreateTestWidgetWithParent( w1, gfx::Rect(50, 50, 50, 50), false /* transient */); @@ -614,7 +616,7 @@ TEST_F(ExtendedDesktopTest, ConvertPoint) { return; gfx::Screen* screen = Shell::GetInstance()->screen(); UpdateDisplay("1000x600,600x400"); - Shell::RootWindowList root_windows = Shell::GetAllRootWindows(); + aura::Window::Windows root_windows = Shell::GetAllRootWindows(); gfx::Display display_1 = screen->GetDisplayNearestWindow(root_windows[0]); EXPECT_EQ("0,0", display_1.bounds().origin().ToString()); gfx::Display display_2 = screen->GetDisplayNearestWindow(root_windows[1]); @@ -705,7 +707,7 @@ TEST_F(ExtendedDesktopTest, StayInSameRootWindow) { return; UpdateDisplay("100x100,200x200"); - Shell::RootWindowList root_windows = Shell::GetAllRootWindows(); + aura::Window::Windows root_windows = Shell::GetAllRootWindows(); views::Widget* w1 = CreateTestWidget(gfx::Rect(10, 10, 50, 50)); EXPECT_EQ(root_windows[0], w1->GetNativeView()->GetRootWindow()); w1->SetBounds(gfx::Rect(150, 10, 50, 50)); @@ -747,7 +749,7 @@ TEST_F(ExtendedDesktopTest, KeyEventsOnLockScreen) { return; UpdateDisplay("100x100,200x200"); - Shell::RootWindowList root_windows = Shell::GetAllRootWindows(); + aura::Window::Windows root_windows = Shell::GetAllRootWindows(); // Create normal windows on both displays. views::Widget* widget1 = CreateTestWidget( @@ -779,13 +781,13 @@ TEST_F(ExtendedDesktopTest, KeyEventsOnLockScreen) { // The lock window should get events on both root windows. aura::test::EventGenerator& event_generator(GetEventGenerator()); - event_generator.set_current_root_window(root_windows[0]); + event_generator.set_current_root_window(root_windows[0]->GetDispatcher()); event_generator.PressKey(ui::VKEY_A, 0); event_generator.ReleaseKey(ui::VKEY_A, 0); EXPECT_EQ(lock_widget->GetNativeView(), focus_client->GetFocusedWindow()); EXPECT_EQ("a", UTF16ToASCII(textfield->text())); - event_generator.set_current_root_window(root_windows[1]); + event_generator.set_current_root_window(root_windows[1]->GetDispatcher()); event_generator.PressKey(ui::VKEY_B, 0); event_generator.ReleaseKey(ui::VKEY_B, 0); EXPECT_EQ(lock_widget->GetNativeView(), focus_client->GetFocusedWindow()); @@ -802,13 +804,13 @@ TEST_F(ExtendedDesktopTest, KeyEventsOnLockScreen) { // on both root windows. UpdateDisplay("100x100,200x200"); root_windows = Shell::GetAllRootWindows(); - event_generator.set_current_root_window(root_windows[0]); + event_generator.set_current_root_window(root_windows[0]->GetDispatcher()); event_generator.PressKey(ui::VKEY_D, 0); event_generator.ReleaseKey(ui::VKEY_D, 0); EXPECT_EQ(lock_widget->GetNativeView(), focus_client->GetFocusedWindow()); EXPECT_EQ("abcd", UTF16ToASCII(textfield->text())); - event_generator.set_current_root_window(root_windows[1]); + event_generator.set_current_root_window(root_windows[1]->GetDispatcher()); event_generator.PressKey(ui::VKEY_E, 0); event_generator.ReleaseKey(ui::VKEY_E, 0); EXPECT_EQ(lock_widget->GetNativeView(), focus_client->GetFocusedWindow()); diff --git a/ash/high_contrast/high_contrast_controller.cc b/ash/high_contrast/high_contrast_controller.cc index 31a0dbb..72fe036 100644 --- a/ash/high_contrast/high_contrast_controller.cc +++ b/ash/high_contrast/high_contrast_controller.cc @@ -18,8 +18,8 @@ void HighContrastController::SetEnabled(bool enabled) { enabled_ = enabled; // Update all active displays. - Shell::RootWindowList root_window_list = Shell::GetAllRootWindows(); - for (Shell::RootWindowList::iterator it = root_window_list.begin(); + aura::Window::Windows root_window_list = Shell::GetAllRootWindows(); + for (aura::Window::Windows::iterator it = root_window_list.begin(); it != root_window_list.end(); it++) { UpdateDisplay(*it); } @@ -29,7 +29,7 @@ void HighContrastController::OnRootWindowAdded(aura::RootWindow* root_window) { UpdateDisplay(root_window); } -void HighContrastController::UpdateDisplay(aura::RootWindow* root_window) { +void HighContrastController::UpdateDisplay(aura::Window* root_window) { root_window->layer()->SetLayerInverted(enabled_); } diff --git a/ash/high_contrast/high_contrast_controller.h b/ash/high_contrast/high_contrast_controller.h index 2afd60b..e42e46c 100644 --- a/ash/high_contrast/high_contrast_controller.h +++ b/ash/high_contrast/high_contrast_controller.h @@ -10,6 +10,7 @@ namespace aura { class RootWindow; +class Window; } namespace ash { @@ -28,7 +29,7 @@ class ASH_EXPORT HighContrastController { private: // Update high contrast mode on the passed display. - void UpdateDisplay(aura::RootWindow* root_window); + void UpdateDisplay(aura::Window* root_window); // Indicates if the high contrast mode is enabled or disabled. bool enabled_; diff --git a/ash/magnifier/partial_magnification_controller.cc b/ash/magnifier/partial_magnification_controller.cc index 3e762b7..a24ba51 100644 --- a/ash/magnifier/partial_magnification_controller.cc +++ b/ash/magnifier/partial_magnification_controller.cc @@ -99,7 +99,7 @@ void PartialMagnificationController::OnWindowDestroying( aura::Window* window) { CloseMagnifierWindow(); - aura::RootWindow* new_root_window = GetCurrentRootWindow(); + aura::Window* new_root_window = GetCurrentRootWindow(); if (new_root_window != window) SwitchTargetRootWindow(new_root_window); } @@ -131,13 +131,13 @@ void PartialMagnificationController::CreateMagnifierWindow() { if (zoom_widget_) return; - aura::RootWindow* root_window = GetCurrentRootWindow(); + aura::Window* root_window = GetCurrentRootWindow(); if (!root_window) return; root_window->AddObserver(this); - gfx::Point mouse(root_window->GetLastMouseLocationInRoot()); + gfx::Point mouse(root_window->GetDispatcher()->GetLastMouseLocationInRoot()); zoom_widget_ = new views::Widget; views::Widget::InitParams params( @@ -196,13 +196,13 @@ void PartialMagnificationController::SwitchTargetRootWindow( SetScale(GetScale()); } -aura::RootWindow* PartialMagnificationController::GetCurrentRootWindow() { - Shell::RootWindowList root_windows = Shell::GetAllRootWindows(); - for (Shell::RootWindowList::const_iterator iter = root_windows.begin(); +aura::Window* PartialMagnificationController::GetCurrentRootWindow() { + aura::Window::Windows root_windows = Shell::GetAllRootWindows(); + for (aura::Window::Windows::const_iterator iter = root_windows.begin(); iter != root_windows.end(); ++iter) { - aura::RootWindow* root_window = *iter; + aura::Window* root_window = *iter; if (root_window->ContainsPointInRoot( - root_window->GetLastMouseLocationInRoot())) + root_window->GetDispatcher()->GetLastMouseLocationInRoot())) return root_window; } return NULL; diff --git a/ash/magnifier/partial_magnification_controller.h b/ash/magnifier/partial_magnification_controller.h index 01c3a2b..eaecd12 100644 --- a/ash/magnifier/partial_magnification_controller.h +++ b/ash/magnifier/partial_magnification_controller.h @@ -10,10 +10,6 @@ #include "ui/gfx/point.h" #include "ui/views/widget/widget_observer.h" -namespace aura { -class RootWindow; -} - namespace ash { const float kDefaultPartialMagnifiedScale = 1.5f; @@ -52,7 +48,7 @@ class PartialMagnificationController void SwitchTargetRootWindow(aura::Window* new_root_window); // Returns the root window that contains the mouse cursor. - aura::RootWindow* GetCurrentRootWindow(); + aura::Window* GetCurrentRootWindow(); // Return true if the magnification scale > kMinPartialMagnifiedScaleThreshold bool IsPartialMagnified() const; diff --git a/ash/root_window_controller_unittest.cc b/ash/root_window_controller_unittest.cc index b8c480c..78c96d9 100644 --- a/ash/root_window_controller_unittest.cc +++ b/ash/root_window_controller_unittest.cc @@ -145,7 +145,7 @@ class RootWindowControllerTest : public test::AshTestBase { return widget; } - aura::Window* GetModalContainer(aura::RootWindow* root_window) { + aura::Window* GetModalContainer(aura::Window* root_window) { return Shell::GetContainer( root_window, ash::internal::kShellWindowId_SystemModalContainer); @@ -157,7 +157,7 @@ TEST_F(RootWindowControllerTest, MoveWindows_Basic) { return; UpdateDisplay("600x600,500x500"); - Shell::RootWindowList root_windows = Shell::GetAllRootWindows(); + aura::Window::Windows root_windows = Shell::GetAllRootWindows(); internal::RootWindowController* controller = Shell::GetPrimaryRootWindowController(); internal::ShelfLayoutManager* shelf_layout_manager = @@ -290,7 +290,7 @@ TEST_F(RootWindowControllerTest, MoveWindows_Modal) { UpdateDisplay("500x500,500x500"); - Shell::RootWindowList root_windows = Shell::GetAllRootWindows(); + aura::Window::Windows root_windows = Shell::GetAllRootWindows(); // Emulate virtual screen coordinate system. root_windows[0]->SetBounds(gfx::Rect(0, 0, 500, 500)); root_windows[1]->SetBounds(gfx::Rect(500, 0, 500, 500)); @@ -638,7 +638,7 @@ TEST_F(VirtualKeyboardRootWindowControllerTest, UpdateDisplay("500x500,500x500"); - Shell::RootWindowList root_windows = Shell::GetAllRootWindows(); + aura::Window::Windows root_windows = Shell::GetAllRootWindows(); aura::Window* primary_root_window = Shell::GetPrimaryRootWindow(); aura::Window* secondary_root_window = root_windows[0] == primary_root_window ? diff --git a/ash/shelf/shelf_layout_manager_unittest.cc b/ash/shelf/shelf_layout_manager_unittest.cc index cda2fe7..1009ce9 100644 --- a/ash/shelf/shelf_layout_manager_unittest.cc +++ b/ash/shelf/shelf_layout_manager_unittest.cc @@ -879,7 +879,7 @@ TEST_F(ShelfLayoutManagerTest, AutoHideShelfOnScreenBoundary) { // visible. CreateTestWidget(); - Shell::RootWindowList root_windows = Shell::GetAllRootWindows(); + aura::Window::Windows root_windows = Shell::GetAllRootWindows(); ASSERT_EQ(root_windows[0], GetShelfWidget()->GetNativeWindow()->GetRootWindow()); diff --git a/ash/shelf/shelf_widget_unittest.cc b/ash/shelf/shelf_widget_unittest.cc index 010db18..c9f17c9 100644 --- a/ash/shelf/shelf_widget_unittest.cc +++ b/ash/shelf/shelf_widget_unittest.cc @@ -89,7 +89,7 @@ TEST_F(ShelfWidgetTest, TestAlignment) { return; UpdateDisplay("300x300,500x500"); - Shell::RootWindowList root_windows = Shell::GetAllRootWindows(); + aura::Window::Windows root_windows = Shell::GetAllRootWindows(); { SCOPED_TRACE("Primary Bottom"); TestLauncherAlignment(root_windows[0], diff --git a/ash/shell.cc b/ash/shell.cc index ab63478..67b7cab 100644 --- a/ash/shell.cc +++ b/ash/shell.cc @@ -223,7 +223,7 @@ gfx::Screen* Shell::GetScreen() { } // static -Shell::RootWindowList Shell::GetAllRootWindows() { +aura::Window::Windows Shell::GetAllRootWindows() { return Shell::GetInstance()->display_controller()-> GetAllRootWindows(); } @@ -245,8 +245,8 @@ std::vector<aura::Window*> Shell::GetContainersFromAllRootWindows( int container_id, aura::Window* priority_root) { std::vector<aura::Window*> containers; - RootWindowList root_windows = GetAllRootWindows(); - for (RootWindowList::const_iterator it = root_windows.begin(); + aura::Window::Windows root_windows = GetAllRootWindows(); + for (aura::Window::Windows::const_iterator it = root_windows.begin(); it != root_windows.end(); ++it) { aura::Window* container = (*it)->GetChildById(container_id); if (container) { diff --git a/ash/shell.h b/ash/shell.h index fb4dd08c..4df19fc 100644 --- a/ash/shell.h +++ b/ash/shell.h @@ -19,6 +19,7 @@ #include "base/memory/weak_ptr.h" #include "base/observer_list.h" #include "ui/aura/client/activation_change_observer.h" +#include "ui/aura/window.h" #include "ui/base/ui_base_types.h" #include "ui/events/event_target.h" #include "ui/gfx/insets.h" @@ -165,7 +166,6 @@ class ASH_EXPORT Shell public ui::EventTarget, public aura::client::ActivationChangeObserver { public: - typedef std::vector<aura::RootWindow*> RootWindowList; typedef std::vector<internal::RootWindowController*> RootWindowControllerList; enum Direction { @@ -209,7 +209,7 @@ class ASH_EXPORT Shell static gfx::Screen* GetScreen(); // Returns all root windows. - static RootWindowList GetAllRootWindows(); + static aura::Window::Windows GetAllRootWindows(); static aura::Window* GetContainer(aura::Window* root_window, int container_id); diff --git a/ash/shell/window_watcher.cc b/ash/shell/window_watcher.cc index 302a523..ea60dbc 100644 --- a/ash/shell/window_watcher.cc +++ b/ash/shell/window_watcher.cc @@ -70,18 +70,18 @@ class WindowWatcher::WorkspaceWindowWatcher : public aura::WindowObserver { WindowWatcher::WindowWatcher() { workspace_window_watcher_.reset(new WorkspaceWindowWatcher(this)); - Shell::RootWindowList root_windows = Shell::GetAllRootWindows(); - for (Shell::RootWindowList::iterator iter = root_windows.begin(); + aura::Window::Windows root_windows = Shell::GetAllRootWindows(); + for (aura::Window::Windows::iterator iter = root_windows.begin(); iter != root_windows.end(); ++ iter) { workspace_window_watcher_->RootWindowAdded(*iter); } } WindowWatcher::~WindowWatcher() { - Shell::RootWindowList root_windows = Shell::GetAllRootWindows(); - for (Shell::RootWindowList::iterator iter = root_windows.begin(); + aura::Window::Windows root_windows = Shell::GetAllRootWindows(); + for (aura::Window::Windows::iterator iter = root_windows.begin(); iter != root_windows.end(); ++ iter) { - workspace_window_watcher_->RootWindowRemoved(*iter); + workspace_window_watcher_->RootWindowRemoved((*iter)->GetDispatcher()); } } diff --git a/ash/shell_factory.h b/ash/shell_factory.h index 401a54f..041c4c1 100644 --- a/ash/shell_factory.h +++ b/ash/shell_factory.h @@ -25,7 +25,7 @@ class Widget; namespace ash { namespace internal { -views::Widget* CreateDesktopBackground(aura::RootWindow* root_window, +views::Widget* CreateDesktopBackground(aura::Window* root_window, int container_id); ASH_EXPORT views::Widget* CreateStatusArea(views::View* contents); diff --git a/ash/tooltips/tooltip_controller_unittest.cc b/ash/tooltips/tooltip_controller_unittest.cc index 2b510a9..25b2f01 100644 --- a/ash/tooltips/tooltip_controller_unittest.cc +++ b/ash/tooltips/tooltip_controller_unittest.cc @@ -138,7 +138,7 @@ TEST_F(TooltipControllerTest, TooltipsOnMultiDisplayShouldNotCrash) { return; UpdateDisplay("1000x600,600x400"); - Shell::RootWindowList root_windows = Shell::GetAllRootWindows(); + aura::Window::Windows root_windows = Shell::GetAllRootWindows(); scoped_ptr<views::Widget> widget1(CreateNewWidgetWithBoundsOn( 0, gfx::Rect(10, 10, 100, 100))); TooltipTestView* view1 = new TooltipTestView; diff --git a/ash/touch/touch_hud_debug.cc b/ash/touch/touch_hud_debug.cc index 921c31c6..019779d 100644 --- a/ash/touch/touch_hud_debug.cc +++ b/ash/touch/touch_hud_debug.cc @@ -371,8 +371,8 @@ TouchHudDebug::~TouchHudDebug() { // static scoped_ptr<DictionaryValue> TouchHudDebug::GetAllAsDictionary() { scoped_ptr<DictionaryValue> value(new DictionaryValue()); - Shell::RootWindowList roots = Shell::GetInstance()->GetAllRootWindows(); - for (Shell::RootWindowList::iterator iter = roots.begin(); + aura::Window::Windows roots = Shell::GetInstance()->GetAllRootWindows(); + for (aura::Window::Windows::iterator iter = roots.begin(); iter != roots.end(); ++iter) { internal::RootWindowController* controller = GetRootWindowController(*iter); internal::TouchHudDebug* hud = controller->touch_hud_debug(); diff --git a/ash/wm/ash_native_cursor_manager.cc b/ash/wm/ash_native_cursor_manager.cc index 6b888093..6753796 100644 --- a/ash/wm/ash_native_cursor_manager.cc +++ b/ash/wm/ash_native_cursor_manager.cc @@ -17,11 +17,11 @@ namespace ash { namespace { void SetCursorOnAllRootWindows(gfx::NativeCursor cursor) { - Shell::RootWindowList root_windows = + aura::Window::Windows root_windows = Shell::GetInstance()->GetAllRootWindows(); - for (Shell::RootWindowList::iterator iter = root_windows.begin(); + for (aura::Window::Windows::iterator iter = root_windows.begin(); iter != root_windows.end(); ++iter) - (*iter)->SetCursor(cursor); + (*iter)->GetDispatcher()->SetCursor(cursor); #if defined(OS_CHROMEOS) Shell::GetInstance()->display_controller()-> mirror_window_controller()->SetMirroredCursor(cursor); @@ -29,11 +29,11 @@ void SetCursorOnAllRootWindows(gfx::NativeCursor cursor) { } void NotifyCursorVisibilityChange(bool visible) { - Shell::RootWindowList root_windows = + aura::Window::Windows root_windows = Shell::GetInstance()->GetAllRootWindows(); - for (Shell::RootWindowList::iterator iter = root_windows.begin(); + for (aura::Window::Windows::iterator iter = root_windows.begin(); iter != root_windows.end(); ++iter) - (*iter)->OnCursorVisibilityChanged(visible); + (*iter)->GetDispatcher()->OnCursorVisibilityChanged(visible); #if defined(OS_CHROMEOS) Shell::GetInstance()->display_controller()->mirror_window_controller()-> SetMirroredCursorVisibility(visible); @@ -41,11 +41,11 @@ void NotifyCursorVisibilityChange(bool visible) { } void NotifyMouseEventsEnableStateChange(bool enabled) { - Shell::RootWindowList root_windows = + aura::Window::Windows root_windows = Shell::GetInstance()->GetAllRootWindows(); - for (Shell::RootWindowList::iterator iter = root_windows.begin(); + for (aura::Window::Windows::iterator iter = root_windows.begin(); iter != root_windows.end(); ++iter) - (*iter)->OnMouseEventsEnableStateChanged(enabled); + (*iter)->GetDispatcher()->OnMouseEventsEnableStateChanged(enabled); // Mirror window never process events. } diff --git a/ash/wm/dock/docked_window_resizer_unittest.cc b/ash/wm/dock/docked_window_resizer_unittest.cc index 923d31c..f56116c 100644 --- a/ash/wm/dock/docked_window_resizer_unittest.cc +++ b/ash/wm/dock/docked_window_resizer_unittest.cc @@ -614,7 +614,7 @@ TEST_P(DockedWindowResizerTest, DragAcrossDisplays) { return; UpdateDisplay("800x800,800x800"); - Shell::RootWindowList root_windows = Shell::GetAllRootWindows(); + aura::Window::Windows root_windows = Shell::GetAllRootWindows(); EXPECT_EQ(2, static_cast<int>(root_windows.size())); scoped_ptr<aura::Window> window(CreateTestWindow(gfx::Rect(0, 0, 201, 201))); gfx::Rect initial_bounds = window->GetBoundsInScreen(); diff --git a/ash/wm/drag_window_resizer.cc b/ash/wm/drag_window_resizer.cc index 5713cf8..000d119 100644 --- a/ash/wm/drag_window_resizer.cc +++ b/ash/wm/drag_window_resizer.cc @@ -41,8 +41,8 @@ bool HasSecondaryRootWindow() { // When there are two root windows, returns one of the root windows which is not // |root_window|. Returns NULL if only one root window exists. -aura::RootWindow* GetAnotherRootWindow(aura::Window* root_window) { - Shell::RootWindowList root_windows = Shell::GetAllRootWindows(); +aura::Window* GetAnotherRootWindow(aura::Window* root_window) { + aura::Window::Windows root_windows = Shell::GetAllRootWindows(); if (root_windows.size() < 2) return NULL; DCHECK_EQ(2U, root_windows.size()); diff --git a/ash/wm/drag_window_resizer_unittest.cc b/ash/wm/drag_window_resizer_unittest.cc index cca570d..04e00f2 100644 --- a/ash/wm/drag_window_resizer_unittest.cc +++ b/ash/wm/drag_window_resizer_unittest.cc @@ -127,7 +127,7 @@ class DragWindowResizerTest : public test::AshTestBase { aura::client::WINDOW_MOVE_SOURCE_MOUSE).release(); } - bool WarpMouseCursorIfNecessary(aura::RootWindow* target_root, + bool WarpMouseCursorIfNecessary(aura::Window* target_root, const gfx::Point& point_in_screen) { MouseCursorEventFilter* event_filter = Shell::GetInstance()->mouse_cursor_filter(); @@ -163,7 +163,7 @@ TEST_F(DragWindowResizerTest, WindowDragWithMultiDisplays) { // The secondary display is logically on the right, but on the system (e.g. X) // layer, it's below the primary one. See UpdateDisplay() in ash_test_base.cc. UpdateDisplay("800x600,800x600"); - Shell::RootWindowList root_windows = Shell::GetAllRootWindows(); + aura::Window::Windows root_windows = Shell::GetAllRootWindows(); ASSERT_EQ(2U, root_windows.size()); window_->SetBoundsInScreen(gfx::Rect(0, 0, 50, 60), @@ -234,7 +234,7 @@ TEST_F(DragWindowResizerTest, WindowDragWithMultiDisplaysActiveRoot) { // The secondary display is logically on the right, but on the system (e.g. X) // layer, it's below the primary one. See UpdateDisplay() in ash_test_base.cc. UpdateDisplay("800x600,800x600"); - Shell::RootWindowList root_windows = Shell::GetAllRootWindows(); + aura::Window::Windows root_windows = Shell::GetAllRootWindows(); ASSERT_EQ(2U, root_windows.size()); aura::test::TestWindowDelegate delegate; @@ -271,7 +271,7 @@ TEST_F(DragWindowResizerTest, WindowDragWithMultiDisplaysRightToLeft) { return; UpdateDisplay("800x600,800x600"); - Shell::RootWindowList root_windows = Shell::GetAllRootWindows(); + aura::Window::Windows root_windows = Shell::GetAllRootWindows(); ASSERT_EQ(2U, root_windows.size()); window_->SetBoundsInScreen( @@ -300,7 +300,7 @@ TEST_F(DragWindowResizerTest, DragWindowController) { return; UpdateDisplay("800x600,800x600"); - Shell::RootWindowList root_windows = Shell::GetAllRootWindows(); + aura::Window::Windows root_windows = Shell::GetAllRootWindows(); ASSERT_EQ(2U, root_windows.size()); window_->SetBoundsInScreen(gfx::Rect(0, 0, 50, 60), @@ -436,7 +436,7 @@ TEST_F(DragWindowResizerTest, CursorDeviceScaleFactor) { // The secondary display is logically on the right, but on the system (e.g. X) // layer, it's below the primary one. See UpdateDisplay() in ash_test_base.cc. UpdateDisplay("400x400,800x800*2"); - Shell::RootWindowList root_windows = Shell::GetAllRootWindows(); + aura::Window::Windows root_windows = Shell::GetAllRootWindows(); ASSERT_EQ(2U, root_windows.size()); test::CursorManagerTestApi cursor_test_api( @@ -488,7 +488,7 @@ TEST_F(DragWindowResizerTest, MoveWindowAcrossDisplays) { // layer, it's below the primary one. See UpdateDisplay() in ash_test_base.cc. UpdateDisplay("400x400,400x400"); - Shell::RootWindowList root_windows = Shell::GetAllRootWindows(); + aura::Window::Windows root_windows = Shell::GetAllRootWindows(); ASSERT_EQ(2U, root_windows.size()); // Normal window can be moved across display. diff --git a/ash/wm/immersive_fullscreen_controller_unittest.cc b/ash/wm/immersive_fullscreen_controller_unittest.cc index 5345c3c..c25f9ee 100644 --- a/ash/wm/immersive_fullscreen_controller_unittest.cc +++ b/ash/wm/immersive_fullscreen_controller_unittest.cc @@ -437,7 +437,7 @@ TEST_F(ImmersiveFullscreenControllerTest, MouseEventsVerticalDisplayLayout) { ASSERT_TRUE(controller()->IsEnabled()); ASSERT_FALSE(controller()->IsRevealed()); - ash::Shell::RootWindowList root_windows = ash::Shell::GetAllRootWindows(); + aura::Window::Windows root_windows = ash::Shell::GetAllRootWindows(); ASSERT_EQ(root_windows[0], top_container()->GetWidget()->GetNativeWindow()->GetRootWindow()); diff --git a/ash/wm/mru_window_tracker.cc b/ash/wm/mru_window_tracker.cc index 5974aad..4ed9a1d 100644 --- a/ash/wm/mru_window_tracker.cc +++ b/ash/wm/mru_window_tracker.cc @@ -57,10 +57,10 @@ MruWindowTracker::WindowList BuildWindowListInternal( const std::list<aura::Window*>* mru_windows, bool top_most_at_end) { MruWindowTracker::WindowList windows; - Shell::RootWindowList root_windows = Shell::GetAllRootWindows(); + aura::Window::Windows root_windows = Shell::GetAllRootWindows(); aura::Window* active_root = Shell::GetTargetRootWindow(); - for (Shell::RootWindowList::const_iterator iter = root_windows.begin(); + for (aura::Window::Windows::const_iterator iter = root_windows.begin(); iter != root_windows.end(); ++iter) { if (*iter == active_root) continue; diff --git a/ash/wm/overview/window_overview.cc b/ash/wm/overview/window_overview.cc index b37ea16..e7d914b 100644 --- a/ash/wm/overview/window_overview.cc +++ b/ash/wm/overview/window_overview.cc @@ -314,8 +314,8 @@ aura::Window* WindowOverview::GetTargetedWindow(aura::Window* window) { } void WindowOverview::HideAndTrackNonOverviewWindows() { - Shell::RootWindowList root_windows = Shell::GetAllRootWindows(); - for (Shell::RootWindowList::const_iterator root_iter = root_windows.begin(); + aura::Window::Windows root_windows = Shell::GetAllRootWindows(); + for (aura::Window::Windows::const_iterator root_iter = root_windows.begin(); root_iter != root_windows.end(); ++root_iter) { for (size_t i = 0; i < kSwitchableWindowContainerIdsLength; ++i) { aura::Window* container = Shell::GetContainer(*root_iter, @@ -349,7 +349,7 @@ void WindowOverview::PositionWindows() { } PositionWindowsOnRoot(single_root_window_, windows); } else { - Shell::RootWindowList root_window_list = Shell::GetAllRootWindows(); + aura::Window::Windows root_window_list = Shell::GetAllRootWindows(); for (size_t i = 0; i < root_window_list.size(); ++i) PositionWindowsFromRoot(root_window_list[i]); } diff --git a/ash/wm/overview/window_selector.cc b/ash/wm/overview/window_selector.cc index 16345f6..a7818f5 100644 --- a/ash/wm/overview/window_selector.cc +++ b/ash/wm/overview/window_selector.cc @@ -281,8 +281,8 @@ WindowSelector::WindowSelector(const WindowList& windows, // Observe window activations and switchable containers on all root windows // for newly created windows during overview. Shell::GetInstance()->activation_client()->AddObserver(this); - Shell::RootWindowList root_windows = Shell::GetAllRootWindows(); - for (Shell::RootWindowList::const_iterator iter = root_windows.begin(); + aura::Window::Windows root_windows = Shell::GetAllRootWindows(); + for (aura::Window::Windows::const_iterator iter = root_windows.begin(); iter != root_windows.end(); ++iter) { for (size_t i = 0; i < kSwitchableWindowContainerIdsLength; ++i) { Shell::GetContainer(*iter, @@ -306,8 +306,8 @@ WindowSelector::~WindowSelector() { (*iter)->RemoveObserver(this); } Shell::GetInstance()->activation_client()->RemoveObserver(this); - Shell::RootWindowList root_windows = Shell::GetAllRootWindows(); - for (Shell::RootWindowList::const_iterator iter = root_windows.begin(); + aura::Window::Windows root_windows = Shell::GetAllRootWindows(); + for (aura::Window::Windows::const_iterator iter = root_windows.begin(); iter != root_windows.end(); ++iter) { for (size_t i = 0; i < kSwitchableWindowContainerIdsLength; ++i) { Shell::GetContainer(*iter, diff --git a/ash/wm/overview/window_selector_unittest.cc b/ash/wm/overview/window_selector_unittest.cc index 375b7e4..38916fd 100644 --- a/ash/wm/overview/window_selector_unittest.cc +++ b/ash/wm/overview/window_selector_unittest.cc @@ -691,7 +691,7 @@ TEST_F(WindowSelectorTest, MultipleDisplays) { return; UpdateDisplay("600x400,600x400"); - Shell::RootWindowList root_windows = Shell::GetAllRootWindows(); + aura::Window::Windows root_windows = Shell::GetAllRootWindows(); gfx::Rect bounds1(0, 0, 400, 400); gfx::Rect bounds2(650, 0, 400, 400); @@ -753,7 +753,7 @@ TEST_F(WindowSelectorTest, CycleOverviewUsesInitialDisplay) { return; UpdateDisplay("400x400,400x400"); - Shell::RootWindowList root_windows = Shell::GetAllRootWindows(); + aura::Window::Windows root_windows = Shell::GetAllRootWindows(); scoped_ptr<aura::Window> window1(CreateWindow(gfx::Rect(0, 0, 100, 100))); scoped_ptr<aura::Window> window2(CreateWindow(gfx::Rect(450, 0, 100, 100))); @@ -779,7 +779,7 @@ TEST_F(WindowSelectorTest, CycleMultipleDisplaysCopiesWindows) { return; UpdateDisplay("400x400,400x400"); - Shell::RootWindowList root_windows = Shell::GetAllRootWindows(); + aura::Window::Windows root_windows = Shell::GetAllRootWindows(); gfx::Rect root1_rect(0, 0, 100, 100); gfx::Rect root2_rect(450, 0, 100, 100); @@ -848,7 +848,7 @@ TEST_F(WindowSelectorTest, MultipleDisplaysOverviewTransitionToCycle) { return; UpdateDisplay("400x400,400x400"); - Shell::RootWindowList root_windows = Shell::GetAllRootWindows(); + aura::Window::Windows root_windows = Shell::GetAllRootWindows(); scoped_ptr<aura::Window> window1(CreateWindow(gfx::Rect(0, 0, 100, 100))); scoped_ptr<aura::Window> window2(CreateWindow(gfx::Rect(450, 0, 100, 100))); @@ -877,7 +877,7 @@ TEST_F(WindowSelectorTest, BoundsChangeDuringCycleOnOtherDisplay) { return; UpdateDisplay("400x400,400x400"); - Shell::RootWindowList root_windows = Shell::GetAllRootWindows(); + aura::Window::Windows root_windows = Shell::GetAllRootWindows(); scoped_ptr<aura::Window> window1(CreateWindow(gfx::Rect(0, 0, 100, 100))); scoped_ptr<aura::Window> window2(CreateWindow(gfx::Rect(450, 0, 100, 100))); diff --git a/ash/wm/panels/panel_layout_manager_unittest.cc b/ash/wm/panels/panel_layout_manager_unittest.cc index e387138..4bee3c4 100644 --- a/ash/wm/panels/panel_layout_manager_unittest.cc +++ b/ash/wm/panels/panel_layout_manager_unittest.cc @@ -336,7 +336,7 @@ TEST_F(PanelLayoutManagerTest, PanelAlignsToHiddenLauncherIconSecondDisplay) { // Keep the displays wide so that launchers have enough // space for launcher buttons. UpdateDisplay("400x400,600x400"); - Shell::RootWindowList root_windows = Shell::GetAllRootWindows(); + aura::Window::Windows root_windows = Shell::GetAllRootWindows(); scoped_ptr<aura::Window> normal_window( CreateNormalWindow(gfx::Rect(450, 0, 100, 100))); @@ -603,7 +603,7 @@ TEST_F(PanelLayoutManagerTest, PanelMoveBetweenMultipleDisplays) { // Keep the displays wide so that launchers have enough // space for launcher buttons. UpdateDisplay("600x400,600x400"); - Shell::RootWindowList root_windows = Shell::GetAllRootWindows(); + aura::Window::Windows root_windows = Shell::GetAllRootWindows(); scoped_ptr<aura::Window> p1_d1(CreatePanelWindow(gfx::Rect(0, 0, 50, 50))); scoped_ptr<aura::Window> p2_d1(CreatePanelWindow(gfx::Rect(0, 0, 50, 50))); @@ -683,7 +683,7 @@ TEST_F(PanelLayoutManagerTest, PanelAttachPositionMultipleDisplays) { // buttons. Use differently sized displays so the launcher is in a different // position on second display. UpdateDisplay("600x400,600x600"); - Shell::RootWindowList root_windows = Shell::GetAllRootWindows(); + aura::Window::Windows root_windows = Shell::GetAllRootWindows(); scoped_ptr<aura::Window> p1_d1(CreatePanelWindow(gfx::Rect(0, 0, 50, 50))); scoped_ptr<aura::Window> p1_d2(CreatePanelWindow(gfx::Rect(600, 0, 50, 50))); @@ -702,7 +702,7 @@ TEST_F(PanelLayoutManagerTest, PanelAlignmentSecondDisplay) { return; UpdateDisplay("600x400,600x400"); - Shell::RootWindowList root_windows = Shell::GetAllRootWindows(); + aura::Window::Windows root_windows = Shell::GetAllRootWindows(); scoped_ptr<aura::Window> p1_d2(CreatePanelWindow(gfx::Rect(600, 0, 50, 50))); EXPECT_EQ(root_windows[1], p1_d2->GetRootWindow()); diff --git a/ash/wm/panels/panel_window_resizer_unittest.cc b/ash/wm/panels/panel_window_resizer_unittest.cc index e5c4157..9a01217 100644 --- a/ash/wm/panels/panel_window_resizer_unittest.cc +++ b/ash/wm/panels/panel_window_resizer_unittest.cc @@ -286,7 +286,7 @@ TEST_F(PanelWindowResizerTest, PanelDetachReattachMultipleDisplays) { return; UpdateDisplay("600x400,600x400"); - Shell::RootWindowList root_windows = Shell::GetAllRootWindows(); + aura::Window::Windows root_windows = Shell::GetAllRootWindows(); scoped_ptr<aura::Window> window( CreatePanelWindow(gfx::Point(600, 0))); EXPECT_EQ(root_windows[1], window->GetRootWindow()); @@ -298,7 +298,7 @@ TEST_F(PanelWindowResizerTest, DetachThenDragAcrossDisplays) { return; UpdateDisplay("600x400,600x400"); - Shell::RootWindowList root_windows = Shell::GetAllRootWindows(); + aura::Window::Windows root_windows = Shell::GetAllRootWindows(); scoped_ptr<aura::Window> window( CreatePanelWindow(gfx::Point(0, 0))); gfx::Rect initial_bounds = window->GetBoundsInScreen(); @@ -327,7 +327,7 @@ TEST_F(PanelWindowResizerTest, DetachAcrossDisplays) { return; UpdateDisplay("600x400,600x400"); - Shell::RootWindowList root_windows = Shell::GetAllRootWindows(); + aura::Window::Windows root_windows = Shell::GetAllRootWindows(); scoped_ptr<aura::Window> window( CreatePanelWindow(gfx::Point(0, 0))); gfx::Rect initial_bounds = window->GetBoundsInScreen(); @@ -347,7 +347,7 @@ TEST_F(PanelWindowResizerTest, DetachThenAttachToSecondDisplay) { return; UpdateDisplay("600x400,600x600"); - Shell::RootWindowList root_windows = Shell::GetAllRootWindows(); + aura::Window::Windows root_windows = Shell::GetAllRootWindows(); scoped_ptr<aura::Window> window( CreatePanelWindow(gfx::Point(0, 0))); gfx::Rect initial_bounds = window->GetBoundsInScreen(); @@ -380,7 +380,7 @@ TEST_F(PanelWindowResizerTest, AttachToSecondDisplay) { return; UpdateDisplay("600x400,600x600"); - Shell::RootWindowList root_windows = Shell::GetAllRootWindows(); + aura::Window::Windows root_windows = Shell::GetAllRootWindows(); scoped_ptr<aura::Window> window( CreatePanelWindow(gfx::Point(0, 0))); gfx::Rect initial_bounds = window->GetBoundsInScreen(); diff --git a/ash/wm/partial_screenshot_view.cc b/ash/wm/partial_screenshot_view.cc index 66a4259..b71c7c8 100644 --- a/ash/wm/partial_screenshot_view.cc +++ b/ash/wm/partial_screenshot_view.cc @@ -84,8 +84,8 @@ PartialScreenshotView::StartPartialScreenshot( ScreenshotDelegate* screenshot_delegate) { std::vector<PartialScreenshotView*> views; OverlayDelegate* overlay_delegate = new OverlayDelegate(); - Shell::RootWindowList root_windows = Shell::GetAllRootWindows(); - for (Shell::RootWindowList::iterator it = root_windows.begin(); + aura::Window::Windows root_windows = Shell::GetAllRootWindows(); + for (aura::Window::Windows::iterator it = root_windows.begin(); it != root_windows.end(); ++it) { PartialScreenshotView* new_view = new PartialScreenshotView( overlay_delegate, screenshot_delegate); @@ -108,7 +108,7 @@ PartialScreenshotView::~PartialScreenshotView() { screenshot_delegate_ = NULL; } -void PartialScreenshotView::Init(aura::RootWindow* root_window) { +void PartialScreenshotView::Init(aura::Window* root_window) { views::Widget* widget = new views::Widget; views::Widget::InitParams params( views::Widget::InitParams::TYPE_WINDOW_FRAMELESS); diff --git a/ash/wm/partial_screenshot_view.h b/ash/wm/partial_screenshot_view.h index 85b9f81..8d799e3 100644 --- a/ash/wm/partial_screenshot_view.h +++ b/ash/wm/partial_screenshot_view.h @@ -13,10 +13,6 @@ #include "ui/gfx/point.h" #include "ui/views/widget/widget_delegate.h" -namespace aura { -class RootWindow; -} - namespace ash { class ScreenshotDelegate; @@ -42,7 +38,7 @@ class ASH_EXPORT PartialScreenshotView : public views::WidgetDelegateView { virtual ~PartialScreenshotView(); // Initializes partial screenshot UI widget for |root_window|. - void Init(aura::RootWindow* root_window); + void Init(aura::Window* root_window); // Returns the currently selected region. gfx::Rect GetScreenshotRect() const; diff --git a/ash/wm/system_modal_container_layout_manager_unittest.cc b/ash/wm/system_modal_container_layout_manager_unittest.cc index 551382b..6ae3369 100644 --- a/ash/wm/system_modal_container_layout_manager_unittest.cc +++ b/ash/wm/system_modal_container_layout_manager_unittest.cc @@ -443,7 +443,7 @@ TEST_F(SystemModalContainerLayoutManagerTest, MultiDisplays) { scoped_ptr<aura::Window> normal(OpenToplevelTestWindow(false)); normal->SetBounds(gfx::Rect(100, 100, 50, 50)); - Shell::RootWindowList root_windows = Shell::GetAllRootWindows(); + aura::Window::Windows root_windows = Shell::GetAllRootWindows(); EXPECT_EQ(2U, root_windows.size()); aura::Window* container1 = Shell::GetContainer( root_windows[0], ash::internal::kShellWindowId_SystemModalContainer); diff --git a/ash/wm/window_cycle_controller_unittest.cc b/ash/wm/window_cycle_controller_unittest.cc index 7bb9d27..67df90ef 100644 --- a/ash/wm/window_cycle_controller_unittest.cc +++ b/ash/wm/window_cycle_controller_unittest.cc @@ -326,7 +326,7 @@ TEST_F(WindowCycleControllerTest, AlwaysOnTopMultipleRootWindows) { // Set up a second root window UpdateDisplay("1000x600,600x400"); - Shell::RootWindowList root_windows = Shell::GetAllRootWindows(); + aura::Window::Windows root_windows = Shell::GetAllRootWindows(); ASSERT_EQ(2U, root_windows.size()); WindowCycleController* controller = diff --git a/ash/wm/workspace/phantom_window_controller.cc b/ash/wm/workspace/phantom_window_controller.cc index 0eb934d..0e69c85 100644 --- a/ash/wm/workspace/phantom_window_controller.cc +++ b/ash/wm/workspace/phantom_window_controller.cc @@ -124,7 +124,7 @@ void PhantomWindowController::Show(const gfx::Rect& bounds_in_screen) { // in one root window and progress into another root. aura::Window* start_root = wm::GetRootWindowMatching(start_bounds_); if (start_root == target_root) { - Shell::RootWindowList root_windows = Shell::GetAllRootWindows(); + aura::Window::Windows root_windows = Shell::GetAllRootWindows(); for (size_t i = 0; i < root_windows.size(); ++i) { if (root_windows[i] != target_root && root_windows[i]->GetBoundsInScreen().Intersects(start_bounds_)) { diff --git a/ash/wm/workspace/workspace_event_handler_unittest.cc b/ash/wm/workspace/workspace_event_handler_unittest.cc index d0dcdb6..feec4bd 100644 --- a/ash/wm/workspace/workspace_event_handler_unittest.cc +++ b/ash/wm/workspace/workspace_event_handler_unittest.cc @@ -158,7 +158,7 @@ TEST_F(WorkspaceEventHandlerTest, DoubleClickSingleAxisResizeEdge) { gfx::Rect work_area2 = ScreenAsh::GetSecondaryDisplay().work_area(); restored_bounds.SetRect(220,20, 50, 50); window->SetBoundsInScreen(restored_bounds, ScreenAsh::GetSecondaryDisplay()); - aura::RootWindow* second_root = Shell::GetAllRootWindows()[1]; + aura::Window* second_root = Shell::GetAllRootWindows()[1]; EXPECT_EQ(second_root, window->GetRootWindow()); aura::test::EventGenerator generator2(second_root, window.get()); diff --git a/ash/wm/workspace/workspace_layout_manager_unittest.cc b/ash/wm/workspace/workspace_layout_manager_unittest.cc index 1963b9b..4302f1d 100644 --- a/ash/wm/workspace/workspace_layout_manager_unittest.cc +++ b/ash/wm/workspace/workspace_layout_manager_unittest.cc @@ -97,7 +97,7 @@ TEST_F(WorkspaceLayoutManagerTest, KeepMinimumVisibilityInDisplays) { return; UpdateDisplay("300x400,400x500"); - Shell::RootWindowList root_windows = Shell::GetAllRootWindows(); + aura::Window::Windows root_windows = Shell::GetAllRootWindows(); DisplayLayout layout(DisplayLayout::TOP, 0); Shell::GetInstance()->display_manager()-> @@ -160,7 +160,7 @@ TEST_F(WorkspaceLayoutManagerTest, MaximizeInDisplayToBeRestored) { return; UpdateDisplay("300x400,400x500"); - Shell::RootWindowList root_windows = Shell::GetAllRootWindows(); + aura::Window::Windows root_windows = Shell::GetAllRootWindows(); scoped_ptr<aura::Window> window( CreateTestWindowInShellWithBounds(gfx::Rect(1, 2, 30, 40))); @@ -210,7 +210,7 @@ TEST_F(WorkspaceLayoutManagerTest, FullscreenInDisplayToBeRestored) { return; UpdateDisplay("300x400,400x500"); - Shell::RootWindowList root_windows = Shell::GetAllRootWindows(); + aura::Window::Windows root_windows = Shell::GetAllRootWindows(); scoped_ptr<aura::Window> window( CreateTestWindowInShellWithBounds(gfx::Rect(1, 2, 30, 40))); diff --git a/ash/wm/workspace/workspace_window_resizer.cc b/ash/wm/workspace/workspace_window_resizer.cc index e788b63..8256b68 100644 --- a/ash/wm/workspace/workspace_window_resizer.cc +++ b/ash/wm/workspace/workspace_window_resizer.cc @@ -743,10 +743,10 @@ bool WorkspaceWindowResizer::UpdateMagnetismWindow(const gfx::Rect& bounds, if (!window_state()->CanResize() || !window_state()->tracked_by_workspace()) return false; - Shell::RootWindowList root_windows = Shell::GetAllRootWindows(); - for (Shell::RootWindowList::iterator iter = root_windows.begin(); + aura::Window::Windows root_windows = Shell::GetAllRootWindows(); + for (aura::Window::Windows::iterator iter = root_windows.begin(); iter != root_windows.end(); ++iter) { - const aura::RootWindow* root_window = *iter; + const aura::Window* root_window = *iter; // Test all children from the desktop in each root window. const aura::Window::Windows& children = Shell::GetContainer( root_window, kShellWindowId_DefaultContainer)->children(); diff --git a/ash/wm/workspace/workspace_window_resizer_unittest.cc b/ash/wm/workspace/workspace_window_resizer_unittest.cc index d19a1cf..999a17d 100644 --- a/ash/wm/workspace/workspace_window_resizer_unittest.cc +++ b/ash/wm/workspace/workspace_window_resizer_unittest.cc @@ -602,7 +602,7 @@ TEST_F(WorkspaceWindowResizerTest, Edge) { return; UpdateDisplay("800x600,500x600"); - Shell::RootWindowList root_windows = Shell::GetAllRootWindows(); + aura::Window::Windows root_windows = Shell::GetAllRootWindows(); EXPECT_EQ(root_windows[0], window_->GetRootWindow()); // Window is wide enough not to get docked right away. window_->SetBoundsInScreen(gfx::Rect(800, 10, 400, 60), @@ -646,7 +646,7 @@ TEST_F(WorkspaceWindowResizerTest, CancelSnapPhantom) { return; UpdateDisplay("800x600,800x600"); - Shell::RootWindowList root_windows = Shell::GetAllRootWindows(); + aura::Window::Windows root_windows = Shell::GetAllRootWindows(); ASSERT_EQ(2U, root_windows.size()); window_->SetBoundsInScreen(gfx::Rect(0, 0, 50, 60), @@ -1876,7 +1876,7 @@ TEST_F(WorkspaceWindowResizerTest, PhantomWindowShow) { UpdateDisplay("500x400,500x400"); window_->SetBoundsInScreen(gfx::Rect(0, 0, 50, 60), Shell::GetScreen()->GetPrimaryDisplay()); - Shell::RootWindowList root_windows = Shell::GetAllRootWindows(); + aura::Window::Windows root_windows = Shell::GetAllRootWindows(); EXPECT_EQ(root_windows[0], window_->GetRootWindow()); scoped_ptr<WindowResizer> resizer(CreateResizerForTest( diff --git a/chrome/browser/ui/ash/ash_util.cc b/chrome/browser/ui/ash/ash_util.cc index f6d6ce2..8d51b01 100644 --- a/chrome/browser/ui/ash/ash_util.cc +++ b/chrome/browser/ui/ash/ash_util.cc @@ -20,10 +20,10 @@ bool IsNativeViewInAsh(gfx::NativeView native_view) { if (!ash::Shell::HasInstance()) return false; - ash::Shell::RootWindowList root_windows = + aura::Window::Windows root_windows = ash::Shell::GetInstance()->GetAllRootWindows(); - for (ash::Shell::RootWindowList::const_iterator it = root_windows.begin(); + for (aura::Window::Windows::const_iterator it = root_windows.begin(); it != root_windows.end(); ++it) { if ((*it)->Contains(native_view)) return true; diff --git a/chrome/browser/ui/ash/launcher/browser_status_monitor.cc b/chrome/browser/ui/ash/launcher/browser_status_monitor.cc index 2f1b526..8d889dc 100644 --- a/chrome/browser/ui/ash/launcher/browser_status_monitor.cc +++ b/chrome/browser/ui/ash/launcher/browser_status_monitor.cc @@ -60,8 +60,8 @@ BrowserStatusMonitor::BrowserStatusMonitor( if (ash::Shell::HasInstance()) { // We can't assume all RootWindows have the same ActivationClient. // Add a RootWindow and its ActivationClient to the observed list. - ash::Shell::RootWindowList root_windows = ash::Shell::GetAllRootWindows(); - ash::Shell::RootWindowList::const_iterator iter = root_windows.begin(); + aura::Window::Windows root_windows = ash::Shell::GetAllRootWindows(); + aura::Window::Windows::const_iterator iter = root_windows.begin(); for (; iter != root_windows.end(); ++iter) { // |observed_activation_clients_| can have the same activation client // multiple times - which would be handled by the used diff --git a/chrome/browser/ui/ash/launcher/chrome_launcher_controller.cc b/chrome/browser/ui/ash/launcher/chrome_launcher_controller.cc index 019736f..ba69ae8 100644 --- a/chrome/browser/ui/ash/launcher/chrome_launcher_controller.cc +++ b/chrome/browser/ui/ash/launcher/chrome_launcher_controller.cc @@ -1658,9 +1658,9 @@ void ChromeLauncherController::SetShelfAutoHideBehaviorPrefs( } void ChromeLauncherController::SetShelfAutoHideBehaviorFromPrefs() { - ash::Shell::RootWindowList root_windows = ash::Shell::GetAllRootWindows(); + aura::Window::Windows root_windows = ash::Shell::GetAllRootWindows(); - for (ash::Shell::RootWindowList::const_iterator iter = root_windows.begin(); + for (aura::Window::Windows::const_iterator iter = root_windows.begin(); iter != root_windows.end(); ++iter) { ash::Shell::GetInstance()->SetShelfAutoHideBehavior( GetShelfAutoHideBehavior(*iter), *iter); @@ -1671,9 +1671,9 @@ void ChromeLauncherController::SetShelfAlignmentFromPrefs() { if (!ash::ShelfWidget::ShelfAlignmentAllowed()) return; - ash::Shell::RootWindowList root_windows = ash::Shell::GetAllRootWindows(); + aura::Window::Windows root_windows = ash::Shell::GetAllRootWindows(); - for (ash::Shell::RootWindowList::const_iterator iter = root_windows.begin(); + for (aura::Window::Windows::const_iterator iter = root_windows.begin(); iter != root_windows.end(); ++iter) { // See comment in |kShelfAlignment| as to why we consider two prefs. const std::string alignment_value( diff --git a/chrome/browser/ui/ash/multi_user_window_manager.cc b/chrome/browser/ui/ash/multi_user_window_manager.cc index 1acf615..6df5012 100644 --- a/chrome/browser/ui/ash/multi_user_window_manager.cc +++ b/chrome/browser/ui/ash/multi_user_window_manager.cc @@ -69,11 +69,11 @@ bool IsProcessingUserEvent() { // anymore) and the root window should therefore still have the event which // lead to the menu invocation, but it is not. By fixing that problem this // would "magically work". - ash::Shell::RootWindowList root_window_list = ash::Shell::GetAllRootWindows(); - for (ash::Shell::RootWindowList::iterator it = root_window_list.begin(); + aura::Window::Windows root_window_list = ash::Shell::GetAllRootWindows(); + for (aura::Window::Windows::iterator it = root_window_list.begin(); it != root_window_list.end(); ++it) { - if (IsUserEvent((*it)->current_event())) + if (IsUserEvent((*it)->GetDispatcher()->current_event())) return true; } return false; diff --git a/chrome/browser/ui/ash/screenshot_taker.cc b/chrome/browser/ui/ash/screenshot_taker.cc index 169e85b..880d0f8 100644 --- a/chrome/browser/ui/ash/screenshot_taker.cc +++ b/chrome/browser/ui/ash/screenshot_taker.cc @@ -341,7 +341,7 @@ void ScreenshotTaker::HandleTakeScreenshotForAllRootWindows() { std::string screenshot_basename = !screenshot_basename_for_test_.empty() ? screenshot_basename_for_test_ : GetScreenshotBaseFilename(); - ash::Shell::RootWindowList root_windows = ash::Shell::GetAllRootWindows(); + aura::Window::Windows root_windows = ash::Shell::GetAllRootWindows(); // Reorder root_windows to take the primary root window's snapshot at first. aura::Window* primary_root = ash::Shell::GetPrimaryRootWindow(); if (*(root_windows.begin()) != primary_root) { @@ -350,7 +350,7 @@ void ScreenshotTaker::HandleTakeScreenshotForAllRootWindows() { root_windows.insert(root_windows.begin(), primary_root->GetDispatcher()); } for (size_t i = 0; i < root_windows.size(); ++i) { - aura::RootWindow* root_window = root_windows[i]; + aura::Window* root_window = root_windows[i]; scoped_refptr<base::RefCountedBytes> png_data(new base::RefCountedBytes); std::string basename = screenshot_basename; gfx::Rect rect = root_window->bounds(); diff --git a/chrome/browser/ui/views/tabs/tab_drag_controller_interactive_uitest.cc b/chrome/browser/ui/views/tabs/tab_drag_controller_interactive_uitest.cc index 8a07bb4..80159fa 100644 --- a/chrome/browser/ui/views/tabs/tab_drag_controller_interactive_uitest.cc +++ b/chrome/browser/ui/views/tabs/tab_drag_controller_interactive_uitest.cc @@ -1392,9 +1392,9 @@ IN_PROC_BROWSER_TEST_P(DetachToBrowserInSeparateDisplayTabDragControllerTest, // With the touch input the browser cannot be dragged from one screen // to another and the window stays on the first screen. if (input_source() == INPUT_SOURCE_MOUSE) { - std::vector<aura::RootWindow*> roots(ash::Shell::GetAllRootWindows()); + aura::Window::Windows roots = ash::Shell::GetAllRootWindows(); ASSERT_EQ(2u, roots.size()); - aura::RootWindow* second_root = roots[1]; + aura::Window* second_root = roots[1]; EXPECT_EQ(second_root, new_browser->window()->GetNativeWindow()->GetRootWindow()); } @@ -1444,9 +1444,9 @@ IN_PROC_BROWSER_TEST_P(DetachToBrowserInSeparateDisplayTabDragControllerTest, ResetIDs(browser2->tab_strip_model(), 100); // Move the second browser to the second display. - std::vector<aura::RootWindow*> roots(ash::Shell::GetAllRootWindows()); + aura::Window::Windows roots = ash::Shell::GetAllRootWindows(); ASSERT_EQ(2u, roots.size()); - aura::RootWindow* second_root = roots[1]; + aura::Window* second_root = roots[1]; gfx::Rect work_area = gfx::Screen::GetNativeScreen()->GetDisplayNearestWindow( second_root).work_area(); browser2->window()->SetBounds(work_area); @@ -1494,9 +1494,9 @@ IN_PROC_BROWSER_TEST_P(DetachToBrowserInSeparateDisplayTabDragControllerTest, ResetIDs(browser2->tab_strip_model(), 100); // Move both browsers to the second display. - std::vector<aura::RootWindow*> roots(ash::Shell::GetAllRootWindows()); + aura::Window::Windows roots = ash::Shell::GetAllRootWindows(); ASSERT_EQ(2u, roots.size()); - aura::RootWindow* second_root = roots[1]; + aura::Window* second_root = roots[1]; gfx::Rect work_area = gfx::Screen::GetNativeScreen()->GetDisplayNearestWindow( second_root).work_area(); browser()->window()->SetBounds(work_area); @@ -1553,10 +1553,10 @@ IN_PROC_BROWSER_TEST_P(DetachToBrowserInSeparateDisplayTabDragControllerTest, TabStrip* tab_strip = GetTabStripForBrowser(browser()); // Create another browser on the second display. - std::vector<aura::RootWindow*> roots(ash::Shell::GetAllRootWindows()); + aura::Window::Windows roots = ash::Shell::GetAllRootWindows(); ASSERT_EQ(2u, roots.size()); - aura::RootWindow* first_root = roots[0]; - aura::RootWindow* second_root = roots[1]; + aura::Window* first_root = roots[0]; + aura::Window* second_root = roots[1]; gfx::Rect work_area = gfx::Screen::GetNativeScreen()->GetDisplayNearestWindow( second_root).work_area(); work_area.Inset(20,20,20,60); @@ -1626,9 +1626,9 @@ IN_PROC_BROWSER_TEST_P(DetachToBrowserInSeparateDisplayTabDragControllerTest, ResetIDs(browser2->tab_strip_model(), 100); // Move the second browser to the second display. - std::vector<aura::RootWindow*> roots(ash::Shell::GetAllRootWindows()); + aura::Window::Windows roots = ash::Shell::GetAllRootWindows(); ASSERT_EQ(2u, roots.size()); - aura::RootWindow* second_root = roots[1]; + aura::Window* second_root = roots[1]; gfx::Rect work_area = gfx::Screen::GetNativeScreen()->GetDisplayNearestWindow( second_root).work_area(); browser2->window()->SetBounds(work_area); @@ -1772,7 +1772,7 @@ IN_PROC_BROWSER_TEST_P(DifferentDeviceScaleFactorDisplayTabDragControllerTest, TabStrip* tab_strip = GetTabStripForBrowser(browser()); // Move the second browser to the second display. - std::vector<aura::RootWindow*> roots(ash::Shell::GetAllRootWindows()); + aura::Window::Windows roots = ash::Shell::GetAllRootWindows(); ASSERT_EQ(2u, roots.size()); // Move to the first tab and drag it enough so that it detaches. @@ -1838,7 +1838,7 @@ void CancelDragTabToWindowInSeparateDisplayStep3( void CancelDragTabToWindowInSeparateDisplayStep2( DetachToBrowserInSeparateDisplayAndCancelTabDragControllerTest* test, TabStrip* tab_strip, - aura::RootWindow* current_root, + aura::Window* current_root, gfx::Point final_destination, const BrowserList* browser_list) { ASSERT_FALSE(tab_strip->IsDragSessionActive()); @@ -1868,7 +1868,7 @@ IN_PROC_BROWSER_TEST_F( EXPECT_EQ("0 1", IDString(browser()->tab_strip_model())); // Move the second browser to the second display. - std::vector<aura::RootWindow*> roots(ash::Shell::GetAllRootWindows()); + aura::Window::Windows roots = ash::Shell::GetAllRootWindows(); ASSERT_EQ(2u, roots.size()); gfx::Point final_destination = gfx::Screen::GetNativeScreen()->GetDisplayNearestWindow( @@ -1899,7 +1899,7 @@ IN_PROC_BROWSER_TEST_F( IN_PROC_BROWSER_TEST_F( DetachToBrowserInSeparateDisplayAndCancelTabDragControllerTest, CancelDragTabToWindowIn1stDisplay) { - std::vector<aura::RootWindow*> roots(ash::Shell::GetAllRootWindows()); + aura::Window::Windows roots = ash::Shell::GetAllRootWindows(); ASSERT_EQ(2u, roots.size()); // Add another tab. diff --git a/chrome/browser/ui/window_sizer/window_sizer_ash_uitest.cc b/chrome/browser/ui/window_sizer/window_sizer_ash_uitest.cc index cd38b3a..05e0041 100644 --- a/chrome/browser/ui/window_sizer/window_sizer_ash_uitest.cc +++ b/chrome/browser/ui/window_sizer/window_sizer_ash_uitest.cc @@ -43,7 +43,7 @@ void CloseBrowser(Browser* browser) { base::MessageLoop::current()->RunUntilIdle(); } -gfx::Rect GetChromeIconBoundsForRootWindow(aura::RootWindow* root_window) { +gfx::Rect GetChromeIconBoundsForRootWindow(aura::Window* root_window) { ash::Launcher* launcher = ash::Launcher::ForWindow(root_window); const ash::internal::ShelfView* shelf_view = ash::test::LauncherTestAPI(launcher).shelf_view(); @@ -53,7 +53,7 @@ gfx::Rect GetChromeIconBoundsForRootWindow(aura::RootWindow* root_window) { return view_model->view_at(1)->GetBoundsInScreen(); } -void OpenBrowserUsingShelfOnRootWindow(aura::RootWindow* root_window) { +void OpenBrowserUsingShelfOnRootWindow(aura::Window* root_window) { aura::test::EventGenerator generator(root_window); gfx::Point center = GetChromeIconBoundsForRootWindow(root_window).CenterPoint(); @@ -80,7 +80,7 @@ IN_PROC_BROWSER_TEST_F(WindowSizerTest, // Don't shutdown when closing the last browser window. chrome::StartKeepAlive(); - ash::Shell::RootWindowList root_windows = ash::Shell::GetAllRootWindows(); + aura::Window::Windows root_windows = ash::Shell::GetAllRootWindows(); BrowserList* browser_list = BrowserList::GetInstance(chrome::HOST_DESKTOP_TYPE_ASH); @@ -150,7 +150,7 @@ class WindowSizerContextMenuTest : public WindowSizerTest { DISALLOW_COPY_AND_ASSIGN(WindowSizerContextMenuTest); }; -void OpenBrowserUsingContextMenuOnRootWindow(aura::RootWindow* root_window) { +void OpenBrowserUsingContextMenuOnRootWindow(aura::Window* root_window) { gfx::Point chrome_icon = GetChromeIconBoundsForRootWindow(root_window).CenterPoint(); gfx::Point release_point = chrome_icon; @@ -170,7 +170,7 @@ IN_PROC_BROWSER_TEST_F(WindowSizerContextMenuTest, views::MenuController::TurnOffMenuSelectionHoldForTest(); - ash::Shell::RootWindowList root_windows = ash::Shell::GetAllRootWindows(); + aura::Window::Windows root_windows = ash::Shell::GetAllRootWindows(); BrowserList* browser_list = BrowserList::GetInstance(chrome::HOST_DESKTOP_TYPE_ASH); |