summaryrefslogtreecommitdiffstats
path: root/ash
diff options
context:
space:
mode:
authorben@chromium.org <ben@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-10-25 19:22:45 +0000
committerben@chromium.org <ben@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-10-25 19:22:45 +0000
commitbf9cdb36cc79becab099c9f37eb80284fb203f45 (patch)
tree4c9011f0aa08ac613027abd372cec3a3b613032b /ash
parentfef72c1c9890633a237e06ccb0d0f4ce2ca6c9c1 (diff)
downloadchromium_src-bf9cdb36cc79becab099c9f37eb80284fb203f45.zip
chromium_src-bf9cdb36cc79becab099c9f37eb80284fb203f45.tar.gz
chromium_src-bf9cdb36cc79becab099c9f37eb80284fb203f45.tar.bz2
Make GetRootWindow() return a Window instead of a RootWindow.
Also adds a typedef from RootWindow to WindowEventDispatcher, the eventual name of this type. Adds a GetDispatcher() method that crawls up to the root Window and returns the WindowEventDispatcher. R=sky@chromium.org http://crbug.com/308843 Review URL: https://codereview.chromium.org/37733003 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@231077 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ash')
-rw-r--r--ash/accelerators/accelerator_controller.cc2
-rw-r--r--ash/accelerators/accelerator_controller_unittest.cc26
-rw-r--r--ash/accelerators/exit_warning_handler.cc4
-rw-r--r--ash/accelerators/nested_dispatcher_controller_unittest.cc14
-rw-r--r--ash/autoclick/autoclick_controller.cc10
-rw-r--r--ash/autoclick/autoclick_unittest.cc1
-rw-r--r--ash/desktop_background/desktop_background_controller_unittest.cc2
-rw-r--r--ash/dip_unittest.cc4
-rw-r--r--ash/display/display_controller.cc30
-rw-r--r--ash/display/display_controller.h4
-rw-r--r--ash/display/display_controller_unittest.cc58
-rw-r--r--ash/display/display_manager_unittest.cc12
-rw-r--r--ash/display/mirror_window_controller.cc8
-rw-r--r--ash/display/mirror_window_controller_unittest.cc6
-rw-r--r--ash/display/mouse_cursor_event_filter.cc8
-rw-r--r--ash/display/mouse_cursor_event_filter.h7
-rw-r--r--ash/display/root_window_transformers.cc12
-rw-r--r--ash/display/root_window_transformers.h4
-rw-r--r--ash/display/root_window_transformers_unittest.cc2
-rw-r--r--ash/display/screen_position_controller.cc29
-rw-r--r--ash/drag_drop/drag_drop_controller_unittest.cc7
-rw-r--r--ash/drag_drop/drag_drop_tracker.cc2
-rw-r--r--ash/focus_cycler_unittest.cc2
-rw-r--r--ash/launcher/launcher_item_delegate.h2
-rw-r--r--ash/magnifier/magnification_controller.cc18
-rw-r--r--ash/magnifier/magnification_controller_unittest.cc6
-rw-r--r--ash/magnifier/partial_magnification_controller.cc6
-rw-r--r--ash/magnifier/partial_magnification_controller.h2
-rw-r--r--ash/root_window_controller.cc10
-rw-r--r--ash/root_window_controller.h4
-rw-r--r--ash/root_window_controller_unittest.cc10
-rw-r--r--ash/root_window_settings.cc6
-rw-r--r--ash/root_window_settings.h8
-rw-r--r--ash/scoped_target_root_window.cc2
-rw-r--r--ash/scoped_target_root_window.h4
-rw-r--r--ash/screensaver/screensaver_view.cc2
-rw-r--r--ash/shelf/app_list_shelf_item_delegate.cc2
-rw-r--r--ash/shelf/app_list_shelf_item_delegate.h2
-rw-r--r--ash/shelf/shelf_alignment_menu.cc4
-rw-r--r--ash/shelf/shelf_alignment_menu.h4
-rw-r--r--ash/shelf/shelf_layout_manager.h2
-rw-r--r--ash/shelf/shelf_layout_manager_observer.h4
-rw-r--r--ash/shelf/shelf_layout_manager_unittest.cc4
-rw-r--r--ash/shelf/shelf_tooltip_manager.cc2
-rw-r--r--ash/shelf/shelf_tooltip_manager_unittest.cc6
-rw-r--r--ash/shelf/shelf_view.cc2
-rw-r--r--ash/shelf/shelf_widget_unittest.cc2
-rw-r--r--ash/shell.cc29
-rw-r--r--ash/shell.h34
-rw-r--r--ash/shell/content_client/shell_browser_main_parts.cc2
-rw-r--r--ash/shell/context_menu.cc2
-rw-r--r--ash/shell/context_menu.h4
-rw-r--r--ash/shell/shell_delegate_impl.cc2
-rw-r--r--ash/shell/shell_delegate_impl.h2
-rw-r--r--ash/shell/window_watcher.cc4
-rw-r--r--ash/shell/window_watcher_launcher_item_delegate.cc2
-rw-r--r--ash/shell/window_watcher_launcher_item_delegate.h2
-rw-r--r--ash/shell/window_watcher_unittest.cc2
-rw-r--r--ash/shell_delegate.h2
-rw-r--r--ash/shell_observer.h6
-rw-r--r--ash/shell_unittest.cc9
-rw-r--r--ash/system/tray/tray_background_view.cc4
-rw-r--r--ash/system/tray/tray_event_filter.cc2
-rw-r--r--ash/system/web_notification/web_notification_tray.cc8
-rw-r--r--ash/test/ash_test_base.cc8
-rw-r--r--ash/test/ash_test_base.h6
-rw-r--r--ash/test/ash_test_helper.cc4
-rw-r--r--ash/test/ash_test_helper.h8
-rw-r--r--ash/test/test_launcher_item_delegate.cc2
-rw-r--r--ash/test/test_launcher_item_delegate.h2
-rw-r--r--ash/test/test_shell_delegate.cc2
-rw-r--r--ash/test/test_shell_delegate.h2
-rw-r--r--ash/test/ui_controls_factory_ash.cc9
-rw-r--r--ash/touch/touch_observer_hud.h2
-rw-r--r--ash/touch/touch_observer_hud_unittest.cc16
-rw-r--r--ash/wm/app_list_controller.cc4
-rw-r--r--ash/wm/app_list_controller.h2
-rw-r--r--ash/wm/ash_focus_rules.cc4
-rw-r--r--ash/wm/ash_native_cursor_manager_unittest.cc7
-rw-r--r--ash/wm/base_layout_manager.cc3
-rw-r--r--ash/wm/base_layout_manager.h7
-rw-r--r--ash/wm/caption_buttons/frame_maximize_button_unittest.cc7
-rw-r--r--ash/wm/coordinate_conversion.cc5
-rw-r--r--ash/wm/coordinate_conversion.h5
-rw-r--r--ash/wm/dock/docked_window_layout_manager.cc4
-rw-r--r--ash/wm/dock/docked_window_layout_manager.h4
-rw-r--r--ash/wm/dock/docked_window_resizer.cc2
-rw-r--r--ash/wm/drag_window_resizer.cc4
-rw-r--r--ash/wm/drag_window_resizer_unittest.cc2
-rw-r--r--ash/wm/event_client_impl.cc2
-rw-r--r--ash/wm/gestures/long_press_affordance_handler.cc6
-rw-r--r--ash/wm/header_painter.cc15
-rw-r--r--ash/wm/header_painter.h7
-rw-r--r--ash/wm/header_painter_unittest.cc2
-rw-r--r--ash/wm/lock_state_controller.cc7
-rw-r--r--ash/wm/lock_state_controller_unittest.cc2
-rw-r--r--ash/wm/mru_window_tracker.cc8
-rw-r--r--ash/wm/overview/scoped_transform_overview_window.cc4
-rw-r--r--ash/wm/overview/scoped_transform_overview_window.h3
-rw-r--r--ash/wm/overview/scoped_window_copy.cc4
-rw-r--r--ash/wm/overview/scoped_window_copy.h2
-rw-r--r--ash/wm/overview/window_overview.cc8
-rw-r--r--ash/wm/overview/window_overview.h14
-rw-r--r--ash/wm/overview/window_selector.cc4
-rw-r--r--ash/wm/overview/window_selector_item.cc2
-rw-r--r--ash/wm/overview/window_selector_item.h9
-rw-r--r--ash/wm/overview/window_selector_panels.cc4
-rw-r--r--ash/wm/overview/window_selector_panels.h9
-rw-r--r--ash/wm/overview/window_selector_unittest.cc13
-rw-r--r--ash/wm/overview/window_selector_window.cc4
-rw-r--r--ash/wm/overview/window_selector_window.h5
-rw-r--r--ash/wm/panels/panel_layout_manager.cc3
-rw-r--r--ash/wm/panels/panel_layout_manager.h2
-rw-r--r--ash/wm/panels/panel_layout_manager_unittest.cc4
-rw-r--r--ash/wm/panels/panel_window_resizer.cc6
-rw-r--r--ash/wm/panels/panel_window_resizer_unittest.cc2
-rw-r--r--ash/wm/partial_screenshot_view.cc2
-rw-r--r--ash/wm/screen_dimmer_unittest.cc2
-rw-r--r--ash/wm/session_state_animator.cc6
-rw-r--r--ash/wm/stacking_controller.cc10
-rw-r--r--ash/wm/stacking_controller.h7
-rw-r--r--ash/wm/sticky_keys.cc2
-rw-r--r--ash/wm/system_gesture_event_filter_unittest.cc22
-rw-r--r--ash/wm/system_modal_container_layout_manager_unittest.cc2
-rw-r--r--ash/wm/toplevel_window_event_handler.cc4
-rw-r--r--ash/wm/window_cycle_controller_unittest.cc1
-rw-r--r--ash/wm/window_manager_unittest.cc90
-rw-r--r--ash/wm/window_positioner.cc4
-rw-r--r--ash/wm/window_util.cc2
-rw-r--r--ash/wm/workspace/phantom_window_controller.cc6
-rw-r--r--ash/wm/workspace/phantom_window_controller.h3
-rw-r--r--ash/wm/workspace/workspace_event_handler_unittest.cc7
-rw-r--r--ash/wm/workspace/workspace_layout_manager.cc2
-rw-r--r--ash/wm/workspace/workspace_window_resizer.cc2
-rw-r--r--ash/wm/workspace/workspace_window_resizer_unittest.cc20
135 files changed, 480 insertions, 470 deletions
diff --git a/ash/accelerators/accelerator_controller.cc b/ash/accelerators/accelerator_controller.cc
index 4cc30ed..052baaa 100644
--- a/ash/accelerators/accelerator_controller.cc
+++ b/ash/accelerators/accelerator_controller.cc
@@ -284,7 +284,7 @@ bool HandleRotateScreen() {
}
bool HandleToggleRootWindowFullScreen() {
- Shell::GetPrimaryRootWindow()->ToggleFullScreen();
+ Shell::GetPrimaryRootWindow()->GetDispatcher()->ToggleFullScreen();
return true;
}
diff --git a/ash/accelerators/accelerator_controller_unittest.cc b/ash/accelerators/accelerator_controller_unittest.cc
index ce62062..575a5ec 100644
--- a/ash/accelerators/accelerator_controller_unittest.cc
+++ b/ash/accelerators/accelerator_controller_unittest.cc
@@ -603,21 +603,23 @@ TEST_F(AcceleratorControllerTest, ProcessOnce) {
GetController()->Register(accelerator_a, &target);
// The accelerator is processed only once.
+ aura::WindowEventDispatcher* dispatcher =
+ Shell::GetPrimaryRootWindow()->GetDispatcher();
#if defined(OS_WIN)
MSG msg1 = { NULL, WM_KEYDOWN, ui::VKEY_A, 0 };
ui::TranslatedKeyEvent key_event1(msg1, false);
- EXPECT_TRUE(Shell::GetPrimaryRootWindow()->AsRootWindowHostDelegate()->
- OnHostKeyEvent(&key_event1));
+ EXPECT_TRUE(dispatcher->AsRootWindowHostDelegate()->OnHostKeyEvent(
+ &key_event1));
MSG msg2 = { NULL, WM_CHAR, L'A', 0 };
ui::TranslatedKeyEvent key_event2(msg2, true);
- EXPECT_FALSE(Shell::GetPrimaryRootWindow()->AsRootWindowHostDelegate()->
- OnHostKeyEvent(&key_event2));
+ EXPECT_FALSE(dispatcher->AsRootWindowHostDelegate()->OnHostKeyEvent(
+ &key_event2));
MSG msg3 = { NULL, WM_KEYUP, ui::VKEY_A, 0 };
ui::TranslatedKeyEvent key_event3(msg3, false);
- EXPECT_FALSE(Shell::GetPrimaryRootWindow()->AsRootWindowHostDelegate()->
- OnHostKeyEvent(&key_event3));
+ EXPECT_FALSE(dispatcher->AsRootWindowHostDelegate()->OnHostKeyEvent(
+ &key_event3));
#elif defined(USE_X11)
XEvent key_event;
ui::InitXKeyEventForTesting(ui::ET_KEY_PRESSED,
@@ -625,20 +627,20 @@ TEST_F(AcceleratorControllerTest, ProcessOnce) {
0,
&key_event);
ui::TranslatedKeyEvent key_event1(&key_event, false);
- EXPECT_TRUE(Shell::GetPrimaryRootWindow()->AsRootWindowHostDelegate()->
- OnHostKeyEvent(&key_event1));
+ EXPECT_TRUE(dispatcher->AsRootWindowHostDelegate()->OnHostKeyEvent(
+ &key_event1));
ui::TranslatedKeyEvent key_event2(&key_event, true);
- EXPECT_FALSE(Shell::GetPrimaryRootWindow()->AsRootWindowHostDelegate()->
- OnHostKeyEvent(&key_event2));
+ EXPECT_FALSE(dispatcher->AsRootWindowHostDelegate()->OnHostKeyEvent(
+ &key_event2));
ui::InitXKeyEventForTesting(ui::ET_KEY_RELEASED,
ui::VKEY_A,
0,
&key_event);
ui::TranslatedKeyEvent key_event3(&key_event, false);
- EXPECT_FALSE(Shell::GetPrimaryRootWindow()->AsRootWindowHostDelegate()->
- OnHostKeyEvent(&key_event3));
+ EXPECT_FALSE(dispatcher->AsRootWindowHostDelegate()->OnHostKeyEvent(
+ &key_event3));
#endif
EXPECT_EQ(1, target.accelerator_pressed_count());
}
diff --git a/ash/accelerators/exit_warning_handler.cc b/ash/accelerators/exit_warning_handler.cc
index 6ea635a..1f8b53e 100644
--- a/ash/accelerators/exit_warning_handler.cc
+++ b/ash/accelerators/exit_warning_handler.cc
@@ -11,7 +11,7 @@
#include "base/time/time.h"
#include "base/timer/timer.h"
#include "grit/ash_strings.h"
-#include "ui/aura/root_window.h"
+#include "ui/aura/window.h"
#include "ui/base/accessibility/accessible_view_state.h"
#include "ui/base/l10n/l10n_util.h"
#include "ui/base/resource/resource_bundle.h"
@@ -165,7 +165,7 @@ void ExitWarningHandler::CancelTimer() {
void ExitWarningHandler::Show() {
if (widget_)
return;
- aura::RootWindow* root_window = Shell::GetTargetRootWindow();
+ aura::Window* root_window = Shell::GetTargetRootWindow();
ExitWarningWidgetDelegateView* delegate = new ExitWarningWidgetDelegateView;
gfx::Size rs = root_window->bounds().size();
gfx::Size ps = delegate->GetPreferredSize();
diff --git a/ash/accelerators/nested_dispatcher_controller_unittest.cc b/ash/accelerators/nested_dispatcher_controller_unittest.cc
index 955630c..232ae9c 100644
--- a/ash/accelerators/nested_dispatcher_controller_unittest.cc
+++ b/ash/accelerators/nested_dispatcher_controller_unittest.cc
@@ -88,16 +88,18 @@ void DispatchKeyReleaseA() {
ui::VKEY_A,
0,
&native_event);
- ash::Shell::GetPrimaryRootWindow()->PostNativeEvent(&native_event);
+ aura::WindowEventDispatcher* dispatcher =
+ ash::Shell::GetPrimaryRootWindow()->GetDispatcher();
+ dispatcher->PostNativeEvent(&native_event);
ui::InitXKeyEventForTesting(ui::ET_KEY_RELEASED,
ui::VKEY_A,
0,
&native_event);
- ash::Shell::GetPrimaryRootWindow()->PostNativeEvent(&native_event);
+ dispatcher->PostNativeEvent(&native_event);
#endif
// Send noop event to signal dispatcher to exit.
- ash::Shell::GetPrimaryRootWindow()->PostNativeEvent(ui::CreateNoopEvent());
+ dispatcher->PostNativeEvent(ui::CreateNoopEvent());
}
} // namespace
@@ -111,7 +113,7 @@ TEST_F(NestedDispatcherTest, AssociatedWindowBelowLockScreen) {
Shell::GetInstance()->session_state_delegate()->LockScreen();
DispatchKeyReleaseA();
- aura::RootWindow* root_window = ash::Shell::GetPrimaryRootWindow();
+ aura::Window* root_window = ash::Shell::GetPrimaryRootWindow();
aura::client::GetDispatcherClient(root_window)->RunWithDispatcher(
&inner_dispatcher,
associated_window.get(),
@@ -132,7 +134,7 @@ TEST_F(NestedDispatcherTest, AssociatedWindowAboveLockScreen) {
mock_lock_container.get()));
DispatchKeyReleaseA();
- aura::RootWindow* root_window = ash::Shell::GetPrimaryRootWindow();
+ aura::Window* root_window = ash::Shell::GetPrimaryRootWindow();
aura::client::GetDispatcherClient(root_window)->RunWithDispatcher(
&inner_dispatcher,
associated_window.get(),
@@ -143,7 +145,7 @@ TEST_F(NestedDispatcherTest, AssociatedWindowAboveLockScreen) {
// Test that the nested dispatcher handles accelerators.
TEST_F(NestedDispatcherTest, AcceleratorsHandled) {
MockDispatcher inner_dispatcher;
- aura::RootWindow* root_window = ash::Shell::GetPrimaryRootWindow();
+ aura::Window* root_window = ash::Shell::GetPrimaryRootWindow();
ui::Accelerator accelerator(ui::VKEY_A, ui::EF_NONE);
accelerator.set_type(ui::ET_KEY_RELEASED);
diff --git a/ash/autoclick/autoclick_controller.cc b/ash/autoclick/autoclick_controller.cc
index 31dfe3f..17b2558 100644
--- a/ash/autoclick/autoclick_controller.cc
+++ b/ash/autoclick/autoclick_controller.cc
@@ -154,13 +154,15 @@ void AutoclickControllerImpl::OnTouchEvent(ui::TouchEvent* event) {
void AutoclickControllerImpl::DoAutoclick() {
gfx::Point screen_location =
aura::Env::GetInstance()->last_mouse_location();
- aura::RootWindow* root_window = wm::GetRootWindowAt(screen_location);
+ aura::Window* root_window = wm::GetRootWindowAt(screen_location);
DCHECK(root_window) << "Root window not found while attempting autoclick.";
gfx::Point click_location(screen_location);
anchor_location_ = click_location;
wm::ConvertPointFromScreen(root_window, &click_location);
- root_window->ConvertPointToHost(&click_location);
+
+ aura::WindowEventDispatcher* dispatcher = root_window->GetDispatcher();
+ dispatcher->ConvertPointToHost(&click_location);
ui::MouseEvent press_event(ui::ET_MOUSE_PRESSED,
click_location,
@@ -171,8 +173,8 @@ void AutoclickControllerImpl::DoAutoclick() {
click_location,
mouse_event_flags_ | ui::EF_LEFT_MOUSE_BUTTON);
- root_window->AsRootWindowHostDelegate()->OnHostMouseEvent(&press_event);
- root_window->AsRootWindowHostDelegate()->OnHostMouseEvent(&release_event);
+ dispatcher->AsRootWindowHostDelegate()->OnHostMouseEvent(&press_event);
+ dispatcher->AsRootWindowHostDelegate()->OnHostMouseEvent(&release_event);
}
// static.
diff --git a/ash/autoclick/autoclick_unittest.cc b/ash/autoclick/autoclick_unittest.cc
index e9fd5cc..7369511 100644
--- a/ash/autoclick/autoclick_unittest.cc
+++ b/ash/autoclick/autoclick_unittest.cc
@@ -5,6 +5,7 @@
#include "ash/autoclick/autoclick_controller.h"
#include "ash/shell.h"
#include "ash/test/ash_test_base.h"
+#include "ui/aura/root_window.h"
#include "ui/aura/test/event_generator.h"
#include "ui/aura/window.h"
#include "ui/events/event.h"
diff --git a/ash/desktop_background/desktop_background_controller_unittest.cc b/ash/desktop_background/desktop_background_controller_unittest.cc
index 4d91949..6a7d19c 100644
--- a/ash/desktop_background/desktop_background_controller_unittest.cc
+++ b/ash/desktop_background/desktop_background_controller_unittest.cc
@@ -45,7 +45,7 @@ const int kLockScreenBackgroundId =
// Returns number of child windows in a shell window container.
int ChildCountForContainer(int container_id) {
- RootWindow* root = ash::Shell::GetPrimaryRootWindow();
+ Window* root = ash::Shell::GetPrimaryRootWindow();
Window* container = root->GetChildById(container_id);
return static_cast<int>(container->children().size());
}
diff --git a/ash/dip_unittest.cc b/ash/dip_unittest.cc
index 59020e8..a501ad2 100644
--- a/ash/dip_unittest.cc
+++ b/ash/dip_unittest.cc
@@ -35,7 +35,7 @@ typedef ash::test::AshTestBase DIPTest;
TEST_F(DIPTest, WorkArea) {
UpdateDisplay("1000x900*1.0f");
- aura::RootWindow* root = Shell::GetPrimaryRootWindow();
+ aura::Window* root = Shell::GetPrimaryRootWindow();
const gfx::Display display =
Shell::GetScreen()->GetDisplayNearestWindow(root);
@@ -74,7 +74,7 @@ TEST_F(DIPTest, WorkAreaForLegacyShelfLayout) {
ash::switches::kAshDisableAlternateShelfLayout);
UpdateDisplay("1000x900*1.0f");
- aura::RootWindow* root = Shell::GetPrimaryRootWindow();
+ aura::Window* root = Shell::GetPrimaryRootWindow();
const gfx::Display display =
Shell::GetScreen()->GetDisplayNearestWindow(root);
diff --git a/ash/display/display_controller.cc b/ash/display/display_controller.cc
index 7569ac7..68c6f53 100644
--- a/ash/display/display_controller.cc
+++ b/ash/display/display_controller.cc
@@ -144,7 +144,7 @@ class FocusActivationStore {
void Store(bool display_removed) {
if (!activation_client_) {
- aura::RootWindow* root = Shell::GetPrimaryRootWindow();
+ aura::Window* root = Shell::GetPrimaryRootWindow();
activation_client_ = aura::client::GetActivationClient(root);
capture_client_ = aura::client::GetCaptureClient(root);
focus_client_ = aura::client::GetFocusClient(root);
@@ -311,12 +311,12 @@ void DisplayController::RemoveObserver(Observer* observer) {
observers_.RemoveObserver(observer);
}
-aura::RootWindow* DisplayController::GetPrimaryRootWindow() {
+aura::Window* DisplayController::GetPrimaryRootWindow() {
DCHECK(!root_windows_.empty());
return root_windows_[primary_display_id];
}
-aura::RootWindow* DisplayController::GetRootWindowForDisplayId(int64 id) {
+aura::Window* DisplayController::GetRootWindowForDisplayId(int64 id) {
return root_windows_[id];
}
@@ -495,12 +495,12 @@ void DisplayController::EnsurePointerInDisplays() {
int64 closest_distance_squared = -1;
internal::DisplayManager* display_manager = GetDisplayManager();
- aura::RootWindow* dst_root_window = NULL;
+ aura::Window* dst_root_window = NULL;
for (size_t i = 0; i < display_manager->GetNumDisplays(); ++i) {
const gfx::Display& display = display_manager->GetDisplayAt(i);
const internal::DisplayInfo display_info =
display_manager->GetDisplayInfo(display.id());
- aura::RootWindow* root_window = GetRootWindowForDisplayId(display.id());
+ aura::Window* root_window = GetRootWindowForDisplayId(display.id());
if (display_info.bounds_in_native().Contains(
cursor_location_in_native_coords_for_restore_)) {
dst_root_window = root_window;
@@ -517,24 +517,25 @@ void DisplayController::EnsurePointerInDisplays() {
int64 distance_squared = (center - point_in_screen).LengthSquared();
if (closest_distance_squared < 0 ||
closest_distance_squared > distance_squared) {
- aura::RootWindow* root_window = GetRootWindowForDisplayId(display.id());
+ aura::Window* root_window = GetRootWindowForDisplayId(display.id());
aura::client::ScreenPositionClient* client =
aura::client::GetScreenPositionClient(root_window);
client->ConvertPointFromScreen(root_window, &center);
- root_window->ConvertPointToNativeScreen(&center);
+ root_window->GetDispatcher()->ConvertPointToNativeScreen(&center);
dst_root_window = root_window;
target_location_in_native = center;
closest_distance_squared = distance_squared;
}
}
- dst_root_window->ConvertPointFromNativeScreen(&target_location_in_native);
+ dst_root_window->GetDispatcher()->ConvertPointFromNativeScreen(
+ &target_location_in_native);
dst_root_window->MoveCursorTo(target_location_in_native);
}
bool DisplayController::UpdateWorkAreaOfDisplayNearestWindow(
const aura::Window* window,
const gfx::Insets& insets) {
- const aura::RootWindow* root_window = window->GetRootWindow();
+ const aura::Window* root_window = window->GetRootWindow();
int64 id = internal::GetRootWindowSettings(root_window)->display_id;
// if id is |kInvaildDisplayID|, it's being deleted.
DCHECK(id != gfx::Display::kInvalidDisplayID);
@@ -545,7 +546,7 @@ const gfx::Display& DisplayController::GetDisplayNearestWindow(
const aura::Window* window) const {
if (!window)
return GetPrimaryDisplay();
- const aura::RootWindow* root_window = window->GetRootWindow();
+ const aura::Window* root_window = window->GetRootWindow();
if (!root_window)
return GetPrimaryDisplay();
int64 id = internal::GetRootWindowSettings(root_window)->display_id;
@@ -689,12 +690,12 @@ void DisplayController::PreDisplayConfigurationChange(bool display_removed) {
gfx::Point point_in_screen = Shell::GetScreen()->GetCursorScreenPoint();
gfx::Display display =
Shell::GetScreen()->GetDisplayNearestPoint(point_in_screen);
- aura::RootWindow* root_window = GetRootWindowForDisplayId(display.id());
+ aura::Window* root_window = GetRootWindowForDisplayId(display.id());
aura::client::ScreenPositionClient* client =
aura::client::GetScreenPositionClient(root_window);
client->ConvertPointFromScreen(root_window, &point_in_screen);
- root_window->ConvertPointToNativeScreen(&point_in_screen);
+ root_window->GetDispatcher()->ConvertPointToNativeScreen(&point_in_screen);
cursor_location_in_native_coords_for_restore_ = point_in_screen;
}
@@ -772,12 +773,13 @@ void DisplayController::UpdateHostWindowNames() {
// crbug.com/120229 - set the window title for the primary dislpay
// 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::RootWindow* primary = Shell::GetPrimaryRootWindow();
+ aura::Window* primary = Shell::GetPrimaryRootWindow();
Shell::RootWindowList 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";
- gfx::AcceleratedWidget xwindow = root_windows[i]->GetAcceleratedWidget();
+ gfx::AcceleratedWidget xwindow =
+ root_windows[i]->GetDispatcher()->GetAcceleratedWidget();
XStoreName(gfx::GetXDisplay(), xwindow, name.c_str());
}
#endif
diff --git a/ash/display/display_controller.h b/ash/display/display_controller.h
index d963f13..1070684 100644
--- a/ash/display/display_controller.h
+++ b/ash/display/display_controller.h
@@ -93,10 +93,10 @@ class ASH_EXPORT DisplayController : public gfx::DisplayObserver,
void RemoveObserver(Observer* observer);
// Returns the root window for primary display.
- aura::RootWindow* GetPrimaryRootWindow();
+ aura::Window* GetPrimaryRootWindow();
// Returns the root window for |display_id|.
- aura::RootWindow* GetRootWindowForDisplayId(int64 id);
+ aura::Window* GetRootWindowForDisplayId(int64 id);
// Toggle mirror mode.
void ToggleMirrorMode();
diff --git a/ash/display/display_controller_unittest.cc b/ash/display/display_controller_unittest.cc
index 3d4acf2..a422109 100644
--- a/ash/display/display_controller_unittest.cc
+++ b/ash/display/display_controller_unittest.cc
@@ -258,7 +258,7 @@ class TestEventHandler : public ui::EventHandler {
private:
gfx::Point mouse_location_;
- aura::RootWindow* target_root_;
+ aura::Window* target_root_;
float touch_radius_x_;
float touch_radius_y_;
@@ -279,8 +279,8 @@ float GetStoredUIScale(int64 id) {
}
#if defined(USE_X11)
-void GetPrimaryAndSeconary(aura::RootWindow** primary,
- aura::RootWindow** secondary) {
+void GetPrimaryAndSeconary(aura::Window** primary,
+ aura::Window** secondary) {
*primary = Shell::GetPrimaryRootWindow();
Shell::RootWindowList root_windows = Shell::GetAllRootWindows();
*secondary = root_windows[0] == *primary ? root_windows[1] : root_windows[0];
@@ -547,9 +547,9 @@ TEST_F(DisplayControllerTest, SwapPrimary) {
display_manager->SetLayoutForCurrentDisplays(display_layout);
EXPECT_NE(primary_display.id(), secondary_display.id());
- aura::RootWindow* primary_root =
+ aura::Window* primary_root =
display_controller->GetRootWindowForDisplayId(primary_display.id());
- aura::RootWindow* secondary_root =
+ aura::Window* secondary_root =
display_controller->GetRootWindowForDisplayId(secondary_display.id());
EXPECT_NE(primary_root, secondary_root);
aura::Window* launcher_window =
@@ -641,9 +641,9 @@ TEST_F(DisplayControllerTest, SwapPrimaryForLegacyShelfLayout) {
display_manager->SetLayoutForCurrentDisplays(display_layout);
EXPECT_NE(primary_display.id(), secondary_display.id());
- aura::RootWindow* primary_root =
+ aura::Window* primary_root =
display_controller->GetRootWindowForDisplayId(primary_display.id());
- aura::RootWindow* secondary_root =
+ aura::Window* secondary_root =
display_controller->GetRootWindowForDisplayId(secondary_display.id());
EXPECT_NE(primary_root, secondary_root);
aura::Window* launcher_window =
@@ -732,9 +732,9 @@ TEST_F(DisplayControllerTest, SwapPrimaryById) {
display_manager->SetLayoutForCurrentDisplays(display_layout);
EXPECT_NE(primary_display.id(), secondary_display.id());
- aura::RootWindow* primary_root =
+ aura::Window* primary_root =
display_controller->GetRootWindowForDisplayId(primary_display.id());
- aura::RootWindow* secondary_root =
+ aura::Window* secondary_root =
display_controller->GetRootWindowForDisplayId(secondary_display.id());
aura::Window* launcher_window =
Launcher::ForPrimaryDisplay()->shelf_widget()->GetNativeView();
@@ -850,20 +850,20 @@ TEST_F(DisplayControllerTest, CursorDeviceScaleFactorSwapPrimary) {
gfx::Display primary_display = Shell::GetScreen()->GetPrimaryDisplay();
gfx::Display secondary_display = ScreenAsh::GetSecondaryDisplay();
- aura::RootWindow* primary_root =
+ aura::Window* primary_root =
display_controller->GetRootWindowForDisplayId(primary_display.id());
- aura::RootWindow* secondary_root =
+ aura::Window* secondary_root =
display_controller->GetRootWindowForDisplayId(secondary_display.id());
EXPECT_NE(primary_root, secondary_root);
test::CursorManagerTestApi test_api(Shell::GetInstance()->cursor_manager());
- EXPECT_EQ(1.0f,
- primary_root->AsRootWindowHostDelegate()->GetDeviceScaleFactor());
+ EXPECT_EQ(1.0f, primary_root->GetDispatcher()->AsRootWindowHostDelegate()->
+ GetDeviceScaleFactor());
primary_root->MoveCursorTo(gfx::Point(50, 50));
EXPECT_EQ(1.0f, test_api.GetDisplay().device_scale_factor());
- EXPECT_EQ(2.0f,
- secondary_root->AsRootWindowHostDelegate()->GetDeviceScaleFactor());
+ EXPECT_EQ(2.0f, secondary_root->GetDispatcher()->AsRootWindowHostDelegate()->
+ GetDeviceScaleFactor());
secondary_root->MoveCursorTo(gfx::Point(50, 50));
EXPECT_EQ(2.0f, test_api.GetDisplay().device_scale_factor());
@@ -872,13 +872,13 @@ TEST_F(DisplayControllerTest, CursorDeviceScaleFactorSwapPrimary) {
// Cursor's device scale factor should be updated accroding to the swap of
// primary and secondary.
- EXPECT_EQ(1.0f,
- secondary_root->AsRootWindowHostDelegate()->GetDeviceScaleFactor());
+ EXPECT_EQ(1.0f, secondary_root->GetDispatcher()->AsRootWindowHostDelegate()->
+ GetDeviceScaleFactor());
secondary_root->MoveCursorTo(gfx::Point(50, 50));
EXPECT_EQ(1.0f, test_api.GetDisplay().device_scale_factor());
primary_root->MoveCursorTo(gfx::Point(50, 50));
- EXPECT_EQ(2.0f,
- primary_root->AsRootWindowHostDelegate()->GetDeviceScaleFactor());
+ EXPECT_EQ(2.0f, primary_root->GetDispatcher()->AsRootWindowHostDelegate()->
+ GetDeviceScaleFactor());
EXPECT_EQ(2.0f, test_api.GetDisplay().device_scale_factor());
// Deleting 2nd display.
@@ -889,8 +889,8 @@ TEST_F(DisplayControllerTest, CursorDeviceScaleFactorSwapPrimary) {
EXPECT_EQ(1.0f, test_api.GetDisplay().device_scale_factor());
primary_root->MoveCursorTo(gfx::Point(50, 50));
- EXPECT_EQ(1.0f,
- primary_root->AsRootWindowHostDelegate()->GetDeviceScaleFactor());
+ EXPECT_EQ(1.0f, primary_root->GetDispatcher()->AsRootWindowHostDelegate()->
+ GetDeviceScaleFactor());
EXPECT_EQ(1.0f, test_api.GetDisplay().device_scale_factor());
}
@@ -1145,25 +1145,27 @@ TEST_F(DisplayControllerTest, ConvertHostToRootCoords) {
#if defined(USE_X11)
TEST_F(DisplayControllerTest, XWidowNameForRootWindow) {
- EXPECT_EQ("aura_root_0", GetXWindowName(Shell::GetPrimaryRootWindow()));
+ EXPECT_EQ("aura_root_0", GetXWindowName(
+ Shell::GetPrimaryRootWindow()->GetDispatcher()));
// Multiple display.
UpdateDisplay("200x200,300x300");
- aura::RootWindow* primary, *secondary;
+ aura::Window* primary, *secondary;
GetPrimaryAndSeconary(&primary, &secondary);
- EXPECT_EQ("aura_root_0", GetXWindowName(primary));
- EXPECT_EQ("aura_root_x", GetXWindowName(secondary));
+ EXPECT_EQ("aura_root_0", GetXWindowName(primary->GetDispatcher()));
+ EXPECT_EQ("aura_root_x", GetXWindowName(secondary->GetDispatcher()));
// Swap primary.
primary = secondary = NULL;
Shell::GetInstance()->display_controller()->SwapPrimaryDisplay();
GetPrimaryAndSeconary(&primary, &secondary);
- EXPECT_EQ("aura_root_0", GetXWindowName(primary));
- EXPECT_EQ("aura_root_x", GetXWindowName(secondary));
+ EXPECT_EQ("aura_root_0", GetXWindowName(primary->GetDispatcher()));
+ EXPECT_EQ("aura_root_x", GetXWindowName(secondary->GetDispatcher()));
// Switching back to single display.
UpdateDisplay("300x400");
- EXPECT_EQ("aura_root_0", GetXWindowName(Shell::GetPrimaryRootWindow()));
+ EXPECT_EQ("aura_root_0", GetXWindowName(
+ Shell::GetPrimaryRootWindow()->GetDispatcher()));
}
#endif
diff --git a/ash/display/display_manager_unittest.cc b/ash/display/display_manager_unittest.cc
index 3ce03da..2af8d06 100644
--- a/ash/display/display_manager_unittest.cc
+++ b/ash/display/display_manager_unittest.cc
@@ -382,13 +382,13 @@ TEST_F(DisplayManagerTest, TestDeviceScaleOnlyChange) {
return;
UpdateDisplay("1000x600");
- EXPECT_EQ(1,
- Shell::GetPrimaryRootWindow()->compositor()->device_scale_factor());
+ aura::WindowEventDispatcher* dispatcher =
+ Shell::GetPrimaryRootWindow()->GetDispatcher();
+ EXPECT_EQ(1, dispatcher->compositor()->device_scale_factor());
EXPECT_EQ("1000x600",
Shell::GetPrimaryRootWindow()->bounds().size().ToString());
UpdateDisplay("1000x600*2");
- EXPECT_EQ(2,
- Shell::GetPrimaryRootWindow()->compositor()->device_scale_factor());
+ EXPECT_EQ(2, dispatcher->compositor()->device_scale_factor());
EXPECT_EQ("500x300",
Shell::GetPrimaryRootWindow()->bounds().size().ToString());
}
@@ -590,8 +590,8 @@ TEST_F(DisplayManagerTest, MAYBE_TestNativeDisplaysChangedNoInternal) {
EXPECT_EQ(1U, display_manager()->GetNumDisplays());
EXPECT_EQ("1,1 100x100",
GetDisplayInfoForId(10).bounds_in_native().ToString());
- EXPECT_EQ("100x100",
- ash::Shell::GetPrimaryRootWindow()->GetHostSize().ToString());
+ EXPECT_EQ("100x100", ash::Shell::GetPrimaryRootWindow()->GetDispatcher()->
+ GetHostSize().ToString());
}
#if defined(OS_WIN)
diff --git a/ash/display/mirror_window_controller.cc b/ash/display/mirror_window_controller.cc
index 5a59487..31cb7f4 100644
--- a/ash/display/mirror_window_controller.cc
+++ b/ash/display/mirror_window_controller.cc
@@ -187,9 +187,9 @@ void MirrorWindowController::UpdateWindow(const DisplayInfo& display_info) {
root_window_->AddChild(mirror_window);
mirror_window->SetBounds(root_window_->bounds());
mirror_window->Show();
- reflector_ = ui::ContextFactory::GetInstance()->
- CreateReflector(Shell::GetPrimaryRootWindow()->compositor(),
- mirror_window->layer());
+ reflector_ = ui::ContextFactory::GetInstance()->CreateReflector(
+ Shell::GetPrimaryRootWindow()->GetDispatcher()->compositor(),
+ mirror_window->layer());
cursor_window_ = new aura::Window(cursor_window_delegate_.get());
cursor_window_->SetTransparent(true);
@@ -244,7 +244,7 @@ void MirrorWindowController::UpdateCursorLocation() {
if (cursor_window_) {
// TODO(oshima): Rotate cursor image (including hotpoint).
gfx::Point point = aura::Env::GetInstance()->last_mouse_location();
- Shell::GetPrimaryRootWindow()->ConvertPointToHost(&point);
+ Shell::GetPrimaryRootWindow()->GetDispatcher()->ConvertPointToHost(&point);
point.Offset(-hot_point_.x(), -hot_point_.y());
gfx::Rect bounds = cursor_window_->bounds();
bounds.set_origin(point);
diff --git a/ash/display/mirror_window_controller_unittest.cc b/ash/display/mirror_window_controller_unittest.cc
index bc851ed..dc10b57 100644
--- a/ash/display/mirror_window_controller_unittest.cc
+++ b/ash/display/mirror_window_controller_unittest.cc
@@ -75,7 +75,7 @@ TEST_F(MirrorWindowControllerTest, MAYBE_MirrorCursorBasic) {
DisplayManager* display_manager = Shell::GetInstance()->display_manager();
display_manager->SetSecondDisplayMode(DisplayManager::MIRRORING);
UpdateDisplay("400x400,400x400");
- aura::RootWindow* root = Shell::GetInstance()->GetPrimaryRootWindow();
+ aura::Window* root = Shell::GetInstance()->GetPrimaryRootWindow();
scoped_ptr<aura::Window> window(aura::test::CreateTestWindowWithDelegate(
&test_window_delegate,
0,
@@ -132,7 +132,7 @@ TEST_F(MirrorWindowControllerTest, MAYBE_MirrorCursorRotate) {
DisplayManager* display_manager = Shell::GetInstance()->display_manager();
display_manager->SetSecondDisplayMode(DisplayManager::MIRRORING);
UpdateDisplay("400x400,400x400");
- aura::RootWindow* root = Shell::GetInstance()->GetPrimaryRootWindow();
+ aura::Window* root = Shell::GetInstance()->GetPrimaryRootWindow();
scoped_ptr<aura::Window> window(aura::test::CreateTestWindowWithDelegate(
&test_window_delegate,
0,
@@ -199,7 +199,7 @@ TEST_F(MirrorWindowControllerTest, MAYBE_MirrorCursorLocations) {
// Test with device scale factor.
UpdateDisplay("400x600*2,400x600");
- aura::RootWindow* root = Shell::GetInstance()->GetPrimaryRootWindow();
+ aura::Window* root = Shell::GetInstance()->GetPrimaryRootWindow();
aura::test::EventGenerator generator(root);
generator.MoveMouseToInHost(10, 20);
diff --git a/ash/display/mouse_cursor_event_filter.cc b/ash/display/mouse_cursor_event_filter.cc
index ffbc33d..ebac900 100644
--- a/ash/display/mouse_cursor_event_filter.cc
+++ b/ash/display/mouse_cursor_event_filter.cc
@@ -49,7 +49,7 @@ MouseCursorEventFilter::~MouseCursorEventFilter() {
}
void MouseCursorEventFilter::ShowSharedEdgeIndicator(
- const aura::RootWindow* from) {
+ const aura::Window* from) {
HideSharedEdgeIndicator();
if (Shell::GetScreen()->GetNumDisplays() <= 1 || from == NULL) {
src_indicator_bounds_.SetRect(0, 0, 0, 0);
@@ -100,7 +100,7 @@ void MouseCursorEventFilter::OnMouseEvent(ui::MouseEvent* event) {
}
bool MouseCursorEventFilter::WarpMouseCursorIfNecessary(
- aura::RootWindow* target_root,
+ aura::Window* target_root,
const gfx::Point& point_in_screen) {
if (Shell::GetScreen()->GetNumDisplays() <= 1 ||
mouse_warp_mode_ == WARP_NONE)
@@ -116,7 +116,7 @@ bool MouseCursorEventFilter::WarpMouseCursorIfNecessary(
return false;
}
- aura::RootWindow* root_at_point = wm::GetRootWindowAt(point_in_screen);
+ aura::Window* root_at_point = wm::GetRootWindowAt(point_in_screen);
gfx::Point point_in_root = point_in_screen;
wm::ConvertPointFromScreen(root_at_point, &point_in_root);
gfx::Rect root_bounds = root_at_point->bounds();
@@ -149,7 +149,7 @@ bool MouseCursorEventFilter::WarpMouseCursorIfNecessary(
gfx::Point point_in_dst_screen(point_in_screen);
point_in_dst_screen.Offset(offset_x, offset_y);
- aura::RootWindow* dst_root = wm::GetRootWindowAt(point_in_dst_screen);
+ aura::Window* dst_root = wm::GetRootWindowAt(point_in_dst_screen);
// Warp the mouse cursor only if the location is in the indicator bounds
// or the mouse pointer is in the destination root.
diff --git a/ash/display/mouse_cursor_event_filter.h b/ash/display/mouse_cursor_event_filter.h
index c78804c..b05456e 100644
--- a/ash/display/mouse_cursor_event_filter.h
+++ b/ash/display/mouse_cursor_event_filter.h
@@ -14,6 +14,7 @@
namespace aura {
class RootWindow;
+class Window;
}
namespace ash {
@@ -43,7 +44,7 @@ class ASH_EXPORT MouseCursorEventFilter : public ui::EventHandler {
// Shows/Hide the indicator for window dragging. The |from|
// is the window where the dragging started.
- void ShowSharedEdgeIndicator(const aura::RootWindow* from);
+ void ShowSharedEdgeIndicator(const aura::Window* from);
void HideSharedEdgeIndicator();
// Overridden from ui::EventHandler:
@@ -69,7 +70,7 @@ class ASH_EXPORT MouseCursorEventFilter : public ui::EventHandler {
// hits or exceeds the edge of the |target_root| and the mouse cursor
// is considered to be in an alternate display. Returns true if
// the cursor was moved.
- bool WarpMouseCursorIfNecessary(aura::RootWindow* target_root,
+ bool WarpMouseCursorIfNecessary(aura::Window* target_root,
const gfx::Point& point_in_screen);
void UpdateHorizontalIndicatorWindowBounds();
@@ -87,7 +88,7 @@ class ASH_EXPORT MouseCursorEventFilter : public ui::EventHandler {
gfx::Rect dst_indicator_bounds_;
// The root window in which the dragging started.
- const aura::RootWindow* drag_source_root_;
+ const aura::Window* drag_source_root_;
float scale_when_drag_started_;
diff --git a/ash/display/root_window_transformers.cc b/ash/display/root_window_transformers.cc
index efb11f3..0c81684 100644
--- a/ash/display/root_window_transformers.cc
+++ b/ash/display/root_window_transformers.cc
@@ -50,7 +50,7 @@ void RoundNearZero(gfx::Transform* transform) {
// when the device scale factor is changed, instead of
// precalculating the transform using fixed value.
-gfx::Transform CreateRotationTransform(aura::RootWindow* root_window,
+gfx::Transform CreateRotationTransform(aura::Window* root_window,
const gfx::Display& display) {
DisplayInfo info =
Shell::GetInstance()->display_manager()->GetDisplayInfo(display.id());
@@ -92,7 +92,7 @@ gfx::Transform CreateRotationTransform(aura::RootWindow* root_window,
return rotate;
}
-gfx::Transform CreateMagnifierTransform(aura::RootWindow* root_window) {
+gfx::Transform CreateMagnifierTransform(aura::Window* root_window) {
MagnificationController* magnifier =
Shell::GetInstance()->magnification_controller();
float magnifier_scale = 1.f;
@@ -123,7 +123,7 @@ gfx::Transform CreateInsetsAndScaleTransform(const gfx::Insets& insets,
return transform;
}
-gfx::Transform CreateOverscanAndUIScaleTransform(aura::RootWindow* root_window,
+gfx::Transform CreateOverscanAndUIScaleTransform(aura::Window* root_window,
const gfx::Display& display) {
DisplayInfo info =
Shell::GetInstance()->display_manager()->GetDisplayInfo(display.id());
@@ -136,7 +136,7 @@ gfx::Transform CreateOverscanAndUIScaleTransform(aura::RootWindow* root_window,
// RootWindowTransformer for ash environment.
class AshRootWindowTransformer : public aura::RootWindowTransformer {
public:
- AshRootWindowTransformer(aura::RootWindow* root,
+ AshRootWindowTransformer(aura::Window* root,
const gfx::Display& display)
: root_window_(root) {
root_window_bounds_transform_ =
@@ -185,7 +185,7 @@ class AshRootWindowTransformer : public aura::RootWindowTransformer {
private:
virtual ~AshRootWindowTransformer() {}
- aura::RootWindow* root_window_;
+ aura::Window* root_window_;
gfx::Transform transform_;
// The accurate representation of the inverse of the |transform_|.
@@ -277,7 +277,7 @@ class MirrorRootWindowTransformer : public aura::RootWindowTransformer {
} // namespace
aura::RootWindowTransformer* CreateRootWindowTransformerForDisplay(
- aura::RootWindow* root,
+ aura::Window* root,
const gfx::Display& display) {
return new AshRootWindowTransformer(root, display);
}
diff --git a/ash/display/root_window_transformers.h b/ash/display/root_window_transformers.h
index 8af9ee8..e1d4053 100644
--- a/ash/display/root_window_transformers.h
+++ b/ash/display/root_window_transformers.h
@@ -8,8 +8,8 @@
#include "ash/ash_export.h"
namespace aura {
-class RootWindow;
class RootWindowTransformer;
+class Window;
}
namespace gfx {
@@ -22,7 +22,7 @@ namespace internal {
class DisplayInfo;
ASH_EXPORT aura::RootWindowTransformer* CreateRootWindowTransformerForDisplay(
- aura::RootWindow* root,
+ aura::Window* root,
const gfx::Display& display);
// Creates a RootWindowTransformers for mirror root window.
diff --git a/ash/display/root_window_transformers_unittest.cc b/ash/display/root_window_transformers_unittest.cc
index 6e45559..38e2cf3 100644
--- a/ash/display/root_window_transformers_unittest.cc
+++ b/ash/display/root_window_transformers_unittest.cc
@@ -96,7 +96,7 @@ class TestEventHandler : public ui::EventHandler {
private:
gfx::Point mouse_location_;
- aura::RootWindow* target_root_;
+ aura::Window* target_root_;
float touch_radius_x_;
float touch_radius_y_;
diff --git a/ash/display/screen_position_controller.cc b/ash/display/screen_position_controller.cc
index 3713b78..c8b8c1d 100644
--- a/ash/display/screen_position_controller.cc
+++ b/ash/display/screen_position_controller.cc
@@ -35,7 +35,7 @@ bool ShouldStayInSameRootWindow(const aura::Window* window) {
// the child windows and transient children of the transient children.
void MoveAllTransientChildrenToNewRoot(const gfx::Display& display,
aura::Window* window) {
- aura::RootWindow* dst_root = Shell::GetInstance()->display_controller()->
+ aura::Window* dst_root = Shell::GetInstance()->display_controller()->
GetRootWindowForDisplayId(display.id());
aura::Window::Windows transient_children = window->transient_children();
for (aura::Window::Windows::iterator iter = transient_children.begin();
@@ -66,7 +66,7 @@ void MoveAllTransientChildrenToNewRoot(const gfx::Display& display,
std::pair<aura::RootWindow*, gfx::Point> GetRootWindowRelativeToWindow(
aura::Window* window,
const gfx::Point& location) {
- aura::RootWindow* root_window = window->GetRootWindow();
+ aura::Window* root_window = window->GetRootWindow();
gfx::Point location_in_root(location);
aura::Window::ConvertPointToTarget(window, root_window, &location_in_root);
@@ -89,7 +89,8 @@ std::pair<aura::RootWindow*, gfx::Point> GetRootWindowRelativeToWindow(
// extended root window's coordinates.
gfx::Point location_in_native(location_in_root);
- root_window->ConvertPointToNativeScreen(&location_in_native);
+ root_window->GetDispatcher()->ConvertPointToNativeScreen(
+ &location_in_native);
Shell::RootWindowList root_windows = Shell::GetAllRootWindows();
for (size_t i = 0; i < root_windows.size(); ++i) {
@@ -99,7 +100,8 @@ std::pair<aura::RootWindow*, gfx::Point> GetRootWindowRelativeToWindow(
if (native_bounds.Contains(location_in_native)) {
root_window = root_windows[i];
location_in_root = location_in_native;
- root_window->ConvertPointFromNativeScreen(&location_in_root);
+ root_window->GetDispatcher()->ConvertPointFromNativeScreen(
+ &location_in_root);
break;
}
}
@@ -108,7 +110,7 @@ std::pair<aura::RootWindow*, gfx::Point> GetRootWindowRelativeToWindow(
// TODO(yusukes): Support non-X11 platforms if necessary.
#endif
- return std::make_pair(root_window, location_in_root);
+ return std::make_pair(root_window->GetDispatcher(), location_in_root);
}
} // namespace
@@ -118,19 +120,19 @@ namespace internal {
void ScreenPositionController::ConvertPointToScreen(
const aura::Window* window,
gfx::Point* point) {
- const aura::RootWindow* root = window->GetRootWindow();
+ const aura::Window* root = window->GetRootWindow();
aura::Window::ConvertPointToTarget(window, root, point);
const gfx::Point display_origin = Shell::GetScreen()->GetDisplayNearestWindow(
- const_cast<aura::RootWindow*>(root)).bounds().origin();
+ const_cast<aura::Window*>(root)).bounds().origin();
point->Offset(display_origin.x(), display_origin.y());
}
void ScreenPositionController::ConvertPointFromScreen(
const aura::Window* window,
gfx::Point* point) {
- const aura::RootWindow* root = window->GetRootWindow();
+ const aura::Window* root = window->GetRootWindow();
const gfx::Point display_origin = Shell::GetScreen()->GetDisplayNearestWindow(
- const_cast<aura::RootWindow*>(root)).bounds().origin();
+ const_cast<aura::Window*>(root)).bounds().origin();
point->Offset(-display_origin.x(), -display_origin.y());
aura::Window::ConvertPointToTarget(root, window, point);
}
@@ -138,8 +140,8 @@ void ScreenPositionController::ConvertPointFromScreen(
void ScreenPositionController::ConvertHostPointToScreen(
aura::Window* root_window,
gfx::Point* point) {
- aura::RootWindow* root = root_window->GetRootWindow();
- root->ConvertPointFromHost(point);
+ aura::Window* root = root_window->GetRootWindow();
+ root->GetDispatcher()->ConvertPointFromHost(point);
std::pair<aura::RootWindow*, gfx::Point> pair =
GetRootWindowRelativeToWindow(root, *point);
*point = pair.second;
@@ -163,7 +165,7 @@ void ScreenPositionController::SetBounds(aura::Window* window,
// outside of the display.
if (!window->transient_parent() &&
!ShouldStayInSameRootWindow(window)) {
- aura::RootWindow* dst_root =
+ aura::Window* dst_root =
Shell::GetInstance()->display_controller()->GetRootWindowForDisplayId(
display.id());
DCHECK(dst_root);
@@ -197,8 +199,9 @@ void ScreenPositionController::SetBounds(aura::Window* window,
// Restore focused/active window.
if (tracker.Contains(focused)) {
aura::client::GetFocusClient(window)->FocusWindow(focused);
+ // TODO(beng): replace with GetRootWindow().
ash::Shell::GetInstance()->set_target_root_window(
- focused->GetRootWindow());
+ focused->GetDispatcher());
} else if (tracker.Contains(active)) {
activation_client->ActivateWindow(active);
}
diff --git a/ash/drag_drop/drag_drop_controller_unittest.cc b/ash/drag_drop/drag_drop_controller_unittest.cc
index fd26f37..fa4f2bc 100644
--- a/ash/drag_drop/drag_drop_controller_unittest.cc
+++ b/ash/drag_drop/drag_drop_controller_unittest.cc
@@ -283,7 +283,8 @@ void DispatchGesture(ui::EventType gesture_type, gfx::Point location) {
ui::EventTimeForNow(),
ui::GestureEventDetails(gesture_type, 0, 0),
1);
- Shell::GetPrimaryRootWindow()->DispatchGestureEvent(&gesture_event);
+ Shell::GetPrimaryRootWindow()->GetDispatcher()->DispatchGestureEvent(
+ &gesture_event);
}
bool IsGestureEventType(ui::EventType type) {
@@ -762,8 +763,8 @@ TEST_F(DragDropControllerTest, SyntheticEventsDuringDragDrop) {
gfx::Point mouse_move_location = drag_view->bounds().CenterPoint();
ui::MouseEvent mouse_move(ui::ET_MOUSE_MOVED, mouse_move_location,
mouse_move_location, 0);
- Shell::GetPrimaryRootWindow()->AsRootWindowHostDelegate()->OnHostMouseEvent(
- &mouse_move);
+ Shell::GetPrimaryRootWindow()->GetDispatcher()->AsRootWindowHostDelegate()->
+ OnHostMouseEvent(&mouse_move);
}
generator.ReleaseLeftButton();
diff --git a/ash/drag_drop/drag_drop_tracker.cc b/ash/drag_drop/drag_drop_tracker.cc
index 72f0389..03ecf79 100644
--- a/ash/drag_drop/drag_drop_tracker.cc
+++ b/ash/drag_drop/drag_drop_tracker.cc
@@ -50,7 +50,7 @@ aura::Window* DragDropTracker::GetTarget(const ui::LocatedEvent& event) {
gfx::Point location_in_screen = event.location();
wm::ConvertPointToScreen(capture_window_.get(),
&location_in_screen);
- aura::RootWindow* root_window_at_point =
+ aura::Window* root_window_at_point =
wm::GetRootWindowAt(location_in_screen);
gfx::Point location_in_root = location_in_screen;
wm::ConvertPointFromScreen(root_window_at_point, &location_in_root);
diff --git a/ash/focus_cycler_unittest.cc b/ash/focus_cycler_unittest.cc
index aebede4..f7629dc 100644
--- a/ash/focus_cycler_unittest.cc
+++ b/ash/focus_cycler_unittest.cc
@@ -383,7 +383,7 @@ TEST_F(FocusCyclerTest, CycleFocusThroughWindowWithPanes) {
// Pressing "Escape" while on the status area should
// deactivate it, and activate the browser window.
- aura::RootWindow* root = Shell::GetPrimaryRootWindow();
+ aura::Window* root = Shell::GetPrimaryRootWindow();
aura::test::EventGenerator event_generator(root, root);
event_generator.PressKey(ui::VKEY_ESCAPE, 0);
EXPECT_TRUE(wm::IsActiveWindow(browser_window));
diff --git a/ash/launcher/launcher_item_delegate.h b/ash/launcher/launcher_item_delegate.h
index a72b6e6..dbc1e65 100644
--- a/ash/launcher/launcher_item_delegate.h
+++ b/ash/launcher/launcher_item_delegate.h
@@ -53,7 +53,7 @@ class ASH_EXPORT LauncherItemDelegate {
// Returns the context menumodel for the specified item on
// |root_window|. Return NULL if there should be no context
// menu. The caller takes ownership of the returned model.
- virtual ui::MenuModel* CreateContextMenu(aura::RootWindow* root_window) = 0;
+ virtual ui::MenuModel* CreateContextMenu(aura::Window* root_window) = 0;
// Returns the application menu model for the specified item. There are three
// possible return values:
diff --git a/ash/magnifier/magnification_controller.cc b/ash/magnifier/magnification_controller.cc
index c6a6a52..0df6e12 100644
--- a/ash/magnifier/magnification_controller.cc
+++ b/ash/magnifier/magnification_controller.cc
@@ -127,7 +127,7 @@ class MagnificationControllerImpl : virtual public MagnificationController,
// - Unzoom the current root_window.
// - Zoom the given new root_window |new_root_window|.
// - Switch the target window from current window to |new_root_window|.
- void SwitchTargetRootWindow(aura::RootWindow* new_root_window,
+ void SwitchTargetRootWindow(aura::Window* new_root_window,
bool redraw_original_root_window);
// Returns if the magnification scale is 1.0 or not (larger then 1.0).
@@ -147,7 +147,7 @@ class MagnificationControllerImpl : virtual public MagnificationController,
virtual void OnTouchEvent(ui::TouchEvent* event) OVERRIDE;
// Target root window. This must not be NULL.
- aura::RootWindow* root_window_;
+ aura::Window* root_window_;
// True if the magnified window is currently animating a change. Otherwise,
// false.
@@ -273,7 +273,7 @@ bool MagnificationControllerImpl::RedrawDIP(const gfx::PointF& position_in_dip,
Shell::GetScreen()->GetDisplayNearestWindow(root_window_);
scoped_ptr<aura::RootWindowTransformer> transformer(
internal::CreateRootWindowTransformerForDisplay(root_window_, display));
- root_window_->SetRootWindowTransformer(transformer.Pass());
+ root_window_->GetDispatcher()->SetRootWindowTransformer(transformer.Pass());
if (animate)
is_on_animation_ = true;
@@ -380,7 +380,7 @@ void MagnificationControllerImpl::OnMouseMove(const gfx::Point& location) {
if (ret) {
// If the magnified region is moved, hides the mouse cursor and moves it.
if (x_diff != 0 || y_diff != 0)
- MoveCursorTo(root_window_, mouse);
+ MoveCursorTo(root_window_->GetDispatcher(), mouse);
}
}
}
@@ -437,7 +437,7 @@ void MagnificationControllerImpl::OnImplicitAnimationsCompleted() {
return;
if (move_cursor_after_animation_) {
- MoveCursorTo(root_window_, position_after_animation_);
+ MoveCursorTo(root_window_->GetDispatcher(), position_after_animation_);
move_cursor_after_animation_ = false;
aura::client::CursorClient* cursor_client =
@@ -456,7 +456,7 @@ void MagnificationControllerImpl::OnWindowDestroying(
// destroyed before the root windows get destroyed.
DCHECK(root_window);
- aura::RootWindow* target_root_window = Shell::GetTargetRootWindow();
+ aura::Window* target_root_window = Shell::GetTargetRootWindow();
CHECK(target_root_window);
// The destroyed root window must not be target.
@@ -475,7 +475,7 @@ void MagnificationControllerImpl::OnWindowBoundsChanged(
}
void MagnificationControllerImpl::SwitchTargetRootWindow(
- aura::RootWindow* new_root_window,
+ aura::Window* new_root_window,
bool redraw_original_root_window) {
DCHECK(new_root_window);
@@ -577,7 +577,7 @@ bool MagnificationControllerImpl::IsEnabled() const {
void MagnificationControllerImpl::OnMouseEvent(ui::MouseEvent* event) {
aura::Window* target = static_cast<aura::Window*>(event->target());
- aura::RootWindow* current_root = target->GetRootWindow();
+ aura::Window* current_root = target->GetRootWindow();
gfx::Rect root_bounds = current_root->bounds();
if (root_bounds.Contains(event->root_location())) {
@@ -615,7 +615,7 @@ void MagnificationControllerImpl::OnScrollEvent(ui::ScrollEvent* event) {
void MagnificationControllerImpl::OnTouchEvent(ui::TouchEvent* event) {
aura::Window* target = static_cast<aura::Window*>(event->target());
- aura::RootWindow* current_root = target->GetRootWindow();
+ aura::Window* current_root = target->GetRootWindow();
if (current_root == root_window_) {
gfx::Rect root_bounds = current_root->bounds();
if (root_bounds.Contains(event->root_location()))
diff --git a/ash/magnifier/magnification_controller_unittest.cc b/ash/magnifier/magnification_controller_unittest.cc
index 63608fc..2f87ee1 100644
--- a/ash/magnifier/magnification_controller_unittest.cc
+++ b/ash/magnifier/magnification_controller_unittest.cc
@@ -32,7 +32,7 @@ class MagnificationControllerTest: public test::AshTestBase {
AshTestBase::SetUp();
UpdateDisplay(base::StringPrintf("%dx%d", kRootWidth, kRootHeight));
- aura::RootWindow* root = GetRootWindow();
+ aura::Window* root = GetRootWindow();
gfx::Rect root_bounds(root->bounds());
#if defined(OS_WIN)
@@ -48,13 +48,13 @@ class MagnificationControllerTest: public test::AshTestBase {
}
protected:
- aura::RootWindow* GetRootWindow() const {
+ aura::Window* GetRootWindow() const {
return Shell::GetPrimaryRootWindow();
}
std::string GetHostMouseLocation() {
gfx::Point point;
- GetRootWindow()->QueryMouseLocationForTest(&point);
+ GetRootWindow()->GetDispatcher()->QueryMouseLocationForTest(&point);
return point.ToString();
}
diff --git a/ash/magnifier/partial_magnification_controller.cc b/ash/magnifier/partial_magnification_controller.cc
index d913856..3e762b7 100644
--- a/ash/magnifier/partial_magnification_controller.cc
+++ b/ash/magnifier/partial_magnification_controller.cc
@@ -79,7 +79,7 @@ void PartialMagnificationController::SetEnabled(bool enabled) {
void PartialMagnificationController::OnMouseEvent(ui::MouseEvent* event) {
if (IsPartialMagnified() && event->type() == ui::ET_MOUSE_MOVED) {
aura::Window* target = static_cast<aura::Window*>(event->target());
- aura::RootWindow* current_root = target->GetRootWindow();
+ aura::Window* current_root = target->GetRootWindow();
// TODO(zork): Handle the case where the event is captured on a different
// display, such as when a menu is opened.
gfx::Rect root_bounds = current_root->bounds();
@@ -178,14 +178,14 @@ void PartialMagnificationController::CloseMagnifierWindow() {
void PartialMagnificationController::RemoveZoomWidgetObservers() {
DCHECK(zoom_widget_);
zoom_widget_->RemoveObserver(this);
- aura::RootWindow* root_window =
+ aura::Window* root_window =
zoom_widget_->GetNativeView()->GetRootWindow();
DCHECK(root_window);
root_window->RemoveObserver(this);
}
void PartialMagnificationController::SwitchTargetRootWindow(
- aura::RootWindow* new_root_window) {
+ aura::Window* new_root_window) {
if (zoom_widget_ &&
new_root_window == zoom_widget_->GetNativeView()->GetRootWindow())
return;
diff --git a/ash/magnifier/partial_magnification_controller.h b/ash/magnifier/partial_magnification_controller.h
index 54c15f3..01c3a2b 100644
--- a/ash/magnifier/partial_magnification_controller.h
+++ b/ash/magnifier/partial_magnification_controller.h
@@ -49,7 +49,7 @@ class PartialMagnificationController
// - Remove the magnifier from the current root window.
// - Create a magnifier in the new root_window |new_root_window|.
// - Switch the target window from current window to |new_root_window|.
- void SwitchTargetRootWindow(aura::RootWindow* new_root_window);
+ void SwitchTargetRootWindow(aura::Window* new_root_window);
// Returns the root window that contains the mouse cursor.
aura::RootWindow* GetCurrentRootWindow();
diff --git a/ash/root_window_controller.cc b/ash/root_window_controller.cc
index a7e70cd..8afa501 100644
--- a/ash/root_window_controller.cc
+++ b/ash/root_window_controller.cc
@@ -110,7 +110,7 @@ void ReparentWindow(aura::Window* window, aura::Window* new_parent) {
}
// Reparents the appropriate set of windows from |src| to |dst|.
-void ReparentAllWindows(aura::RootWindow* src, aura::RootWindow* dst) {
+void ReparentAllWindows(aura::Window* src, aura::Window* dst) {
// Set of windows to move.
const int kContainerIdsToMove[] = {
internal::kShellWindowId_DefaultContainer,
@@ -217,7 +217,7 @@ class EmptyWindowDelegate : public aura::WindowDelegate {
namespace internal {
void RootWindowController::CreateForPrimaryDisplay(
- aura::RootWindow * root) {
+ aura::RootWindow* root) {
RootWindowController* controller = new RootWindowController(root);
controller->Init(true /* primary */,
Shell::GetInstance()->delegate()->IsFirstRunAfterBoot());
@@ -276,7 +276,7 @@ void RootWindowController::Shutdown() {
// being removed triggers a relayout of the shelf it will try to build a
// window list adding windows from the target root window's containers which
// may have already gone away.
- if (Shell::GetTargetRootWindow() == root_window_) {
+ if (Shell::GetTargetRootWindow()->GetDispatcher() == root_window_) {
Shell::GetInstance()->set_target_root_window(
Shell::GetPrimaryRootWindow() == root_window_.get() ?
NULL : Shell::GetPrimaryRootWindow());
@@ -456,7 +456,7 @@ void RootWindowController::CloseChildWindows() {
shelf_.reset(NULL);
}
-void RootWindowController::MoveWindowsTo(aura::RootWindow* dst) {
+void RootWindowController::MoveWindowsTo(aura::Window* dst) {
// Forget the shelf early so that shelf don't update itself using wrong
// display info.
workspace_controller_->SetShelf(NULL);
@@ -896,7 +896,7 @@ void RootWindowController::OnTouchHudProjectionToggled(bool enabled) {
}
RootWindowController* GetRootWindowController(
- const aura::RootWindow* root_window) {
+ const aura::Window* root_window) {
return root_window ? GetRootWindowSettings(root_window)->controller : NULL;
}
diff --git a/ash/root_window_controller.h b/ash/root_window_controller.h
index 4e6b8d1..3bbc469 100644
--- a/ash/root_window_controller.h
+++ b/ash/root_window_controller.h
@@ -202,7 +202,7 @@ class ASH_EXPORT RootWindowController : public ShellObserver {
void CloseChildWindows();
// Moves child windows to |dest|.
- void MoveWindowsTo(aura::RootWindow* dest);
+ void MoveWindowsTo(aura::Window* dest);
// Force the shelf to query for it's current visibility state.
void UpdateShelfVisibility();
@@ -301,7 +301,7 @@ class ASH_EXPORT RootWindowController : public ShellObserver {
// Gets the RootWindowController for |root_window|.
ASH_EXPORT RootWindowController* GetRootWindowController(
- const aura::RootWindow* root_window);
+ const aura::Window* root_window);
} // namespace internal
} // ash
diff --git a/ash/root_window_controller_unittest.cc b/ash/root_window_controller_unittest.cc
index c296609..b8c480c 100644
--- a/ash/root_window_controller_unittest.cc
+++ b/ash/root_window_controller_unittest.cc
@@ -597,7 +597,7 @@ typedef test::NoSessionAshTestBase NoSessionRootWindowControllerTest;
// Make sure that an event handler exists for entire display area.
TEST_F(NoSessionRootWindowControllerTest, Event) {
- aura::RootWindow* root = Shell::GetPrimaryRootWindow();
+ aura::Window* root = Shell::GetPrimaryRootWindow();
const gfx::Size size = root->bounds().size();
aura::Window* event_target = root->GetEventHandlerForPoint(gfx::Point(0, 0));
EXPECT_TRUE(event_target);
@@ -639,8 +639,8 @@ TEST_F(VirtualKeyboardRootWindowControllerTest,
UpdateDisplay("500x500,500x500");
Shell::RootWindowList root_windows = Shell::GetAllRootWindows();
- aura::RootWindow* primary_root_window = Shell::GetPrimaryRootWindow();
- aura::RootWindow* secondary_root_window =
+ aura::Window* primary_root_window = Shell::GetPrimaryRootWindow();
+ aura::Window* secondary_root_window =
root_windows[0] == primary_root_window ?
root_windows[1] : root_windows[0];
@@ -656,7 +656,7 @@ TEST_F(VirtualKeyboardRootWindowControllerTest,
// events at blocked user session.
TEST_F(VirtualKeyboardRootWindowControllerTest,
ClickVirtualKeyboardInBlockedWindow) {
- aura::RootWindow* root_window = Shell::GetPrimaryRootWindow();
+ aura::Window* root_window = Shell::GetPrimaryRootWindow();
aura::Window* keyboard_container = Shell::GetContainer(root_window,
internal::kShellWindowId_VirtualKeyboardContainer);
ASSERT_TRUE(keyboard_container);
@@ -689,7 +689,7 @@ TEST_F(VirtualKeyboardRootWindowControllerTest,
// GetWindowContainer().
TEST_F(VirtualKeyboardRootWindowControllerTest,
DeleteOldContainerOnVirtualKeyboardInit) {
- aura::RootWindow* root_window = ash::Shell::GetPrimaryRootWindow();
+ aura::Window* root_window = ash::Shell::GetPrimaryRootWindow();
aura::Window* keyboard_container = Shell::GetContainer(root_window,
internal::kShellWindowId_VirtualKeyboardContainer);
ASSERT_TRUE(keyboard_container);
diff --git a/ash/root_window_settings.cc b/ash/root_window_settings.cc
index 06198ca..33880ed 100644
--- a/ash/root_window_settings.cc
+++ b/ash/root_window_settings.cc
@@ -22,17 +22,17 @@ RootWindowSettings::RootWindowSettings()
controller(NULL) {
}
-RootWindowSettings* InitRootWindowSettings(aura::RootWindow* root) {
+RootWindowSettings* InitRootWindowSettings(aura::Window* root) {
RootWindowSettings* settings = new RootWindowSettings();
root->SetProperty(kRootWindowSettingsKey, settings);
return settings;
}
-RootWindowSettings* GetRootWindowSettings(aura::RootWindow* root) {
+RootWindowSettings* GetRootWindowSettings(aura::Window* root) {
return root->GetProperty(kRootWindowSettingsKey);
}
-const RootWindowSettings* GetRootWindowSettings(const aura::RootWindow* root) {
+const RootWindowSettings* GetRootWindowSettings(const aura::Window* root) {
return root->GetProperty(kRootWindowSettingsKey);
}
diff --git a/ash/root_window_settings.h b/ash/root_window_settings.h
index 784cce6..e49b0f2 100644
--- a/ash/root_window_settings.h
+++ b/ash/root_window_settings.h
@@ -9,7 +9,7 @@
#include "base/basictypes.h"
namespace aura {
-class RootWindow;
+class Window;
}
namespace ash {
@@ -37,14 +37,14 @@ struct RootWindowSettings {
// Initializes and returns RootWindowSettings for |root|.
// It is owned by the |root|.
-RootWindowSettings* InitRootWindowSettings(aura::RootWindow* root);
+RootWindowSettings* InitRootWindowSettings(aura::Window* root);
// Returns the RootWindowSettings for |root|.
-ASH_EXPORT RootWindowSettings* GetRootWindowSettings(aura::RootWindow* root);
+ASH_EXPORT RootWindowSettings* GetRootWindowSettings(aura::Window* root);
// const version of GetRootWindowSettings.
ASH_EXPORT const RootWindowSettings*
-GetRootWindowSettings(const aura::RootWindow* root);
+GetRootWindowSettings(const aura::Window* root);
} // namespace internal
} // namespace ash
diff --git a/ash/scoped_target_root_window.cc b/ash/scoped_target_root_window.cc
index b488a6f..c34f4c3 100644
--- a/ash/scoped_target_root_window.cc
+++ b/ash/scoped_target_root_window.cc
@@ -9,7 +9,7 @@ namespace ash {
namespace internal {
ScopedTargetRootWindow::ScopedTargetRootWindow(
- aura::RootWindow* root_window) {
+ aura::Window* root_window) {
Shell::GetInstance()->scoped_target_root_window_ = root_window;
}
diff --git a/ash/scoped_target_root_window.h b/ash/scoped_target_root_window.h
index ab695be..0e7a8b1 100644
--- a/ash/scoped_target_root_window.h
+++ b/ash/scoped_target_root_window.h
@@ -7,7 +7,7 @@
#include "base/basictypes.h"
namespace aura {
-class RootWindow;
+class Window;
}
namespace ash {
@@ -20,7 +20,7 @@ namespace internal {
// a new window using launcher's icon.
class ScopedTargetRootWindow {
public:
- explicit ScopedTargetRootWindow(aura::RootWindow* root_window);
+ explicit ScopedTargetRootWindow(aura::Window* root_window);
~ScopedTargetRootWindow();
private:
diff --git a/ash/screensaver/screensaver_view.cc b/ash/screensaver/screensaver_view.cc
index 6c2c1e0..b16d812a 100644
--- a/ash/screensaver/screensaver_view.cc
+++ b/ash/screensaver/screensaver_view.cc
@@ -143,7 +143,7 @@ void ScreensaverView::LoadScreensaver() {
}
void ScreensaverView::ShowWindow() {
- aura::RootWindow* root_window = ash::Shell::GetPrimaryRootWindow();
+ aura::Window* root_window = ash::Shell::GetPrimaryRootWindow();
gfx::Rect screen_rect =
Shell::GetScreen()->GetDisplayNearestWindow(root_window).bounds();
diff --git a/ash/shelf/app_list_shelf_item_delegate.cc b/ash/shelf/app_list_shelf_item_delegate.cc
index 231f68d..f032d69 100644
--- a/ash/shelf/app_list_shelf_item_delegate.cc
+++ b/ash/shelf/app_list_shelf_item_delegate.cc
@@ -36,7 +36,7 @@ base::string16 AppListShelfItemDelegate::GetTitle() {
}
ui::MenuModel* AppListShelfItemDelegate::CreateContextMenu(
- aura::RootWindow* root_window) {
+ aura::Window* root_window) {
return NULL;
}
diff --git a/ash/shelf/app_list_shelf_item_delegate.h b/ash/shelf/app_list_shelf_item_delegate.h
index 2827599..6a14f14 100644
--- a/ash/shelf/app_list_shelf_item_delegate.h
+++ b/ash/shelf/app_list_shelf_item_delegate.h
@@ -23,7 +23,7 @@ class AppListShelfItemDelegate : public LauncherItemDelegate {
virtual void ItemSelected(const ui::Event& event) OVERRIDE;
virtual base::string16 GetTitle() OVERRIDE;
virtual ui::MenuModel* CreateContextMenu(
- aura::RootWindow* root_window) OVERRIDE;
+ aura::Window* root_window) OVERRIDE;
virtual LauncherMenuModel* CreateApplicationMenu(int event_flags) OVERRIDE;
virtual bool IsDraggable() OVERRIDE;
virtual bool ShouldShowTooltip() OVERRIDE;
diff --git a/ash/shelf/shelf_alignment_menu.cc b/ash/shelf/shelf_alignment_menu.cc
index d0d381f..722b053 100644
--- a/ash/shelf/shelf_alignment_menu.cc
+++ b/ash/shelf/shelf_alignment_menu.cc
@@ -8,12 +8,12 @@
#include "ash/shelf/shelf_types.h"
#include "ash/shell.h"
#include "grit/ash_strings.h"
-#include "ui/aura/root_window.h"
+#include "ui/aura/window.h"
#include "ui/base/l10n/l10n_util.h"
namespace ash {
-ShelfAlignmentMenu::ShelfAlignmentMenu(aura::RootWindow* root)
+ShelfAlignmentMenu::ShelfAlignmentMenu(aura::Window* root)
: ui::SimpleMenuModel(NULL),
root_window_(root) {
DCHECK(root_window_);
diff --git a/ash/shelf/shelf_alignment_menu.h b/ash/shelf/shelf_alignment_menu.h
index 288de9a..e7acce28 100644
--- a/ash/shelf/shelf_alignment_menu.h
+++ b/ash/shelf/shelf_alignment_menu.h
@@ -19,7 +19,7 @@ namespace ash {
class ASH_EXPORT ShelfAlignmentMenu : public ui::SimpleMenuModel,
public ui::SimpleMenuModel::Delegate {
public:
- explicit ShelfAlignmentMenu(aura::RootWindow* root);
+ explicit ShelfAlignmentMenu(aura::Window* root);
virtual ~ShelfAlignmentMenu();
// ui::SimpleMenuModel::Delegate overrides:
@@ -38,7 +38,7 @@ class ASH_EXPORT ShelfAlignmentMenu : public ui::SimpleMenuModel,
MENU_ALIGN_BOTTOM,
};
- aura::RootWindow* root_window_;
+ aura::Window* root_window_;
DISALLOW_COPY_AND_ASSIGN(ShelfAlignmentMenu);
};
diff --git a/ash/shelf/shelf_layout_manager.h b/ash/shelf/shelf_layout_manager.h
index d8b6e8f..7c4e26e 100644
--- a/ash/shelf/shelf_layout_manager.h
+++ b/ash/shelf/shelf_layout_manager.h
@@ -342,7 +342,7 @@ class ASH_EXPORT ShelfLayoutManager :
// The RootWindow is cached so that we don't invoke Shell::GetInstance() from
// our destructor. We avoid that as at the time we're deleted Shell is being
// deleted too.
- aura::RootWindow* root_window_;
+ aura::Window* root_window_;
// True when inside UpdateBoundsAndOpacity() method. Used to prevent calling
// UpdateBoundsAndOpacity() again from SetChildBounds().
diff --git a/ash/shelf/shelf_layout_manager_observer.h b/ash/shelf/shelf_layout_manager_observer.h
index 328e209..6209980 100644
--- a/ash/shelf/shelf_layout_manager_observer.h
+++ b/ash/shelf/shelf_layout_manager_observer.h
@@ -9,7 +9,7 @@
#include "ash/shelf/shelf_types.h"
namespace aura {
-class RootWindow;
+class Window;
}
namespace ash {
@@ -28,7 +28,7 @@ class ASH_EXPORT ShelfLayoutManagerObserver {
virtual void OnAutoHideStateChanged(ShelfAutoHideState new_state) {}
// Called when the auto hide behavior is changed.
- virtual void OnAutoHideBehaviorChanged(aura::RootWindow* root_window,
+ virtual void OnAutoHideBehaviorChanged(aura::Window* root_window,
ShelfAutoHideBehavior new_behavior) {}
};
diff --git a/ash/shelf/shelf_layout_manager_unittest.cc b/ash/shelf/shelf_layout_manager_unittest.cc
index 9795e0e..ed9bb34 100644
--- a/ash/shelf/shelf_layout_manager_unittest.cc
+++ b/ash/shelf/shelf_layout_manager_unittest.cc
@@ -797,7 +797,7 @@ TEST_F(ShelfLayoutManagerTest, LauncherUpdatedWhenStatusAreaChangesSize) {
// Various assertions around auto-hide.
TEST_F(ShelfLayoutManagerTest, MAYBE_AutoHide) {
- aura::RootWindow* root = Shell::GetPrimaryRootWindow();
+ aura::Window* root = Shell::GetPrimaryRootWindow();
aura::test::EventGenerator generator(root, root);
generator.MoveMouseTo(0, 0);
@@ -974,7 +974,7 @@ TEST_F(ShelfLayoutManagerTest, VisibleWhenLockScreenShowing) {
EXPECT_EQ(SHELF_AUTO_HIDE, shelf->visibility_state());
EXPECT_EQ(SHELF_AUTO_HIDE_HIDDEN, shelf->auto_hide_state());
- aura::RootWindow* root = Shell::GetPrimaryRootWindow();
+ aura::Window* root = Shell::GetPrimaryRootWindow();
// LayoutShelf() forces the animation to completion, at which point the
// launcher should go off the screen.
shelf->LayoutShelf();
diff --git a/ash/shelf/shelf_tooltip_manager.cc b/ash/shelf/shelf_tooltip_manager.cc
index bdf3306..10ea4a6 100644
--- a/ash/shelf/shelf_tooltip_manager.cc
+++ b/ash/shelf/shelf_tooltip_manager.cc
@@ -96,7 +96,7 @@ ShelfTooltipManager::ShelfTooltipBubble::ShelfTooltipBubble(
SetLayoutManager(new views::FillLayout());
// The anchor may not have the widget in tests.
if (anchor->GetWidget() && anchor->GetWidget()->GetNativeView()) {
- aura::RootWindow* root_window =
+ aura::Window* root_window =
anchor->GetWidget()->GetNativeView()->GetRootWindow();
set_parent_window(ash::Shell::GetInstance()->GetContainer(
root_window, ash::internal::kShellWindowId_SettingBubbleContainer));
diff --git a/ash/shelf/shelf_tooltip_manager_unittest.cc b/ash/shelf/shelf_tooltip_manager_unittest.cc
index 6f2f0fa..d4b9c07 100644
--- a/ash/shelf/shelf_tooltip_manager_unittest.cc
+++ b/ash/shelf/shelf_tooltip_manager_unittest.cc
@@ -180,7 +180,7 @@ TEST_F(ShelfTooltipManagerTest, ShouldHideForEvents) {
ShowImmediately();
ASSERT_TRUE(TooltipIsVisible());
- aura::RootWindow* root_window = Shell::GetInstance()->GetPrimaryRootWindow();
+ aura::Window* root_window = Shell::GetInstance()->GetPrimaryRootWindow();
ui::EventHandler* event_handler = GetEventHandler();
// Should not hide for key events.
@@ -222,7 +222,7 @@ TEST_F(ShelfTooltipManagerTest, HideForMouseMoveEvent) {
ShowImmediately();
ASSERT_TRUE(TooltipIsVisible());
- aura::RootWindow* root_window = Shell::GetInstance()->GetPrimaryRootWindow();
+ aura::Window* root_window = Shell::GetInstance()->GetPrimaryRootWindow();
ui::EventHandler* event_handler = GetEventHandler();
gfx::Rect tooltip_rect = GetTooltipWidget()->GetNativeWindow()->bounds();
@@ -251,7 +251,7 @@ TEST_F(ShelfTooltipManagerTest, HideForMouseClickEvent) {
ShowImmediately();
ASSERT_TRUE(TooltipIsVisible());
- aura::RootWindow* root_window = Shell::GetInstance()->GetPrimaryRootWindow();
+ aura::Window* root_window = Shell::GetInstance()->GetPrimaryRootWindow();
ui::EventHandler* event_handler = GetEventHandler();
gfx::Rect tooltip_rect = GetTooltipWidget()->GetNativeWindow()->bounds();
diff --git a/ash/shelf/shelf_view.cc b/ash/shelf/shelf_view.cc
index aece79f..aebe0b1 100644
--- a/ash/shelf/shelf_view.cc
+++ b/ash/shelf/shelf_view.cc
@@ -327,7 +327,7 @@ void ReflectItemStatus(const ash::LauncherItem& item,
gfx::Point GetPositionInScreen(const gfx::Point& root_location,
views::View* view) {
gfx::Point root_location_in_screen = root_location;
- aura::RootWindow* root_window =
+ aura::Window* root_window =
view->GetWidget()->GetNativeWindow()->GetRootWindow();
aura::client::GetScreenPositionClient(root_window->GetRootWindow())->
ConvertPointToScreen(root_window, &root_location_in_screen);
diff --git a/ash/shelf/shelf_widget_unittest.cc b/ash/shelf/shelf_widget_unittest.cc
index 6004a6c..010db18 100644
--- a/ash/shelf/shelf_widget_unittest.cc
+++ b/ash/shelf/shelf_widget_unittest.cc
@@ -54,7 +54,7 @@ TEST_F(ShelfWidgetTest, DISABLED_ActivateAsFallback) {
EXPECT_FALSE(shelf_widget->CanActivate());
}
-void TestLauncherAlignment(aura::RootWindow* root,
+void TestLauncherAlignment(aura::Window* root,
ShelfAlignment alignment,
const std::string& expected) {
Shell::GetInstance()->SetShelfAlignment(alignment, root);
diff --git a/ash/shell.cc b/ash/shell.cc
index ddb1598..177638f 100644
--- a/ash/shell.cc
+++ b/ash/shell.cc
@@ -202,12 +202,12 @@ Shell::RootWindowControllerList Shell::GetAllRootWindowControllers() {
}
// static
-aura::RootWindow* Shell::GetPrimaryRootWindow() {
+aura::Window* Shell::GetPrimaryRootWindow() {
return GetInstance()->display_controller()->GetPrimaryRootWindow();
}
// static
-aura::RootWindow* Shell::GetTargetRootWindow() {
+aura::Window* Shell::GetTargetRootWindow() {
Shell* shell = GetInstance();
if (shell->scoped_target_root_window_)
return shell->scoped_target_root_window_;
@@ -226,13 +226,13 @@ Shell::RootWindowList Shell::GetAllRootWindows() {
}
// static
-aura::Window* Shell::GetContainer(aura::RootWindow* root_window,
+aura::Window* Shell::GetContainer(aura::Window* root_window,
int container_id) {
return root_window->GetChildById(container_id);
}
// static
-const aura::Window* Shell::GetContainer(const aura::RootWindow* root_window,
+const aura::Window* Shell::GetContainer(const aura::Window* root_window,
int container_id) {
return root_window->GetChildById(container_id);
}
@@ -240,7 +240,7 @@ const aura::Window* Shell::GetContainer(const aura::RootWindow* root_window,
// static
std::vector<aura::Window*> Shell::GetContainersFromAllRootWindows(
int container_id,
- aura::RootWindow* priority_root) {
+ aura::Window* priority_root) {
std::vector<aura::Window*> containers;
RootWindowList root_windows = GetAllRootWindows();
for (RootWindowList::const_iterator it = root_windows.begin();
@@ -265,7 +265,7 @@ void Shell::ShowContextMenu(const gfx::Point& location_in_screen,
if (session_state_delegate_->IsScreenLocked())
return;
- aura::RootWindow* root =
+ aura::Window* root =
wm::GetRootWindowMatching(gfx::Rect(location_in_screen, gfx::Size()));
internal::GetRootWindowController(root)->
ShowContextMenu(location_in_screen, source_type);
@@ -402,19 +402,19 @@ void Shell::UpdateShelfVisibility() {
}
void Shell::SetShelfAutoHideBehavior(ShelfAutoHideBehavior behavior,
- aura::RootWindow* root_window) {
+ aura::Window* root_window) {
ash::internal::ShelfLayoutManager::ForLauncher(root_window)->
SetAutoHideBehavior(behavior);
}
ShelfAutoHideBehavior Shell::GetShelfAutoHideBehavior(
- aura::RootWindow* root_window) const {
+ aura::Window* root_window) const {
return ash::internal::ShelfLayoutManager::ForLauncher(root_window)->
auto_hide_behavior();
}
void Shell::SetShelfAlignment(ShelfAlignment alignment,
- aura::RootWindow* root_window) {
+ aura::Window* root_window) {
if (ash::internal::ShelfLayoutManager::ForLauncher(root_window)->
SetAlignment(alignment)) {
FOR_EACH_OBSERVER(
@@ -422,7 +422,7 @@ void Shell::SetShelfAlignment(ShelfAlignment alignment,
}
}
-ShelfAlignment Shell::GetShelfAlignment(aura::RootWindow* root_window) {
+ShelfAlignment Shell::GetShelfAlignment(aura::Window* root_window) {
return internal::GetRootWindowController(root_window)->
GetShelfLayoutManager()->GetAlignment();
}
@@ -435,7 +435,7 @@ void Shell::SetDimming(bool should_dim) {
}
void Shell::NotifyFullscreenStateChange(bool is_fullscreen,
- aura::RootWindow* root_window) {
+ aura::Window* root_window) {
FOR_EACH_OBSERVER(ShellObserver, observers_, OnFullscreenStateChanged(
is_fullscreen, root_window));
}
@@ -744,7 +744,7 @@ void Shell::Init() {
display_controller_->Start();
display_controller_->InitPrimaryDisplay();
- aura::RootWindow* root_window = display_controller_->GetPrimaryRootWindow();
+ aura::Window* root_window = display_controller_->GetPrimaryRootWindow();
target_root_window_ = root_window;
resolution_notification_controller_.reset(
@@ -769,7 +769,7 @@ void Shell::Init() {
AddShellObserver(overlay_filter_.get());
input_method_filter_.reset(new views::corewm::InputMethodEventFilter(
- root_window->GetAcceleratedWidget()));
+ root_window->GetDispatcher()->GetAcceleratedWidget()));
AddPreTargetHandler(input_method_filter_.get());
accelerator_filter_.reset(new internal::AcceleratorFilter);
@@ -859,7 +859,8 @@ void Shell::Init() {
// TODO(oshima): Initialize all RootWindowControllers once, and
// initialize controller/delegates above when initializing the
// primary root window controller.
- internal::RootWindowController::CreateForPrimaryDisplay(root_window);
+ internal::RootWindowController::CreateForPrimaryDisplay(
+ root_window->GetDispatcher());
display_controller_->InitSecondaryDisplays();
diff --git a/ash/shell.h b/ash/shell.h
index eb20038..5f8b7cf 100644
--- a/ash/shell.h
+++ b/ash/shell.h
@@ -191,16 +191,16 @@ class ASH_EXPORT Shell
// TODO(oshima): move this to |RootWindowController|
static RootWindowControllerList GetAllRootWindowControllers();
- // Returns the primary RootWindow. The primary RootWindow is the one
- // that has a launcher.
- static aura::RootWindow* GetPrimaryRootWindow();
+ // Returns the primary root Window. The primary root Window is the one that
+ // has a launcher.
+ static aura::Window* GetPrimaryRootWindow();
- // Returns a RootWindow when used as a target when creating a new window.
+ // Returns a root Window when used as a target when creating a new window.
// The root window of the active window is used in most cases, but can
// be overridden by using ScopedTargetRootWindow().
- // If you want to get a RootWindow of the active window, just use
+ // If you want to get the root Window of the active window, just use
// |wm::GetActiveWindow()->GetRootWindow()|.
- static aura::RootWindow* GetTargetRootWindow();
+ static aura::Window* GetTargetRootWindow();
// Returns the global Screen object that's always active in ash.
static gfx::Screen* GetScreen();
@@ -208,9 +208,9 @@ class ASH_EXPORT Shell
// Returns all root windows.
static RootWindowList GetAllRootWindows();
- static aura::Window* GetContainer(aura::RootWindow* root_window,
+ static aura::Window* GetContainer(aura::Window* root_window,
int container_id);
- static const aura::Window* GetContainer(const aura::RootWindow* root_window,
+ static const aura::Window* GetContainer(const aura::Window* root_window,
int container_id);
// Returns the list of containers that match |container_id| in
@@ -218,9 +218,9 @@ class ASH_EXPORT Shell
// in the |priority_root| will be inserted at the top of the list.
static std::vector<aura::Window*> GetContainersFromAllRootWindows(
int container_id,
- aura::RootWindow* priority_root);
+ aura::Window* priority_root);
- void set_target_root_window(aura::RootWindow* target_root_window) {
+ void set_target_root_window(aura::Window* target_root_window) {
target_root_window_ = target_root_window;
}
@@ -410,14 +410,14 @@ class ASH_EXPORT Shell
// Sets/gets the shelf auto-hide behavior on |root_window|.
void SetShelfAutoHideBehavior(ShelfAutoHideBehavior behavior,
- aura::RootWindow* root_window);
+ aura::Window* root_window);
ShelfAutoHideBehavior GetShelfAutoHideBehavior(
- aura::RootWindow* root_window) const;
+ aura::Window* root_window) const;
// Sets/gets shelf's alignment on |root_window|.
void SetShelfAlignment(ShelfAlignment alignment,
- aura::RootWindow* root_window);
- ShelfAlignment GetShelfAlignment(aura::RootWindow* root_window);
+ aura::Window* root_window);
+ ShelfAlignment GetShelfAlignment(aura::Window* root_window);
// Dims or undims the screen.
void SetDimming(bool should_dim);
@@ -425,7 +425,7 @@ class ASH_EXPORT Shell
// Notifies |observers_| when entering or exiting fullscreen mode in
// |root_window|.
void NotifyFullscreenStateChange(bool is_fullscreen,
- aura::RootWindow* root_window);
+ aura::Window* root_window);
// Creates a modal background (a partially-opaque fullscreen window)
// on all displays for |window|.
@@ -566,8 +566,8 @@ class ASH_EXPORT Shell
// created on |scoped_target_root_window_| , unless NULL in
// which case they are created on |target_root_window_|.
// |target_root_window_| never becomes NULL during the session.
- aura::RootWindow* target_root_window_;
- aura::RootWindow* scoped_target_root_window_;
+ aura::Window* target_root_window_;
+ aura::Window* scoped_target_root_window_;
// The CompoundEventFilter owned by aura::Env object.
scoped_ptr<views::corewm::CompoundEventFilter> env_filter_;
diff --git a/ash/shell/content_client/shell_browser_main_parts.cc b/ash/shell/content_client/shell_browser_main_parts.cc
index f8eb434..71e6ca4 100644
--- a/ash/shell/content_client/shell_browser_main_parts.cc
+++ b/ash/shell/content_client/shell_browser_main_parts.cc
@@ -134,7 +134,7 @@ void ShellBrowserMainParts::PreMainMessageLoopRun() {
Shell::GetInstance()->desktop_background_controller()->SetDefaultWallpaper(
false /* is_guest */);
- ash::Shell::GetPrimaryRootWindow()->ShowRootWindow();
+ ash::Shell::GetPrimaryRootWindow()->GetDispatcher()->ShowRootWindow();
}
void ShellBrowserMainParts::PostMainMessageLoopRun() {
diff --git a/ash/shell/context_menu.cc b/ash/shell/context_menu.cc
index e1a62d1..19ad408 100644
--- a/ash/shell/context_menu.cc
+++ b/ash/shell/context_menu.cc
@@ -14,7 +14,7 @@
namespace ash {
namespace shell {
-ContextMenu::ContextMenu(aura::RootWindow* root)
+ContextMenu::ContextMenu(aura::Window* root)
: ui::SimpleMenuModel(NULL),
root_window_(root),
alignment_menu_(root) {
diff --git a/ash/shell/context_menu.h b/ash/shell/context_menu.h
index a07310e..32421ca 100644
--- a/ash/shell/context_menu.h
+++ b/ash/shell/context_menu.h
@@ -21,7 +21,7 @@ namespace shell {
class ContextMenu : public ui::SimpleMenuModel,
public ui::SimpleMenuModel::Delegate {
public:
- explicit ContextMenu(aura::RootWindow* root);
+ explicit ContextMenu(aura::Window* root);
virtual ~ContextMenu();
// ui::SimpleMenuModel::Delegate overrides:
@@ -38,7 +38,7 @@ class ContextMenu : public ui::SimpleMenuModel,
MENU_ALIGNMENT_MENU,
};
- aura::RootWindow* root_window_;
+ aura::Window* root_window_;
ShelfAlignmentMenu alignment_menu_;
diff --git a/ash/shell/shell_delegate_impl.cc b/ash/shell/shell_delegate_impl.cc
index 6280f2b..717d07d 100644
--- a/ash/shell/shell_delegate_impl.cc
+++ b/ash/shell/shell_delegate_impl.cc
@@ -155,7 +155,7 @@ void ShellDelegateImpl::HandleMediaPlayPause() {
void ShellDelegateImpl::HandleMediaPrevTrack() {
}
-ui::MenuModel* ShellDelegateImpl::CreateContextMenu(aura::RootWindow* root) {
+ui::MenuModel* ShellDelegateImpl::CreateContextMenu(aura::Window* root) {
return new ContextMenu(root);
}
diff --git a/ash/shell/shell_delegate_impl.h b/ash/shell/shell_delegate_impl.h
index 75c14e4..35f46ff 100644
--- a/ash/shell/shell_delegate_impl.h
+++ b/ash/shell/shell_delegate_impl.h
@@ -52,7 +52,7 @@ class ShellDelegateImpl : public ash::ShellDelegate {
virtual void HandleMediaPlayPause() OVERRIDE;
virtual void HandleMediaPrevTrack() OVERRIDE;
virtual ui::MenuModel* CreateContextMenu(
- aura::RootWindow* root_window) OVERRIDE;
+ aura::Window* root_window) OVERRIDE;
virtual RootWindowHostFactory* CreateRootWindowHostFactory() OVERRIDE;
virtual base::string16 GetProductName() const OVERRIDE;
diff --git a/ash/shell/window_watcher.cc b/ash/shell/window_watcher.cc
index 7c72e27..302a523 100644
--- a/ash/shell/window_watcher.cc
+++ b/ash/shell/window_watcher.cc
@@ -36,7 +36,7 @@ class WindowWatcher::WorkspaceWindowWatcher : public aura::WindowObserver {
window->RemoveObserver(watcher_);
}
- void RootWindowAdded(aura::RootWindow* root) {
+ void RootWindowAdded(aura::Window* root) {
aura::Window* panel_container = ash::Shell::GetContainer(
root,
internal::kShellWindowId_PanelContainer);
@@ -150,7 +150,7 @@ void WindowWatcher::OnDisplayBoundsChanged(const gfx::Display& display) {
}
void WindowWatcher::OnDisplayAdded(const gfx::Display& new_display) {
- aura::RootWindow* root = Shell::GetInstance()->display_controller()->
+ aura::Window* root = Shell::GetInstance()->display_controller()->
GetRootWindowForDisplayId(new_display.id());
workspace_window_watcher_->RootWindowAdded(root);
}
diff --git a/ash/shell/window_watcher_launcher_item_delegate.cc b/ash/shell/window_watcher_launcher_item_delegate.cc
index 553b9fc..e755a6e 100644
--- a/ash/shell/window_watcher_launcher_item_delegate.cc
+++ b/ash/shell/window_watcher_launcher_item_delegate.cc
@@ -36,7 +36,7 @@ base::string16 WindowWatcherLauncherItemDelegate::GetTitle() {
}
ui::MenuModel* WindowWatcherLauncherItemDelegate::CreateContextMenu(
- aura::RootWindow* root_window) {
+ aura::Window* root_window) {
return NULL;
}
diff --git a/ash/shell/window_watcher_launcher_item_delegate.h b/ash/shell/window_watcher_launcher_item_delegate.h
index e7d0b22..53014b6 100644
--- a/ash/shell/window_watcher_launcher_item_delegate.h
+++ b/ash/shell/window_watcher_launcher_item_delegate.h
@@ -25,7 +25,7 @@ class WindowWatcherLauncherItemDelegate : public ash::LauncherItemDelegate {
virtual void ItemSelected(const ui::Event& event) OVERRIDE;
virtual base::string16 GetTitle() OVERRIDE;
virtual ui::MenuModel* CreateContextMenu(
- aura::RootWindow* root_window) OVERRIDE;
+ aura::Window* root_window) OVERRIDE;
virtual ash::LauncherMenuModel* CreateApplicationMenu(
int event_flags) OVERRIDE;
virtual bool IsDraggable() OVERRIDE;
diff --git a/ash/shell/window_watcher_unittest.cc b/ash/shell/window_watcher_unittest.cc
index 71a2f87..4d470ae 100644
--- a/ash/shell/window_watcher_unittest.cc
+++ b/ash/shell/window_watcher_unittest.cc
@@ -24,7 +24,7 @@ TEST_F(WindowWatcherTest, ShellDeleteInstance) {
shell::ShellDelegateImpl* delegate = new ash::shell::ShellDelegateImpl;
Shell::CreateInstance(delegate);
- Shell::GetPrimaryRootWindow()->ShowRootWindow();
+ Shell::GetPrimaryRootWindow()->GetDispatcher()->ShowRootWindow();
Shell::GetInstance()->CreateLauncher();
Shell::GetInstance()->UpdateAfterLoginStatusChange(
user::LOGGED_IN_USER);
diff --git a/ash/shell_delegate.h b/ash/shell_delegate.h
index 42d936a..6cd0baa 100644
--- a/ash/shell_delegate.h
+++ b/ash/shell_delegate.h
@@ -182,7 +182,7 @@ class ASH_EXPORT ShellDelegate {
virtual void HandleMediaPrevTrack() = 0;
// Creates a menu model of the context for the |root_window|.
- virtual ui::MenuModel* CreateContextMenu(aura::RootWindow* root_window) = 0;
+ virtual ui::MenuModel* CreateContextMenu(aura::Window* root_window) = 0;
// Creates a root window host factory. Shell takes ownership of the returned
// value.
diff --git a/ash/shell_observer.h b/ash/shell_observer.h
index b09229b..9d1db02 100644
--- a/ash/shell_observer.h
+++ b/ash/shell_observer.h
@@ -9,7 +9,7 @@
#include "ash/system/user/login_status.h"
namespace aura {
-class RootWindow;
+class Window;
}
namespace ash {
@@ -30,14 +30,14 @@ class ASH_EXPORT ShellObserver {
virtual void OnLockStateChanged(bool locked) {}
// Invoked when the shelf alignment in |root_window| is changed.
- virtual void OnShelfAlignmentChanged(aura::RootWindow* root_window) {}
+ virtual void OnShelfAlignmentChanged(aura::Window* root_window) {}
// Invoked when the projection touch HUD is toggled.
virtual void OnTouchHudProjectionToggled(bool enabled) {}
// Invoked when entering or exiting fullscreen mode in |root_window|.
virtual void OnFullscreenStateChanged(bool is_fullscreen,
- aura::RootWindow* root_window) {}
+ aura::Window* root_window) {}
protected:
virtual ~ShellObserver() {}
diff --git a/ash/shell_unittest.cc b/ash/shell_unittest.cc
index 994f456..309ebae 100644
--- a/ash/shell_unittest.cc
+++ b/ash/shell_unittest.cc
@@ -54,7 +54,7 @@ aura::Window* GetAlwaysOnTopContainer() {
// Expect ALL the containers!
void ExpectAllContainers() {
- aura::RootWindow* root_window = Shell::GetPrimaryRootWindow();
+ aura::Window* root_window = Shell::GetPrimaryRootWindow();
EXPECT_TRUE(Shell::GetContainer(
root_window, internal::kShellWindowId_DesktopBackgroundContainer));
EXPECT_TRUE(Shell::GetContainer(
@@ -397,8 +397,9 @@ TEST_F(ShellTest, ManagedWindowModeBasics) {
EXPECT_TRUE(launcher_widget->IsVisible());
// Launcher is at bottom-left of screen.
EXPECT_EQ(0, launcher_widget->GetWindowBoundsInScreen().x());
- EXPECT_EQ(Shell::GetPrimaryRootWindow()->GetHostSize().height(),
- launcher_widget->GetWindowBoundsInScreen().bottom());
+ EXPECT_EQ(
+ Shell::GetPrimaryRootWindow()->GetDispatcher()->GetHostSize().height(),
+ launcher_widget->GetWindowBoundsInScreen().bottom());
// We have a desktop background but not a bare layer.
// TODO (antrim): enable once we find out why it fails component build.
// internal::DesktopBackgroundWidgetController* background =
@@ -482,7 +483,7 @@ TEST_F(ShellTest, ToggleAutoHide) {
wm::ActivateWindow(window.get());
Shell* shell = Shell::GetInstance();
- aura::RootWindow* root_window = Shell::GetPrimaryRootWindow();
+ aura::Window* root_window = Shell::GetPrimaryRootWindow();
shell->SetShelfAutoHideBehavior(ash::SHELF_AUTO_HIDE_BEHAVIOR_ALWAYS,
root_window);
EXPECT_EQ(ash::SHELF_AUTO_HIDE_BEHAVIOR_ALWAYS,
diff --git a/ash/system/tray/tray_background_view.cc b/ash/system/tray/tray_background_view.cc
index b106122..f357706 100644
--- a/ash/system/tray/tray_background_view.cc
+++ b/ash/system/tray/tray_background_view.cc
@@ -573,7 +573,7 @@ gfx::Rect TrayBackgroundView::GetBubbleAnchorRect(
// TODO(jennyz): May need to add left/right alignment in the following code.
if (rect.IsEmpty()) {
- aura::RootWindow* target_root = anchor_widget ?
+ aura::Window* target_root = anchor_widget ?
anchor_widget->GetNativeView()->GetRootWindow() :
Shell::GetPrimaryRootWindow();
rect = target_root->bounds();
@@ -622,7 +622,7 @@ void TrayBackgroundView::UpdateBubbleViewArrow(
if (switches::UseAlternateShelfLayout())
return;
- aura::RootWindow* root_window =
+ aura::Window* root_window =
bubble_view->GetWidget()->GetNativeView()->GetRootWindow();
ash::internal::ShelfLayoutManager* shelf =
ShelfLayoutManager::ForLauncher(root_window);
diff --git a/ash/system/tray/tray_event_filter.cc b/ash/system/tray/tray_event_filter.cc
index a5ea3a2..676c8b6 100644
--- a/ash/system/tray/tray_event_filter.cc
+++ b/ash/system/tray/tray_event_filter.cc
@@ -75,7 +75,7 @@ bool TrayEventFilter::ProcessLocatedEvent(ui::LocatedEvent* event) {
gfx::Rect bounds = bubble_widget->GetWindowBoundsInScreen();
bounds.Inset(wrapper->bubble_view()->GetBorderInsets());
- aura::RootWindow* root = bubble_widget->GetNativeView()->GetRootWindow();
+ aura::Window* root = bubble_widget->GetNativeView()->GetRootWindow();
aura::client::ScreenPositionClient* screen_position_client =
aura::client::GetScreenPositionClient(root);
gfx::Point screen_point(event->root_location());
diff --git a/ash/system/web_notification/web_notification_tray.cc b/ash/system/web_notification/web_notification_tray.cc
index 70e2b5b..53a381b 100644
--- a/ash/system/web_notification/web_notification_tray.cc
+++ b/ash/system/web_notification/web_notification_tray.cc
@@ -83,7 +83,7 @@ class WorkAreaObserver : public ShelfLayoutManagerObserver,
// Starts observing |shelf| and shell and sends the change to |collection|.
void StartObserving(message_center::MessagePopupCollection* collection,
- aura::RootWindow* root_window);
+ aura::Window* root_window);
// Stops the observing session.
void StopObserving();
@@ -99,7 +99,7 @@ class WorkAreaObserver : public ShelfLayoutManagerObserver,
void UpdateShelf();
message_center::MessagePopupCollection* collection_;
- aura::RootWindow* root_window_;
+ aura::Window* root_window_;
ShelfLayoutManager* shelf_;
int system_tray_height_;
@@ -139,7 +139,7 @@ void WorkAreaObserver::SetSystemTrayHeight(int height) {
void WorkAreaObserver::StartObserving(
message_center::MessagePopupCollection* collection,
- aura::RootWindow* root_window) {
+ aura::Window* root_window) {
DCHECK(collection);
collection_ = collection;
root_window_ = root_window;
@@ -349,7 +349,7 @@ bool WebNotificationTray::ShowMessageCenterInternal(bool show_settings) {
break;
}
case SHELF_ALIGNMENT_TOP: {
- aura::RootWindow* root = status_area_window->GetRootWindow();
+ aura::Window* root = status_area_window->GetRootWindow();
max_height =
root->bounds().height() - status_area_window->bounds().height();
break;
diff --git a/ash/test/ash_test_base.cc b/ash/test/ash_test_base.cc
index b6c10a4..c82ae75 100644
--- a/ash/test/ash_test_base.cc
+++ b/ash/test/ash_test_base.cc
@@ -60,7 +60,7 @@ class AshEventGeneratorDelegate : public aura::test::EventGeneratorDelegate {
gfx::Screen* screen = Shell::GetScreen();
gfx::Display display = screen->GetDisplayNearestPoint(point_in_screen);
return Shell::GetInstance()->display_controller()->
- GetRootWindowForDisplayId(display.id());
+ GetRootWindowForDisplayId(display.id())->GetDispatcher();
}
virtual aura::client::ScreenPositionClient* GetScreenPositionClient(
@@ -115,7 +115,7 @@ void AshTestBase::SetUp() {
ash_test_helper_->SetUp(start_session_);
Shell::GetPrimaryRootWindow()->Show();
- Shell::GetPrimaryRootWindow()->ShowRootWindow();
+ Shell::GetPrimaryRootWindow()->GetDispatcher()->ShowRootWindow();
// Move the mouse cursor to far away so that native events doesn't
// interfere test expectations.
Shell::GetPrimaryRootWindow()->MoveCursorTo(gfx::Point(-1000, -1000));
@@ -207,7 +207,7 @@ void AshTestBase::UpdateDisplay(const std::string& display_specs) {
display_manager_test_api.UpdateDisplay(display_specs);
}
-aura::RootWindow* AshTestBase::CurrentContext() {
+aura::Window* AshTestBase::CurrentContext() {
return ash_test_helper_->CurrentContext();
}
@@ -254,7 +254,7 @@ aura::Window* AshTestBase::CreateTestWindowInShellWithDelegateAndType(
} else {
gfx::Display display =
Shell::GetScreen()->GetDisplayMatching(bounds);
- aura::RootWindow* root = ash::Shell::GetInstance()->display_controller()->
+ aura::Window* root = ash::Shell::GetInstance()->display_controller()->
GetRootWindowForDisplayId(display.id());
gfx::Point origin = bounds.origin();
wm::ConvertPointFromScreen(root, &origin);
diff --git a/ash/test/ash_test_base.h b/ash/test/ash_test_base.h
index dc2bfe4..b88f26cc 100644
--- a/ash/test/ash_test_base.h
+++ b/ash/test/ash_test_base.h
@@ -64,10 +64,10 @@ class AshTestBase : public testing::Test {
// See ash::test::DisplayManagerTestApi::UpdateDisplay for more details.
void UpdateDisplay(const std::string& display_specs);
- // Returns a RootWindow. Usually this is the active RootWindow, but that
+ // Returns a root Window. Usually this is the active root Window, but that
// method can return NULL sometimes, and in those cases, we fall back on the
- // primary RootWindow.
- aura::RootWindow* CurrentContext();
+ // primary root Window.
+ aura::Window* CurrentContext();
// Versions of the functions in aura::test:: that go through our shell
// StackingController instead of taking a parent.
diff --git a/ash/test/ash_test_helper.cc b/ash/test/ash_test_helper.cc
index 49bb4d1..8981507 100644
--- a/ash/test/ash_test_helper.cc
+++ b/ash/test/ash_test_helper.cc
@@ -128,8 +128,8 @@ void AshTestHelper::RunAllPendingInMessageLoop() {
run_loop.RunUntilIdle();
}
-aura::RootWindow* AshTestHelper::CurrentContext() {
- aura::RootWindow* root_window = Shell::GetTargetRootWindow();
+aura::Window* AshTestHelper::CurrentContext() {
+ aura::Window* root_window = Shell::GetTargetRootWindow();
if (!root_window)
root_window = Shell::GetPrimaryRootWindow();
DCHECK(root_window);
diff --git a/ash/test/ash_test_helper.h b/ash/test/ash_test_helper.h
index 030f7f8..9e78fea 100644
--- a/ash/test/ash_test_helper.h
+++ b/ash/test/ash_test_helper.h
@@ -9,7 +9,7 @@
#include "base/memory/scoped_ptr.h"
namespace aura {
-class RootWindow;
+class Window;
} // namespace aura
namespace base {
@@ -41,10 +41,10 @@ class AshTestHelper {
// Destroys the ash::Shell and performs associated cleanup.
void TearDown();
- // Returns a RootWindow. Usually this is the active RootWindow, but that
+ // Returns a root Window. Usually this is the active root Window, but that
// method can return NULL sometimes, and in those cases, we fall back on the
- // primary RootWindow.
- aura::RootWindow* CurrentContext();
+ // primary root Window.
+ aura::Window* CurrentContext();
void RunAllPendingInMessageLoop();
diff --git a/ash/test/test_launcher_item_delegate.cc b/ash/test/test_launcher_item_delegate.cc
index 9cb56bb..7ac8b72 100644
--- a/ash/test/test_launcher_item_delegate.cc
+++ b/ash/test/test_launcher_item_delegate.cc
@@ -31,7 +31,7 @@ base::string16 TestLauncherItemDelegate::GetTitle() {
}
ui::MenuModel* TestLauncherItemDelegate::CreateContextMenu(
- aura::RootWindow* root_window) {
+ aura::Window* root_window) {
return NULL;
}
diff --git a/ash/test/test_launcher_item_delegate.h b/ash/test/test_launcher_item_delegate.h
index 138a772..fd4c394 100644
--- a/ash/test/test_launcher_item_delegate.h
+++ b/ash/test/test_launcher_item_delegate.h
@@ -26,7 +26,7 @@ class TestLauncherItemDelegate : public ash::LauncherItemDelegate {
virtual void ItemSelected(const ui::Event& event) OVERRIDE;
virtual base::string16 GetTitle() OVERRIDE;
virtual ui::MenuModel* CreateContextMenu(
- aura::RootWindow* root_window) OVERRIDE;
+ aura::Window* root_window) OVERRIDE;
virtual ash::LauncherMenuModel* CreateApplicationMenu(
int event_flags) OVERRIDE;
virtual bool IsDraggable() OVERRIDE;
diff --git a/ash/test/test_shell_delegate.cc b/ash/test/test_shell_delegate.cc
index f2b3722..b7a4823 100644
--- a/ash/test/test_shell_delegate.cc
+++ b/ash/test/test_shell_delegate.cc
@@ -137,7 +137,7 @@ void TestShellDelegate::HandleMediaPlayPause() {
void TestShellDelegate::HandleMediaPrevTrack() {
}
-ui::MenuModel* TestShellDelegate::CreateContextMenu(aura::RootWindow* root) {
+ui::MenuModel* TestShellDelegate::CreateContextMenu(aura::Window* root) {
return NULL;
}
diff --git a/ash/test/test_shell_delegate.h b/ash/test/test_shell_delegate.h
index 5e854ee..98ffca41 100644
--- a/ash/test/test_shell_delegate.h
+++ b/ash/test/test_shell_delegate.h
@@ -54,7 +54,7 @@ class TestShellDelegate : public ShellDelegate {
virtual void HandleMediaNextTrack() OVERRIDE;
virtual void HandleMediaPlayPause() OVERRIDE;
virtual void HandleMediaPrevTrack() OVERRIDE;
- virtual ui::MenuModel* CreateContextMenu(aura::RootWindow* root) OVERRIDE;
+ virtual ui::MenuModel* CreateContextMenu(aura::Window* root) OVERRIDE;
virtual RootWindowHostFactory* CreateRootWindowHostFactory() OVERRIDE;
virtual base::string16 GetProductName() const OVERRIDE;
diff --git a/ash/test/ui_controls_factory_ash.cc b/ash/test/ui_controls_factory_ash.cc
index 458a4cb..b8393e5 100644
--- a/ash/test/ui_controls_factory_ash.cc
+++ b/ash/test/ui_controls_factory_ash.cc
@@ -30,11 +30,12 @@ DEFINE_OWNED_WINDOW_PROPERTY_KEY(UIControlsAura, kUIControlsKey, NULL);
// Returns the UIControls object for RootWindow.
// kUIControlsKey is owned property and UIControls object
// will be deleted when the root window is deleted.
-UIControlsAura* GetUIControlsForRootWindow(aura::RootWindow* root_window) {
+UIControlsAura* GetUIControlsForRootWindow(aura::Window* root_window) {
UIControlsAura* native_ui_control =
root_window->GetProperty(kUIControlsKey);
if (!native_ui_control) {
- native_ui_control = aura::test::CreateUIControlsAura(root_window);
+ native_ui_control =
+ aura::test::CreateUIControlsAura(root_window->GetDispatcher());
// Pass the ownership to the |root_window|.
root_window->SetProperty(kUIControlsKey, native_ui_control);
}
@@ -47,7 +48,7 @@ UIControlsAura* GetUIControlsForRootWindow(aura::RootWindow* root_window) {
// the |point_in_screen|.
UIControlsAura* GetUIControlsAt(gfx::Point* point_in_screen) {
// TODO(mazda): Support the case passive grab is taken.
- aura::RootWindow* root = ash::wm::GetRootWindowAt(*point_in_screen);
+ aura::Window* root = ash::wm::GetRootWindowAt(*point_in_screen);
aura::client::ScreenPositionClient* screen_position_client =
aura::client::GetScreenPositionClient(root);
@@ -85,7 +86,7 @@ class UIControlsAsh : public UIControlsAura {
bool alt,
bool command,
const base::Closure& closure) OVERRIDE {
- aura::RootWindow* root =
+ aura::Window* root =
window ? window->GetRootWindow() : ash::Shell::GetTargetRootWindow();
UIControlsAura* ui_controls = GetUIControlsForRootWindow(root);
return ui_controls && ui_controls->SendKeyPressNotifyWhenDone(
diff --git a/ash/touch/touch_observer_hud.h b/ash/touch/touch_observer_hud.h
index b94cc17..2303fa8 100644
--- a/ash/touch/touch_observer_hud.h
+++ b/ash/touch/touch_observer_hud.h
@@ -80,7 +80,7 @@ class ASH_EXPORT TouchObserverHUD
friend class TouchHudTest;
const int64 display_id_;
- aura::RootWindow* root_window_;
+ aura::Window* root_window_;
views::Widget* widget_;
diff --git a/ash/touch/touch_observer_hud_unittest.cc b/ash/touch/touch_observer_hud_unittest.cc
index df992ba..0a4f89df 100644
--- a/ash/touch/touch_observer_hud_unittest.cc
+++ b/ash/touch/touch_observer_hud_unittest.cc
@@ -170,43 +170,43 @@ class TouchHudTest : public test::AshTestBase {
return GetDisplayManager()->GetDisplayForId(external_display_id_);
}
- aura::RootWindow* GetInternalRootWindow() {
+ aura::Window* GetInternalRootWindow() {
return GetDisplayController()->GetRootWindowForDisplayId(
internal_display_id_);
}
- aura::RootWindow* GetExternalRootWindow() {
+ aura::Window* GetExternalRootWindow() {
return GetDisplayController()->GetRootWindowForDisplayId(
external_display_id_);
}
- aura::RootWindow* GetPrimaryRootWindow() {
+ aura::Window* GetPrimaryRootWindow() {
const gfx::Display& display = GetPrimaryDisplay();
return GetDisplayController()->GetRootWindowForDisplayId(display.id());
}
- aura::RootWindow* GetSecondaryRootWindow() {
+ aura::Window* GetSecondaryRootWindow() {
const gfx::Display& display = GetSecondaryDisplay();
return GetDisplayController()->GetRootWindowForDisplayId(display.id());
}
internal::RootWindowController* GetInternalRootController() {
- aura::RootWindow* root = GetInternalRootWindow();
+ aura::Window* root = GetInternalRootWindow();
return GetRootWindowController(root);
}
internal::RootWindowController* GetExternalRootController() {
- aura::RootWindow* root = GetExternalRootWindow();
+ aura::Window* root = GetExternalRootWindow();
return GetRootWindowController(root);
}
internal::RootWindowController* GetPrimaryRootController() {
- aura::RootWindow* root = GetPrimaryRootWindow();
+ aura::Window* root = GetPrimaryRootWindow();
return GetRootWindowController(root);
}
internal::RootWindowController* GetSecondaryRootController() {
- aura::RootWindow* root = GetSecondaryRootWindow();
+ aura::Window* root = GetSecondaryRootWindow();
return GetRootWindowController(root);
}
diff --git a/ash/wm/app_list_controller.cc b/ash/wm/app_list_controller.cc
index a6549c2..68af351 100644
--- a/ash/wm/app_list_controller.cc
+++ b/ash/wm/app_list_controller.cc
@@ -163,7 +163,7 @@ void AppListController::SetVisible(bool visible, aura::Window* window) {
// will be released with AppListView on close.
app_list::AppListView* view = new app_list::AppListView(
Shell::GetInstance()->delegate()->CreateAppListViewDelegate());
- aura::RootWindow* root_window = window->GetRootWindow();
+ aura::Window* root_window = window->GetRootWindow();
aura::Window* container = GetRootWindowController(root_window)->
GetContainer(kShellWindowId_AppListContainer);
if (ash::switches::UseAlternateShelfLayout()) {
@@ -369,7 +369,7 @@ void AppListController::OnWidgetDestroying(views::Widget* widget) {
////////////////////////////////////////////////////////////////////////////////
// AppListController, ShellObserver implementation:
-void AppListController::OnShelfAlignmentChanged(aura::RootWindow* root_window) {
+void AppListController::OnShelfAlignmentChanged(aura::Window* root_window) {
if (view_)
view_->SetBubbleArrow(GetBubbleArrow(view_->GetWidget()->GetNativeView()));
}
diff --git a/ash/wm/app_list_controller.h b/ash/wm/app_list_controller.h
index f47c7a4..0fc20b5 100644
--- a/ash/wm/app_list_controller.h
+++ b/ash/wm/app_list_controller.h
@@ -111,7 +111,7 @@ class AppListController : public ui::EventHandler,
virtual void OnWidgetDestroying(views::Widget* widget) OVERRIDE;
// ShellObserver overrides:
- virtual void OnShelfAlignmentChanged(aura::RootWindow* root_window) OVERRIDE;
+ virtual void OnShelfAlignmentChanged(aura::Window* root_window) OVERRIDE;
// LauncherIconObserver overrides:
virtual void OnLauncherIconPositionsChanged() OVERRIDE;
diff --git a/ash/wm/ash_focus_rules.cc b/ash/wm/ash_focus_rules.cc
index e6688d7..02b2d02 100644
--- a/ash/wm/ash_focus_rules.cc
+++ b/ash/wm/ash_focus_rules.cc
@@ -105,7 +105,7 @@ aura::Window* AshFocusRules::GetNextActivatableWindow(
int starting_container_index = 0;
// If the container of the window losing focus is in the list, start from that
// container.
- aura::RootWindow* root = ignore->GetRootWindow();
+ aura::Window* root = ignore->GetRootWindow();
if (!root)
root = Shell::GetTargetRootWindow();
int container_count = static_cast<int>(arraysize(kWindowContainerIds));
@@ -137,7 +137,7 @@ aura::Window* AshFocusRules::GetTopmostWindowToActivateForContainerIndex(
int index,
aura::Window* ignore) const {
aura::Window* window = NULL;
- aura::RootWindow* root = ignore ? ignore->GetRootWindow() : NULL;
+ aura::Window* root = ignore ? ignore->GetRootWindow() : NULL;
aura::Window::Windows containers = Shell::GetContainersFromAllRootWindows(
kWindowContainerIds[index], root);
for (aura::Window::Windows::const_iterator iter = containers.begin();
diff --git a/ash/wm/ash_native_cursor_manager_unittest.cc b/ash/wm/ash_native_cursor_manager_unittest.cc
index 113e624..76da49d 100644
--- a/ash/wm/ash_native_cursor_manager_unittest.cc
+++ b/ash/wm/ash_native_cursor_manager_unittest.cc
@@ -173,7 +173,7 @@ TEST_F(AshNativeCursorManagerTest, SetDeviceScaleFactorAndRotation) {
}
TEST_F(AshNativeCursorManagerTest, DisabledQueryMouseLocation) {
- aura::RootWindow* root_window = Shell::GetInstance()->GetPrimaryRootWindow();
+ aura::Window* root_window = Shell::GetInstance()->GetPrimaryRootWindow();
#if defined(OS_WIN)
if (base::win::GetVersion() < base::win::VERSION_WIN8)
return;
@@ -193,11 +193,12 @@ TEST_F(AshNativeCursorManagerTest, DisabledQueryMouseLocation) {
Sleep(100);
RunAllPendingInMessageLoop();
#endif
+ aura::WindowEventDispatcher* dispatcher = root_window->GetDispatcher();
gfx::Point mouse_location;
- EXPECT_TRUE(root_window->QueryMouseLocationForTest(&mouse_location));
+ EXPECT_TRUE(dispatcher->QueryMouseLocationForTest(&mouse_location));
EXPECT_EQ("10,10", mouse_location.ToString());
Shell::GetInstance()->cursor_manager()->DisableMouseEvents();
- EXPECT_FALSE(root_window->QueryMouseLocationForTest(&mouse_location));
+ EXPECT_FALSE(dispatcher->QueryMouseLocationForTest(&mouse_location));
EXPECT_EQ("0,0", mouse_location.ToString());
}
diff --git a/ash/wm/base_layout_manager.cc b/ash/wm/base_layout_manager.cc
index 90c0d97..65fb820 100644
--- a/ash/wm/base_layout_manager.cc
+++ b/ash/wm/base_layout_manager.cc
@@ -15,7 +15,6 @@
#include "ash/wm/workspace/workspace_window_resizer.h"
#include "ui/aura/client/activation_client.h"
#include "ui/aura/client/aura_constants.h"
-#include "ui/aura/root_window.h"
#include "ui/aura/window.h"
#include "ui/base/ui_base_types.h"
#include "ui/compositor/layer.h"
@@ -29,7 +28,7 @@ namespace internal {
/////////////////////////////////////////////////////////////////////////////
// BaseLayoutManager, public:
-BaseLayoutManager::BaseLayoutManager(aura::RootWindow* root_window)
+BaseLayoutManager::BaseLayoutManager(aura::Window* root_window)
: root_window_(root_window) {
Shell::GetInstance()->activation_client()->AddObserver(this);
Shell::GetInstance()->AddShellObserver(this);
diff --git a/ash/wm/base_layout_manager.h b/ash/wm/base_layout_manager.h
index 7a94bf38..6f74e4c 100644
--- a/ash/wm/base_layout_manager.h
+++ b/ash/wm/base_layout_manager.h
@@ -19,7 +19,6 @@
#include "ui/events/event_handler.h"
namespace aura {
-class RootWindow;
class Window;
}
@@ -44,7 +43,7 @@ class ASH_EXPORT BaseLayoutManager
public:
typedef std::set<aura::Window*> WindowSet;
- explicit BaseLayoutManager(aura::RootWindow* root_window);
+ explicit BaseLayoutManager(aura::Window* root_window);
virtual ~BaseLayoutManager();
const WindowSet& windows() const { return windows_; }
@@ -109,7 +108,7 @@ class ASH_EXPORT BaseLayoutManager
wm::WindowState* window_state,
AdjustWindowReason reason);
- aura::RootWindow* root_window() { return root_window_; }
+ aura::Window* root_window() { return root_window_; }
private:
// Update window bounds based on a change in show state.
@@ -118,7 +117,7 @@ class ASH_EXPORT BaseLayoutManager
// Set of windows we're listening to.
WindowSet windows_;
- aura::RootWindow* root_window_;
+ aura::Window* root_window_;
DISALLOW_COPY_AND_ASSIGN(BaseLayoutManager);
};
diff --git a/ash/wm/caption_buttons/frame_maximize_button_unittest.cc b/ash/wm/caption_buttons/frame_maximize_button_unittest.cc
index 2eaa333..c2ea2e8 100644
--- a/ash/wm/caption_buttons/frame_maximize_button_unittest.cc
+++ b/ash/wm/caption_buttons/frame_maximize_button_unittest.cc
@@ -535,7 +535,7 @@ TEST_F(FrameMaximizeButtonTest, MaximizeKeepFocus) {
TEST_F(FrameMaximizeButtonTest, MaximizeTap) {
aura::Window* window = widget()->GetNativeWindow();
- aura::RootWindow* root_window = window->GetRootWindow();
+ aura::Window* root_window = window->GetRootWindow();
ash::FrameMaximizeButton* maximize_button =
FrameMaximizeButtonTest::maximize_button();
gfx::Point button_pos = maximize_button->GetBoundsInScreen().CenterPoint();
@@ -544,12 +544,13 @@ TEST_F(FrameMaximizeButtonTest, MaximizeTap) {
ui::GestureConfiguration::default_radius();
ui::GestureConfiguration::set_default_radius(0);
+ aura::WindowEventDispatcher* dispatcher = root_window->GetDispatcher();
const int kTouchId = 2;
ui::TouchEvent press(ui::ET_TOUCH_PRESSED,
button_pos,
kTouchId,
ui::EventTimeForNow());
- root_window->AsRootWindowHostDelegate()->OnHostTouchEvent(&press);
+ dispatcher->AsRootWindowHostDelegate()->OnHostTouchEvent(&press);
button_pos.Offset(9, 8);
ui::TouchEvent release(
@@ -557,7 +558,7 @@ TEST_F(FrameMaximizeButtonTest, MaximizeTap) {
button_pos,
kTouchId,
press.time_stamp() + base::TimeDelta::FromMilliseconds(50));
- root_window->AsRootWindowHostDelegate()->OnHostTouchEvent(&release);
+ dispatcher->AsRootWindowHostDelegate()->OnHostTouchEvent(&release);
ui::GestureConfiguration::set_default_radius(touch_default_radius);
}
diff --git a/ash/wm/coordinate_conversion.cc b/ash/wm/coordinate_conversion.cc
index 467a1fc..448bd0f 100644
--- a/ash/wm/coordinate_conversion.cc
+++ b/ash/wm/coordinate_conversion.cc
@@ -7,7 +7,6 @@
#include "ash/display/display_controller.h"
#include "ash/shell.h"
#include "ui/aura/client/screen_position_client.h"
-#include "ui/aura/root_window.h"
#include "ui/gfx/display.h"
#include "ui/gfx/point.h"
#include "ui/gfx/rect.h"
@@ -16,7 +15,7 @@
namespace ash {
namespace wm {
-aura::RootWindow* GetRootWindowAt(const gfx::Point& point) {
+aura::Window* GetRootWindowAt(const gfx::Point& point) {
const gfx::Display& display =
Shell::GetScreen()->GetDisplayNearestPoint(point);
DCHECK(display.is_valid());
@@ -26,7 +25,7 @@ aura::RootWindow* GetRootWindowAt(const gfx::Point& point) {
GetRootWindowForDisplayId(display.id());
}
-aura::RootWindow* GetRootWindowMatching(const gfx::Rect& rect) {
+aura::Window* GetRootWindowMatching(const gfx::Rect& rect) {
const gfx::Display& display = Shell::GetScreen()->GetDisplayMatching(rect);
return Shell::GetInstance()->display_controller()->
GetRootWindowForDisplayId(display.id());
diff --git a/ash/wm/coordinate_conversion.h b/ash/wm/coordinate_conversion.h
index b1ee83c..f5c1af8 100644
--- a/ash/wm/coordinate_conversion.h
+++ b/ash/wm/coordinate_conversion.h
@@ -8,7 +8,6 @@
#include "ash/ash_export.h"
namespace aura {
-class RootWindow;
class Window;
} // namespace gfx
@@ -23,11 +22,11 @@ namespace wm {
// Returns the RootWindow at |point| in the virtual screen coordinates.
// Returns NULL if the root window does not exist at the given
// point.
-ASH_EXPORT aura::RootWindow* GetRootWindowAt(const gfx::Point& point);
+ASH_EXPORT aura::Window* GetRootWindowAt(const gfx::Point& point);
// Returns the RootWindow that shares the most area with |rect| in
// the virtual scren coordinates.
-ASH_EXPORT aura::RootWindow* GetRootWindowMatching(const gfx::Rect& rect);
+ASH_EXPORT aura::Window* GetRootWindowMatching(const gfx::Rect& rect);
// Converts the |point| from a given |window|'s coordinates into the screen
// coordinates.
diff --git a/ash/wm/dock/docked_window_layout_manager.cc b/ash/wm/dock/docked_window_layout_manager.cc
index a81ed97..8b64ffb 100644
--- a/ash/wm/dock/docked_window_layout_manager.cc
+++ b/ash/wm/dock/docked_window_layout_manager.cc
@@ -502,7 +502,7 @@ void DockedWindowLayoutManager::OnDisplayWorkAreaInsetsChanged() {
}
void DockedWindowLayoutManager::OnFullscreenStateChanged(
- bool is_fullscreen, aura::RootWindow* root_window) {
+ bool is_fullscreen, aura::Window* root_window) {
if (dock_container_->GetRootWindow() != root_window)
return;
// Entering fullscreen mode (including immersive) hides docked windows.
@@ -534,7 +534,7 @@ void DockedWindowLayoutManager::OnFullscreenStateChanged(
}
void DockedWindowLayoutManager::OnShelfAlignmentChanged(
- aura::RootWindow* root_window) {
+ aura::Window* root_window) {
if (dock_container_->GetRootWindow() != root_window)
return;
diff --git a/ash/wm/dock/docked_window_layout_manager.h b/ash/wm/dock/docked_window_layout_manager.h
index 29979d7..f380f77 100644
--- a/ash/wm/dock/docked_window_layout_manager.h
+++ b/ash/wm/dock/docked_window_layout_manager.h
@@ -143,8 +143,8 @@ class ASH_EXPORT DockedWindowLayoutManager
// ash::ShellObserver:
virtual void OnDisplayWorkAreaInsetsChanged() OVERRIDE;
virtual void OnFullscreenStateChanged(bool is_fullscreen,
- aura::RootWindow* root_window) OVERRIDE;
- virtual void OnShelfAlignmentChanged(aura::RootWindow* root_window) OVERRIDE;
+ aura::Window* root_window) OVERRIDE;
+ virtual void OnShelfAlignmentChanged(aura::Window* root_window) OVERRIDE;
// wm::WindowStateObserver:
virtual void OnWindowShowTypeChanged(wm::WindowState* window_state,
diff --git a/ash/wm/dock/docked_window_resizer.cc b/ash/wm/dock/docked_window_resizer.cc
index f900818..28d0438 100644
--- a/ash/wm/dock/docked_window_resizer.cc
+++ b/ash/wm/dock/docked_window_resizer.cc
@@ -42,7 +42,7 @@ DockedWindowLayoutManager* GetDockedLayoutManagerAtPoint(
gfx::Display display = ScreenAsh::FindDisplayContainingPoint(point);
if (!display.is_valid())
return NULL;
- aura::RootWindow* root = Shell::GetInstance()->display_controller()->
+ aura::Window* root = Shell::GetInstance()->display_controller()->
GetRootWindowForDisplayId(display.id());
aura::Window* dock_container = Shell::GetContainer(
root, kShellWindowId_DockedContainer);
diff --git a/ash/wm/drag_window_resizer.cc b/ash/wm/drag_window_resizer.cc
index 002853a..4c07b65 100644
--- a/ash/wm/drag_window_resizer.cc
+++ b/ash/wm/drag_window_resizer.cc
@@ -38,7 +38,7 @@ 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::RootWindow* root_window) {
+aura::RootWindow* GetAnotherRootWindow(aura::Window* root_window) {
Shell::RootWindowList root_windows = Shell::GetAllRootWindows();
if (root_windows.size() < 2)
return NULL;
@@ -171,7 +171,7 @@ void DragWindowResizer::UpdateDragWindow(const gfx::Rect& bounds,
return;
// It's available. Show a phantom window on the display if needed.
- aura::RootWindow* another_root =
+ aura::Window* another_root =
GetAnotherRootWindow(GetTarget()->GetRootWindow());
const gfx::Rect root_bounds_in_screen(another_root->GetBoundsInScreen());
const gfx::Rect bounds_in_screen =
diff --git a/ash/wm/drag_window_resizer_unittest.cc b/ash/wm/drag_window_resizer_unittest.cc
index 5be8a78..6bf3d6a 100644
--- a/ash/wm/drag_window_resizer_unittest.cc
+++ b/ash/wm/drag_window_resizer_unittest.cc
@@ -40,7 +40,7 @@ class DragWindowResizerTest : public test::AshTestBase {
AshTestBase::SetUp();
UpdateDisplay(base::StringPrintf("800x%d", kRootHeight));
- aura::RootWindow* root = Shell::GetPrimaryRootWindow();
+ aura::Window* root = Shell::GetPrimaryRootWindow();
gfx::Rect root_bounds(root->bounds());
EXPECT_EQ(kRootHeight, root_bounds.height());
EXPECT_EQ(800, root_bounds.width());
diff --git a/ash/wm/event_client_impl.cc b/ash/wm/event_client_impl.cc
index 03d4dea..fbf5f86 100644
--- a/ash/wm/event_client_impl.cc
+++ b/ash/wm/event_client_impl.cc
@@ -21,7 +21,7 @@ EventClientImpl::~EventClientImpl() {
bool EventClientImpl::CanProcessEventsWithinSubtree(
const aura::Window* window) const {
- const aura::RootWindow* root_window = window ? window->GetRootWindow() : NULL;
+ const aura::Window* root_window = window ? window->GetRootWindow() : NULL;
if (!root_window ||
!Shell::GetInstance()->session_state_delegate()->IsUserSessionBlocked()) {
return true;
diff --git a/ash/wm/gestures/long_press_affordance_handler.cc b/ash/wm/gestures/long_press_affordance_handler.cc
index 9747706..8faa78f 100644
--- a/ash/wm/gestures/long_press_affordance_handler.cc
+++ b/ash/wm/gestures/long_press_affordance_handler.cc
@@ -59,7 +59,7 @@ const SkColor kAffordanceGlowEndColor = SkColorSetARGB(0, 255, 255, 255);
const SkColor kAffordanceArcColor = SkColorSetARGB(80, 0, 0, 0);
const int kAffordanceFrameRateHz = 60;
-views::Widget* CreateAffordanceWidget(aura::RootWindow* root_window) {
+views::Widget* CreateAffordanceWidget(aura::Window* root_window) {
views::Widget* widget = new views::Widget;
views::Widget::InitParams params;
params.type = views::Widget::InitParams::TYPE_WINDOW_FRAMELESS;
@@ -140,7 +140,7 @@ class LongPressAffordanceHandler::LongPressAffordanceView
: public views::View {
public:
LongPressAffordanceView(const gfx::Point& event_location,
- aura::RootWindow* root_window)
+ aura::Window* root_window)
: views::View(),
widget_(CreateAffordanceWidget(root_window)),
current_angle_(kAffordanceAngleStartValue),
@@ -292,7 +292,7 @@ void LongPressAffordanceHandler::ProcessEvent(aura::Window* target,
// LongPressAffordanceHandler, private
void LongPressAffordanceHandler::StartAnimation() {
- aura::RootWindow* root_window = NULL;
+ aura::Window* root_window = NULL;
switch (current_animation_type_) {
case GROW_ANIMATION:
root_window = Shell::GetInstance()->display_controller()->
diff --git a/ash/wm/header_painter.cc b/ash/wm/header_painter.cc
index 99f8515..3f8f2fe 100644
--- a/ash/wm/header_painter.cc
+++ b/ash/wm/header_painter.cc
@@ -22,7 +22,6 @@
#include "third_party/skia/include/core/SkPath.h"
#include "ui/aura/client/aura_constants.h"
#include "ui/aura/env.h"
-#include "ui/aura/root_window.h"
#include "ui/aura/window.h"
#include "ui/base/hit_test.h"
#include "ui/base/layout.h"
@@ -172,7 +171,7 @@ bool IsSoloWindowHeaderCandidate(aura::Window* window) {
// Returns a list of windows in |root_window|| that potentially could have
// a transparent solo-window header.
-std::vector<Window*> GetWindowsForSoloHeaderUpdate(RootWindow* root_window) {
+std::vector<Window*> GetWindowsForSoloHeaderUpdate(Window* root_window) {
std::vector<Window*> windows;
// Avoid memory allocations for typical window counts.
windows.reserve(16);
@@ -274,7 +273,7 @@ void HeaderPainter::SetSoloWindowHeadersEnabled(bool enabled) {
}
// static
-void HeaderPainter::UpdateSoloWindowHeader(RootWindow* root_window) {
+void HeaderPainter::UpdateSoloWindowHeader(Window* root_window) {
// Use a separate function here so callers outside of HeaderPainter don't need
// to know about "ignorable_window".
UpdateSoloWindowInRoot(root_window, NULL /* ignorable_window */);
@@ -690,15 +689,15 @@ bool HeaderPainter::UseSoloWindowHeader() const {
// Don't use transparent headers for panels, pop-ups, etc.
if (!IsSoloWindowHeaderCandidate(window_))
return false;
- aura::RootWindow* root = window_->GetRootWindow();
+ aura::Window* root = window_->GetRootWindow();
// Don't recompute every time, as it would require many window property
// lookups.
return internal::GetRootWindowSettings(root)->solo_window_header;
}
// static
-bool HeaderPainter::UseSoloWindowHeaderInRoot(RootWindow* root_window,
- Window* ignore_window) {
+bool HeaderPainter::UseSoloWindowHeaderInRoot(Window* root_window,
+ Window* ignore_window) {
int visible_window_count = 0;
std::vector<Window*> windows = GetWindowsForSoloHeaderUpdate(root_window);
for (std::vector<Window*>::const_iterator it = windows.begin();
@@ -722,8 +721,8 @@ bool HeaderPainter::UseSoloWindowHeaderInRoot(RootWindow* root_window,
}
// static
-void HeaderPainter::UpdateSoloWindowInRoot(RootWindow* root,
- Window* ignore_window) {
+void HeaderPainter::UpdateSoloWindowInRoot(Window* root,
+ Window* ignore_window) {
#if defined(OS_WIN)
// Non-Ash Windows doesn't do solo-window counting for transparency effects,
// as the desktop background and window frames are managed by the OS.
diff --git a/ash/wm/header_painter.h b/ash/wm/header_painter.h
index 0d6c3d8..bdc5dbf7 100644
--- a/ash/wm/header_painter.h
+++ b/ash/wm/header_painter.h
@@ -16,7 +16,6 @@
#include "ui/gfx/rect.h"
namespace aura {
-class RootWindow;
class Window;
}
namespace gfx {
@@ -69,7 +68,7 @@ class ASH_EXPORT HeaderPainter : public aura::WindowObserver,
// Updates the solo-window transparent header appearance for all windows
// using frame painters in |root_window|.
- static void UpdateSoloWindowHeader(aura::RootWindow* root_window);
+ static void UpdateSoloWindowHeader(aura::Window* root_window);
// Returns the bounds of the client view for a window with |header_height|
// and |window_bounds|. The return value and |window_bounds| are in the
@@ -198,7 +197,7 @@ class ASH_EXPORT HeaderPainter : public aura::WindowObserver,
// Returns true if |root_window| has exactly one visible, normal-type window.
// It ignores |ignore_window| while calculating the number of windows.
// Pass NULL for |ignore_window| to consider all windows.
- static bool UseSoloWindowHeaderInRoot(aura::RootWindow* root_window,
+ static bool UseSoloWindowHeaderInRoot(aura::Window* root_window,
aura::Window* ignore_window);
// Updates the solo-window transparent header appearance for all windows in
@@ -206,7 +205,7 @@ class ASH_EXPORT HeaderPainter : public aura::WindowObserver,
// counting visible windows. This is useful for updates when a window is about
// to be closed or is moving to another root. If the solo window status
// changes it schedules paints as necessary.
- static void UpdateSoloWindowInRoot(aura::RootWindow* root_window,
+ static void UpdateSoloWindowInRoot(aura::Window* root_window,
aura::Window* ignore_window);
// Schedules a paint for the header. Used when transitioning from no header to
diff --git a/ash/wm/header_painter_unittest.cc b/ash/wm/header_painter_unittest.cc
index a6e8515..55f0ff7 100644
--- a/ash/wm/header_painter_unittest.cc
+++ b/ash/wm/header_painter_unittest.cc
@@ -208,7 +208,7 @@ class HeaderPainterTest : public ash::test::AshTestBase {
TEST_F(HeaderPainterTest, CreateAndDeleteSingleWindow) {
// Ensure that creating/deleting a window works well and doesn't cause
// crashes. See crbug.com/155634
- aura::RootWindow* root = Shell::GetTargetRootWindow();
+ aura::Window* root = Shell::GetTargetRootWindow();
scoped_ptr<Widget> widget(CreateTestWidget());
scoped_ptr<HeaderPainter> painter(CreateTestPainter(widget.get()));
diff --git a/ash/wm/lock_state_controller.cc b/ash/wm/lock_state_controller.cc
index 6117224..11b840b 100644
--- a/ash/wm/lock_state_controller.cc
+++ b/ash/wm/lock_state_controller.cc
@@ -27,7 +27,7 @@ namespace ash {
namespace {
aura::Window* GetBackground() {
- aura::RootWindow* root_window = Shell::GetPrimaryRootWindow();
+ aura::Window* root_window = Shell::GetPrimaryRootWindow();
return Shell::GetContainer(root_window,
internal::kShellWindowId_DesktopBackgroundContainer);
}
@@ -156,11 +156,12 @@ LockStateController::LockStateController()
shutdown_after_lock_(false),
animating_lock_(false),
can_cancel_lock_animation_(false) {
- Shell::GetPrimaryRootWindow()->AddRootWindowObserver(this);
+ Shell::GetPrimaryRootWindow()->GetDispatcher()->AddRootWindowObserver(this);
}
LockStateController::~LockStateController() {
- Shell::GetPrimaryRootWindow()->RemoveRootWindowObserver(this);
+ Shell::GetPrimaryRootWindow()->GetDispatcher()->RemoveRootWindowObserver(
+ this);
}
void LockStateController::SetDelegate(LockStateControllerDelegate* delegate) {
diff --git a/ash/wm/lock_state_controller_unittest.cc b/ash/wm/lock_state_controller_unittest.cc
index 001a5f72..425f439 100644
--- a/ash/wm/lock_state_controller_unittest.cc
+++ b/ash/wm/lock_state_controller_unittest.cc
@@ -46,7 +46,7 @@ void CheckCalledCallback(bool* flag) {
}
aura::Window* GetContainer(int container ) {
- aura::RootWindow* root_window = Shell::GetPrimaryRootWindow();
+ aura::Window* root_window = Shell::GetPrimaryRootWindow();
return Shell::GetContainer(root_window, container);
}
diff --git a/ash/wm/mru_window_tracker.cc b/ash/wm/mru_window_tracker.cc
index 8ff631b..5974aad 100644
--- a/ash/wm/mru_window_tracker.cc
+++ b/ash/wm/mru_window_tracker.cc
@@ -23,9 +23,9 @@ namespace {
// Adds the windows that can be cycled through for the specified window id to
// |windows|.
-void AddTrackedWindows(aura::RootWindow* root,
- int container_id,
- MruWindowTracker::WindowList* windows) {
+void AddTrackedWindows(aura::Window* root,
+ int container_id,
+ MruWindowTracker::WindowList* windows) {
aura::Window* container = Shell::GetContainer(root, container_id);
const MruWindowTracker::WindowList& children(container->children());
windows->insert(windows->end(), children.begin(), children.end());
@@ -59,7 +59,7 @@ MruWindowTracker::WindowList BuildWindowListInternal(
MruWindowTracker::WindowList windows;
Shell::RootWindowList root_windows = Shell::GetAllRootWindows();
- aura::RootWindow* active_root = Shell::GetTargetRootWindow();
+ aura::Window* active_root = Shell::GetTargetRootWindow();
for (Shell::RootWindowList::const_iterator iter = root_windows.begin();
iter != root_windows.end(); ++iter) {
if (*iter == active_root)
diff --git a/ash/wm/overview/scoped_transform_overview_window.cc b/ash/wm/overview/scoped_transform_overview_window.cc
index 9c6eefd..a9322c0 100644
--- a/ash/wm/overview/scoped_transform_overview_window.cc
+++ b/ash/wm/overview/scoped_transform_overview_window.cc
@@ -9,7 +9,7 @@
#include "ash/wm/overview/scoped_window_copy.h"
#include "ash/wm/window_state.h"
#include "ui/aura/client/aura_constants.h"
-#include "ui/aura/root_window.h"
+#include "ui/aura/client/screen_position_client.h"
#include "ui/aura/window.h"
#include "ui/compositor/scoped_layer_animation_settings.h"
#include "ui/views/corewm/window_animations.h"
@@ -187,7 +187,7 @@ gfx::Transform ScopedTransformOverviewWindow::GetTransformForRect(
}
void ScopedTransformOverviewWindow::SetTransform(
- aura::RootWindow* root_window,
+ aura::Window* root_window,
const gfx::Transform& transform,
bool animate) {
DCHECK(overview_started_);
diff --git a/ash/wm/overview/scoped_transform_overview_window.h b/ash/wm/overview/scoped_transform_overview_window.h
index c41a225..0ff00de 100644
--- a/ash/wm/overview/scoped_transform_overview_window.h
+++ b/ash/wm/overview/scoped_transform_overview_window.h
@@ -11,7 +11,6 @@
#include "ui/gfx/transform.h"
namespace aura {
-class RootWindow;
class Window;
}
@@ -74,7 +73,7 @@ class ScopedTransformOverviewWindow {
// Sets |transform| on the window and a copy of the window if the target
// |root_window| is not the window's root window. If |animate| the transform
// is animated in, otherwise it is immediately applied.
- void SetTransform(aura::RootWindow* root_window,
+ void SetTransform(aura::Window* root_window,
const gfx::Transform& transform,
bool animate);
diff --git a/ash/wm/overview/scoped_window_copy.cc b/ash/wm/overview/scoped_window_copy.cc
index 149a82b..660b284 100644
--- a/ash/wm/overview/scoped_window_copy.cc
+++ b/ash/wm/overview/scoped_window_copy.cc
@@ -21,7 +21,7 @@ namespace ash {
namespace {
// Creates a copy of |window| with |recreated_layer| in the |target_root|.
-views::Widget* CreateCopyOfWindow(aura::RootWindow* target_root,
+views::Widget* CreateCopyOfWindow(aura::Window* target_root,
aura::Window* src_window,
ui::Layer* recreated_layer) {
// Save and remove the transform from the layer to later reapply to both the
@@ -158,7 +158,7 @@ void CleanupWidgetAfterAnimationObserver::MaybeDestruct() {
delete this;
}
-ScopedWindowCopy::ScopedWindowCopy(aura::RootWindow* target_root,
+ScopedWindowCopy::ScopedWindowCopy(aura::Window* target_root,
aura::Window* src_window) {
layer_ = views::corewm::RecreateWindowLayers(src_window, true);
widget_ = CreateCopyOfWindow(target_root, src_window, layer_);
diff --git a/ash/wm/overview/scoped_window_copy.h b/ash/wm/overview/scoped_window_copy.h
index bd7fc45..d5da445 100644
--- a/ash/wm/overview/scoped_window_copy.h
+++ b/ash/wm/overview/scoped_window_copy.h
@@ -28,7 +28,7 @@ class CleanupWidgetAfterAnimationObserver;
// the class goes out of scope and the last animation has finished.
class ScopedWindowCopy {
public:
- ScopedWindowCopy(aura::RootWindow* target_root, aura::Window* src_window);
+ ScopedWindowCopy(aura::Window* target_root, aura::Window* src_window);
~ScopedWindowCopy();
aura::Window* GetWindow();
diff --git a/ash/wm/overview/window_overview.cc b/ash/wm/overview/window_overview.cc
index 90a3639..a7de2f8 100644
--- a/ash/wm/overview/window_overview.cc
+++ b/ash/wm/overview/window_overview.cc
@@ -117,7 +117,7 @@ void CleanupWidgetAfterAnimationObserver::OnLayerAnimationScheduled(
WindowOverview::WindowOverview(WindowSelector* window_selector,
WindowSelectorItemList* windows,
- aura::RootWindow* single_root_window)
+ aura::Window* single_root_window)
: window_selector_(window_selector),
windows_(windows),
selection_index_(0),
@@ -239,7 +239,7 @@ void WindowOverview::OnWindowsChanged() {
PositionWindows();
}
-void WindowOverview::MoveToSingleRootWindow(aura::RootWindow* root_window) {
+void WindowOverview::MoveToSingleRootWindow(aura::Window* root_window) {
single_root_window_ = root_window;
PositionWindows();
}
@@ -348,7 +348,7 @@ void WindowOverview::PositionWindows() {
}
}
-void WindowOverview::PositionWindowsFromRoot(aura::RootWindow* root_window) {
+void WindowOverview::PositionWindowsFromRoot(aura::Window* root_window) {
std::vector<WindowSelectorItem*> windows;
for (WindowSelectorItemList::iterator iter = windows_->begin();
iter != windows_->end(); ++iter) {
@@ -359,7 +359,7 @@ void WindowOverview::PositionWindowsFromRoot(aura::RootWindow* root_window) {
}
void WindowOverview::PositionWindowsOnRoot(
- aura::RootWindow* root_window,
+ aura::Window* root_window,
const std::vector<WindowSelectorItem*>& windows) {
if (windows.empty())
return;
diff --git a/ash/wm/overview/window_overview.h b/ash/wm/overview/window_overview.h
index fed1bc9..3f21dac 100644
--- a/ash/wm/overview/window_overview.h
+++ b/ash/wm/overview/window_overview.h
@@ -14,14 +14,10 @@
#include "ui/gfx/rect.h"
namespace aura {
-
class Window;
-class RootWindow;
-
namespace client {
class CursorClient;
}
-
} // namespace aura
namespace ui {
@@ -50,7 +46,7 @@ class WindowOverview : public ui::EventHandler {
// given root window.
WindowOverview(WindowSelector* window_selector,
WindowSelectorItemList* windows,
- aura::RootWindow* single_root_window);
+ aura::Window* single_root_window);
virtual ~WindowOverview();
// Sets the selected window to be the window in position |index|.
@@ -60,7 +56,7 @@ class WindowOverview : public ui::EventHandler {
void OnWindowsChanged();
// Moves the overview to only |root_window|.
- void MoveToSingleRootWindow(aura::RootWindow* root_window);
+ void MoveToSingleRootWindow(aura::Window* root_window);
// ui::EventHandler:
virtual void OnKeyEvent(ui::KeyEvent* event) OVERRIDE;
@@ -82,9 +78,9 @@ class WindowOverview : public ui::EventHandler {
// Position all of the windows based on the current selection mode.
void PositionWindows();
// Position all of the windows from |root_window| on |root_window|.
- void PositionWindowsFromRoot(aura::RootWindow* root_window);
+ void PositionWindowsFromRoot(aura::Window* root_window);
// Position all of the |windows| to fit on the |root_window|.
- void PositionWindowsOnRoot(aura::RootWindow* root_window,
+ void PositionWindowsOnRoot(aura::Window* root_window,
const std::vector<WindowSelectorItem*>& windows);
// Creates the selection widget.
@@ -111,7 +107,7 @@ class WindowOverview : public ui::EventHandler {
// If NULL, each root window displays an overview of the windows in that
// display. Otherwise, all windows are in a single overview on
// |single_root_window_|.
- aura::RootWindow* single_root_window_;
+ aura::Window* single_root_window_;
// The time when overview was started.
base::Time overview_start_time_;
diff --git a/ash/wm/overview/window_selector.cc b/ash/wm/overview/window_selector.cc
index e23f5b3..a7c4ce7 100644
--- a/ash/wm/overview/window_selector.cc
+++ b/ash/wm/overview/window_selector.cc
@@ -73,7 +73,7 @@ struct WindowSelectorItemComparator
// A comparator for locating a selector item for a given root.
struct WindowSelectorItemForRoot
: public std::unary_function<WindowSelectorItem*, bool> {
- explicit WindowSelectorItemForRoot(const aura::RootWindow* root)
+ explicit WindowSelectorItemForRoot(const aura::Window* root)
: root_window(root) {
}
@@ -81,7 +81,7 @@ struct WindowSelectorItemForRoot
return item->GetRootWindow() == root_window;
}
- const aura::RootWindow* root_window;
+ const aura::Window* root_window;
};
// Filter to watch for the termination of a keyboard gesture to cycle through
diff --git a/ash/wm/overview/window_selector_item.cc b/ash/wm/overview/window_selector_item.cc
index 6dacf76..a2c25b6 100644
--- a/ash/wm/overview/window_selector_item.cc
+++ b/ash/wm/overview/window_selector_item.cc
@@ -16,7 +16,7 @@ WindowSelectorItem::WindowSelectorItem()
WindowSelectorItem::~WindowSelectorItem() {
}
-void WindowSelectorItem::SetBounds(aura::RootWindow* root_window,
+void WindowSelectorItem::SetBounds(aura::Window* root_window,
const gfx::Rect& target_bounds) {
if (in_bounds_update_)
return;
diff --git a/ash/wm/overview/window_selector_item.h b/ash/wm/overview/window_selector_item.h
index 36cebc2d..4b0ef01 100644
--- a/ash/wm/overview/window_selector_item.h
+++ b/ash/wm/overview/window_selector_item.h
@@ -9,7 +9,6 @@
#include "ui/gfx/rect.h"
namespace aura {
-class RootWindow;
class Window;
}
@@ -24,7 +23,7 @@ class WindowSelectorItem {
virtual ~WindowSelectorItem();
// Returns the root window on which this item is shown.
- virtual aura::RootWindow* GetRootWindow() = 0;
+ virtual aura::Window* GetRootWindow() = 0;
// Returns the targeted window given the event |target| window.
// Returns NULL if no Window in this item was selected.
@@ -51,7 +50,7 @@ class WindowSelectorItem {
// Sets the bounds of this window selector item to |target_bounds| in the
// |root_window| root window.
- void SetBounds(aura::RootWindow* root_window,
+ void SetBounds(aura::Window* root_window,
const gfx::Rect& target_bounds);
// Recomputes the positions for the windows in this selection item. This is
@@ -64,7 +63,7 @@ class WindowSelectorItem {
protected:
// Sets the bounds of this selector item to |target_bounds| in |root_window|.
// If |animate| the windows are animated from their current location.
- virtual void SetItemBounds(aura::RootWindow* root_window,
+ virtual void SetItemBounds(aura::Window* root_window,
const gfx::Rect& target_bounds,
bool animate) = 0;
@@ -73,7 +72,7 @@ class WindowSelectorItem {
private:
// The root window this item is being displayed on.
- aura::RootWindow* root_window_;
+ aura::Window* root_window_;
// The target bounds this selector item is fit within.
gfx::Rect target_bounds_;
diff --git a/ash/wm/overview/window_selector_panels.cc b/ash/wm/overview/window_selector_panels.cc
index ad2735d..70f9028 100644
--- a/ash/wm/overview/window_selector_panels.cc
+++ b/ash/wm/overview/window_selector_panels.cc
@@ -97,7 +97,7 @@ void WindowSelectorPanels::AddWindow(aura::Window* window) {
transform_windows_.push_back(new ScopedTransformPanelWindow(window));
}
-aura::RootWindow* WindowSelectorPanels::GetRootWindow() {
+aura::Window* WindowSelectorPanels::GetRootWindow() {
return transform_windows_.front()->window()->GetRootWindow();
}
@@ -146,7 +146,7 @@ void WindowSelectorPanels::PrepareForOverview() {
}
}
-void WindowSelectorPanels::SetItemBounds(aura::RootWindow* root_window,
+void WindowSelectorPanels::SetItemBounds(aura::Window* root_window,
const gfx::Rect& target_bounds,
bool animate) {
gfx::Rect bounding_rect;
diff --git a/ash/wm/overview/window_selector_panels.h b/ash/wm/overview/window_selector_panels.h
index 785c6dc..bcc9137 100644
--- a/ash/wm/overview/window_selector_panels.h
+++ b/ash/wm/overview/window_selector_panels.h
@@ -10,11 +10,6 @@
#include "base/memory/scoped_vector.h"
#include "ui/gfx/rect.h"
-namespace aura {
-class RootWindow;
-class Window;
-}
-
namespace ash {
class ScopedTransformOverviewWindow;
@@ -32,14 +27,14 @@ class WindowSelectorPanels : public WindowSelectorItem {
void AddWindow(aura::Window* window);
// WindowSelectorItem:
- virtual aura::RootWindow* GetRootWindow() OVERRIDE;
+ virtual aura::Window* GetRootWindow() OVERRIDE;
virtual aura::Window* TargetedWindow(const aura::Window* target) OVERRIDE;
virtual void RestoreWindowOnExit(aura::Window* window) OVERRIDE;
virtual aura::Window* SelectionWindow() OVERRIDE;
virtual void RemoveWindow(const aura::Window* window) OVERRIDE;
virtual bool empty() const OVERRIDE;
virtual void PrepareForOverview() OVERRIDE;
- virtual void SetItemBounds(aura::RootWindow* root_window,
+ virtual void SetItemBounds(aura::Window* root_window,
const gfx::Rect& target_bounds,
bool animate) OVERRIDE;
diff --git a/ash/wm/overview/window_selector_unittest.cc b/ash/wm/overview/window_selector_unittest.cc
index ec7e9e2..eff4ace 100644
--- a/ash/wm/overview/window_selector_unittest.cc
+++ b/ash/wm/overview/window_selector_unittest.cc
@@ -184,7 +184,7 @@ class WindowSelectorTest : public test::AshTestBase {
// Tests entering overview mode with two windows and selecting one.
TEST_F(WindowSelectorTest, Basic) {
gfx::Rect bounds(0, 0, 400, 400);
- aura::RootWindow* root_window = Shell::GetPrimaryRootWindow();
+ aura::Window* root_window = Shell::GetPrimaryRootWindow();
scoped_ptr<aura::Window> window1(CreateWindow(bounds));
scoped_ptr<aura::Window> window2(CreateWindow(bounds));
scoped_ptr<aura::Window> panel1(CreatePanelWindow(bounds));
@@ -196,7 +196,7 @@ TEST_F(WindowSelectorTest, Basic) {
EXPECT_TRUE(wm::IsActiveWindow(window2.get()));
EXPECT_EQ(window2.get(), GetFocusedWindow());
// Hide the cursor before entering overview to test that it will be shown.
- GetCursorClient(root_window)->HideCursor();
+ aura::client::GetCursorClient(root_window)->HideCursor();
// In overview mode the windows should no longer overlap and focus should
// be removed from the window.
@@ -209,9 +209,10 @@ TEST_F(WindowSelectorTest, Basic) {
EXPECT_TRUE(WindowsOverlapping(panel1.get(), panel2.get()));
// The cursor should be visible and locked as a pointer
- EXPECT_EQ(ui::kCursorPointer, root_window->last_cursor().native_type());
- EXPECT_TRUE(GetCursorClient(root_window)->IsCursorLocked());
- EXPECT_TRUE(GetCursorClient(root_window)->IsCursorVisible());
+ EXPECT_EQ(ui::kCursorPointer,
+ root_window->GetDispatcher()->last_cursor().native_type());
+ EXPECT_TRUE(aura::client::GetCursorClient(root_window)->IsCursorLocked());
+ EXPECT_TRUE(aura::client::GetCursorClient(root_window)->IsCursorVisible());
// Clicking window 1 should activate it.
ClickWindow(window1.get());
@@ -220,7 +221,7 @@ TEST_F(WindowSelectorTest, Basic) {
EXPECT_EQ(window1.get(), GetFocusedWindow());
// Cursor should have been unlocked.
- EXPECT_FALSE(GetCursorClient(root_window)->IsCursorLocked());
+ EXPECT_FALSE(aura::client::GetCursorClient(root_window)->IsCursorLocked());
}
// Tests that the shelf dimming state is removed while in overview and restored
diff --git a/ash/wm/overview/window_selector_window.cc b/ash/wm/overview/window_selector_window.cc
index 3f090b3..7c3e36c 100644
--- a/ash/wm/overview/window_selector_window.cc
+++ b/ash/wm/overview/window_selector_window.cc
@@ -15,7 +15,7 @@ WindowSelectorWindow::WindowSelectorWindow(aura::Window* window)
WindowSelectorWindow::~WindowSelectorWindow() {
}
-aura::RootWindow* WindowSelectorWindow::GetRootWindow() {
+aura::Window* WindowSelectorWindow::GetRootWindow() {
return transform_window_.window()->GetRootWindow();
}
@@ -46,7 +46,7 @@ void WindowSelectorWindow::PrepareForOverview() {
transform_window_.PrepareForOverview();
}
-void WindowSelectorWindow::SetItemBounds(aura::RootWindow* root_window,
+void WindowSelectorWindow::SetItemBounds(aura::Window* root_window,
const gfx::Rect& target_bounds,
bool animate) {
gfx::Rect src_rect = transform_window_.GetBoundsInScreen();
diff --git a/ash/wm/overview/window_selector_window.h b/ash/wm/overview/window_selector_window.h
index ef912eb..fb49a58 100644
--- a/ash/wm/overview/window_selector_window.h
+++ b/ash/wm/overview/window_selector_window.h
@@ -11,7 +11,6 @@
#include "ui/gfx/rect.h"
namespace aura {
-class RootWindow;
class Window;
}
@@ -25,14 +24,14 @@ class WindowSelectorWindow : public WindowSelectorItem {
virtual ~WindowSelectorWindow();
// WindowSelectorItem:
- virtual aura::RootWindow* GetRootWindow() OVERRIDE;
+ virtual aura::Window* GetRootWindow() OVERRIDE;
virtual aura::Window* TargetedWindow(const aura::Window* target) OVERRIDE;
virtual void RestoreWindowOnExit(aura::Window* window) OVERRIDE;
virtual aura::Window* SelectionWindow() OVERRIDE;
virtual void RemoveWindow(const aura::Window* window) OVERRIDE;
virtual bool empty() const OVERRIDE;
virtual void PrepareForOverview() OVERRIDE;
- virtual void SetItemBounds(aura::RootWindow* root_window,
+ virtual void SetItemBounds(aura::Window* root_window,
const gfx::Rect& target_bounds,
bool animate) OVERRIDE;
diff --git a/ash/wm/panels/panel_layout_manager.cc b/ash/wm/panels/panel_layout_manager.cc
index 56d8e5a..fc2f4bb9 100644
--- a/ash/wm/panels/panel_layout_manager.cc
+++ b/ash/wm/panels/panel_layout_manager.cc
@@ -450,8 +450,7 @@ void PanelLayoutManager::OnLauncherIconPositionsChanged() {
////////////////////////////////////////////////////////////////////////////////
// PanelLayoutManager, ash::ShellObserver implementation:
-void PanelLayoutManager::OnShelfAlignmentChanged(
- aura::RootWindow* root_window) {
+void PanelLayoutManager::OnShelfAlignmentChanged(aura::Window* root_window) {
if (panel_container_->GetRootWindow() == root_window)
Relayout();
}
diff --git a/ash/wm/panels/panel_layout_manager.h b/ash/wm/panels/panel_layout_manager.h
index 27ec0cd..5b247eb 100644
--- a/ash/wm/panels/panel_layout_manager.h
+++ b/ash/wm/panels/panel_layout_manager.h
@@ -93,7 +93,7 @@ class ASH_EXPORT PanelLayoutManager
virtual void OnLauncherIconPositionsChanged() OVERRIDE;
// Overridden from ash::ShellObserver
- virtual void OnShelfAlignmentChanged(aura::RootWindow* root_window) OVERRIDE;
+ virtual void OnShelfAlignmentChanged(aura::Window* root_window) OVERRIDE;
// Overridden from ash::wm::WindowStateObserver
virtual void OnWindowShowTypeChanged(wm::WindowState* window_state,
diff --git a/ash/wm/panels/panel_layout_manager_unittest.cc b/ash/wm/panels/panel_layout_manager_unittest.cc
index 7c61f73..e387138 100644
--- a/ash/wm/panels/panel_layout_manager_unittest.cc
+++ b/ash/wm/panels/panel_layout_manager_unittest.cc
@@ -236,12 +236,12 @@ class PanelLayoutManagerTest : public test::AshTestBase {
test_api.RunMessageLoopUntilAnimationsDone();
}
- void SetAlignment(aura::RootWindow* root_window, ShelfAlignment alignment) {
+ void SetAlignment(aura::Window* root_window, ShelfAlignment alignment) {
ash::Shell* shell = ash::Shell::GetInstance();
shell->SetShelfAlignment(alignment, root_window);
}
- ShelfAlignment GetAlignment(aura::RootWindow* root_window) {
+ ShelfAlignment GetAlignment(aura::Window* root_window) {
ash::Shell* shell = ash::Shell::GetInstance();
return shell->GetShelfAlignment(root_window);
}
diff --git a/ash/wm/panels/panel_window_resizer.cc b/ash/wm/panels/panel_window_resizer.cc
index 49b356c..d8b4b26 100644
--- a/ash/wm/panels/panel_window_resizer.cc
+++ b/ash/wm/panels/panel_window_resizer.cc
@@ -77,7 +77,7 @@ void PanelWindowResizer::Drag(const gfx::Point& location, int event_flags) {
// complete it would begin positioning the panel.
if (GetTarget()->parent() != panel_container_)
GetPanelLayoutManager(panel_container_)->FinishDragging();
- aura::RootWindow* dst_root = Shell::GetInstance()->display_controller()->
+ aura::Window* dst_root = Shell::GetInstance()->display_controller()->
GetRootWindowForDisplayId(dst_display.id());
panel_container_ = Shell::GetContainer(
dst_root, internal::kShellWindowId_PanelContainer);
@@ -197,7 +197,7 @@ void PanelWindowResizer::StartedDragging() {
// We use root window coordinates to ensure that during the drag the panel
// is reparented to a container in the root window that has that window.
aura::Window* target = GetTarget();
- aura::RootWindow* target_root = target->GetRootWindow();
+ aura::Window* target_root = target->GetRootWindow();
aura::client::ParentWindowWithContext(
target, target_root, target_root->GetBoundsInScreen());
wm::ReparentTransientChildrenOfChild(target->parent(), target);
@@ -212,7 +212,7 @@ void PanelWindowResizer::FinishDragging() {
// We use last known location to ensure that after the drag the panel
// is reparented to a container in the root window that has that location.
aura::Window* target = GetTarget();
- aura::RootWindow* target_root = target->GetRootWindow();
+ aura::Window* target_root = target->GetRootWindow();
aura::client::ParentWindowWithContext(
target, target_root, gfx::Rect(last_location_, gfx::Size()));
wm::ReparentTransientChildrenOfChild(target->parent(), GetTarget());
diff --git a/ash/wm/panels/panel_window_resizer_unittest.cc b/ash/wm/panels/panel_window_resizer_unittest.cc
index 8cdec83..e5c4157 100644
--- a/ash/wm/panels/panel_window_resizer_unittest.cc
+++ b/ash/wm/panels/panel_window_resizer_unittest.cc
@@ -102,7 +102,7 @@ class PanelWindowResizerTest : public test::AshTestBase {
void DetachReattachTest(aura::Window* window, int dx, int dy) {
wm::WindowState* window_state = wm::GetWindowState(window);
EXPECT_TRUE(window_state->panel_attached());
- aura::RootWindow* root_window = window->GetRootWindow();
+ aura::Window* root_window = window->GetRootWindow();
EXPECT_EQ(internal::kShellWindowId_PanelContainer, window->parent()->id());
DragStart(window);
gfx::Rect initial_bounds = window->GetBoundsInScreen();
diff --git a/ash/wm/partial_screenshot_view.cc b/ash/wm/partial_screenshot_view.cc
index e3f5528..66a4259 100644
--- a/ash/wm/partial_screenshot_view.cc
+++ b/ash/wm/partial_screenshot_view.cc
@@ -163,7 +163,7 @@ void PartialScreenshotView::OnSelectionFinished() {
is_dragging_ = false;
if (screenshot_delegate_) {
- aura::RootWindow *root_window =
+ aura::Window*root_window =
GetWidget()->GetNativeWindow()->GetRootWindow();
screenshot_delegate_->HandleTakePartialScreenshot(
root_window,
diff --git a/ash/wm/screen_dimmer_unittest.cc b/ash/wm/screen_dimmer_unittest.cc
index 5b74e0f..a87c71b 100644
--- a/ash/wm/screen_dimmer_unittest.cc
+++ b/ash/wm/screen_dimmer_unittest.cc
@@ -71,7 +71,7 @@ TEST_F(ScreenDimmerTest, ResizeLayer) {
// When we resize the root window, the dimming layer should be resized to
// match.
gfx::Size kNewSize(400, 300);
- Shell::GetPrimaryRootWindow()->SetHostSize(kNewSize);
+ Shell::GetPrimaryRootWindow()->GetDispatcher()->SetHostSize(kNewSize);
EXPECT_EQ(kNewSize.ToString(), dimming_layer->bounds().size().ToString());
}
diff --git a/ash/wm/session_state_animator.cc b/ash/wm/session_state_animator.cc
index 81e3fcc..38091bf 100644
--- a/ash/wm/session_state_animator.cc
+++ b/ash/wm/session_state_animator.cc
@@ -403,7 +403,7 @@ bool SessionStateAnimator::TestApi::ContainersAreAnimated(
bool SessionStateAnimator::TestApi::RootWindowIsAnimated(AnimationType type)
const {
- aura::RootWindow* root_window = Shell::GetPrimaryRootWindow();
+ aura::Window* root_window = Shell::GetPrimaryRootWindow();
ui::Layer* layer = root_window->layer();
return IsLayerAnimated(layer, type);
}
@@ -455,7 +455,7 @@ base::TimeDelta SessionStateAnimator::GetDuration(AnimationSpeed speed) {
// Fills |containers| with the containers described by |container_mask|.
void SessionStateAnimator::GetContainers(int container_mask,
aura::Window::Windows* containers) {
- aura::RootWindow* root_window = Shell::GetPrimaryRootWindow();
+ aura::Window* root_window = Shell::GetPrimaryRootWindow();
containers->clear();
if (container_mask & DESKTOP_BACKGROUND) {
@@ -542,7 +542,7 @@ void SessionStateAnimator::StartAnimationWithObserver(
void SessionStateAnimator::StartGlobalAnimation(AnimationType type,
AnimationSpeed speed) {
- aura::RootWindow* root_window = Shell::GetPrimaryRootWindow();
+ aura::Window* root_window = Shell::GetPrimaryRootWindow();
RunAnimationForWindow(root_window, type, speed, NULL);
}
diff --git a/ash/wm/stacking_controller.cc b/ash/wm/stacking_controller.cc
index 7b211a3..bd4a654 100644
--- a/ash/wm/stacking_controller.cc
+++ b/ash/wm/stacking_controller.cc
@@ -23,13 +23,13 @@ namespace {
// coordinates is enabled and the bounds is specified, the root window
// that matches the window's bound will be used. Otherwise, it'll
// return the active root window.
-aura::RootWindow* FindContainerRoot(const gfx::Rect& bounds) {
+aura::Window* FindContainerRoot(const gfx::Rect& bounds) {
if (bounds.x() == 0 && bounds.y() == 0 && bounds.IsEmpty())
return Shell::GetTargetRootWindow();
return wm::GetRootWindowMatching(bounds);
}
-aura::Window* GetContainerById(aura::RootWindow* root, int id) {
+aura::Window* GetContainerById(aura::Window* root, int id) {
return Shell::GetContainer(root, id);
}
@@ -50,7 +50,7 @@ bool HasTransientParentWindow(aura::Window* window) {
}
internal::AlwaysOnTopController*
-GetAlwaysOnTopController(aura::RootWindow* root_window) {
+GetAlwaysOnTopController(aura::Window* root_window) {
return internal::GetRootWindowController(root_window)->
always_on_top_controller();
}
@@ -72,7 +72,7 @@ StackingController::~StackingController() {
aura::Window* StackingController::GetDefaultParent(aura::Window* context,
aura::Window* window,
const gfx::Rect& bounds) {
- aura::RootWindow* target_root = NULL;
+ aura::Window* target_root = NULL;
if (window->transient_parent()) {
// Transient window should use the same root as its transient parent.
target_root = window->transient_parent()->GetRootWindow();
@@ -115,7 +115,7 @@ aura::Window* StackingController::GetDefaultParent(aura::Window* context,
// StackingController, private:
aura::Window* StackingController::GetSystemModalContainer(
- aura::RootWindow* root,
+ aura::Window* root,
aura::Window* window) const {
DCHECK(IsSystemModal(window));
diff --git a/ash/wm/stacking_controller.h b/ash/wm/stacking_controller.h
index 0aa690e..bbe715e 100644
--- a/ash/wm/stacking_controller.h
+++ b/ash/wm/stacking_controller.h
@@ -11,12 +11,7 @@
#include "base/memory/scoped_ptr.h"
#include "ui/aura/client/window_tree_client.h"
-namespace aura{
-class RootWindow;
-}
-
namespace ash {
-
namespace internal {
class AlwaysOnTopController;
}
@@ -37,7 +32,7 @@ class ASH_EXPORT StackingController : public aura::client::WindowTreeClient {
// normal modal container.
// Otherwise those that originate from LockScreen container and above are
// placed in the screen lock modal container.
- aura::Window* GetSystemModalContainer(aura::RootWindow* root,
+ aura::Window* GetSystemModalContainer(aura::Window* root,
aura::Window* window) const;
DISALLOW_COPY_AND_ASSIGN(StackingController);
diff --git a/ash/wm/sticky_keys.cc b/ash/wm/sticky_keys.cc
index dce3a4e..b4e1cfd 100644
--- a/ash/wm/sticky_keys.cc
+++ b/ash/wm/sticky_keys.cc
@@ -40,7 +40,7 @@ StickyKeysHandlerDelegateImpl::~StickyKeysHandlerDelegateImpl() {
void StickyKeysHandlerDelegateImpl::DispatchKeyEvent(ui::KeyEvent* event,
aura::Window* target) {
DCHECK(target);
- target->GetRootWindow()->AsRootWindowHostDelegate()->OnHostKeyEvent(event);
+ target->GetDispatcher()->AsRootWindowHostDelegate()->OnHostKeyEvent(event);
}
} // namespace
diff --git a/ash/wm/system_gesture_event_filter_unittest.cc b/ash/wm/system_gesture_event_filter_unittest.cc
index 3712c0a..d4edc82 100644
--- a/ash/wm/system_gesture_event_filter_unittest.cc
+++ b/ash/wm/system_gesture_event_filter_unittest.cc
@@ -243,7 +243,8 @@ void MoveToDeviceControlBezelStartPosition(
gfx::Point(-10, ypos + ypos_half),
touch_id,
ui::EventTimeForNow());
- root_window->AsRootWindowHostDelegate()->OnHostTouchEvent(&press1);
+ root_window->GetDispatcher()->AsRootWindowHostDelegate()->OnHostTouchEvent(
+ &press1);
// There is a noise filter which will require several calls before it
// allows the touch event through.
@@ -285,7 +286,7 @@ void MoveToDeviceControlBezelStartPosition(
}
TEST_P(SystemGestureEventFilterTest, LongPressAffordanceStateOnCaptureLoss) {
- aura::RootWindow* root_window = Shell::GetPrimaryRootWindow();
+ aura::Window* root_window = Shell::GetPrimaryRootWindow();
aura::test::TestWindowDelegate delegate;
scoped_ptr<aura::Window> window0(
@@ -309,7 +310,8 @@ TEST_P(SystemGestureEventFilterTest, LongPressAffordanceStateOnCaptureLoss) {
gfx::Point(10, 10),
kTouchId,
ui::EventTimeForNow());
- root_window->AsRootWindowHostDelegate()->OnHostTouchEvent(&press);
+ root_window->GetDispatcher()->AsRootWindowHostDelegate()->OnHostTouchEvent(
+ &press);
EXPECT_TRUE(window1->HasCapture());
base::OneShotTimer<internal::LongPressAffordanceHandler>* timer =
@@ -344,7 +346,7 @@ TEST_P(SystemGestureEventFilterTest, LongPressAffordanceStateOnCaptureLoss) {
}
TEST_P(SystemGestureEventFilterTest, MultiFingerSwipeGestures) {
- aura::RootWindow* root_window = Shell::GetPrimaryRootWindow();
+ aura::Window* root_window = Shell::GetPrimaryRootWindow();
views::Widget* toplevel = views::Widget::CreateWindowWithContextAndBounds(
new ResizableWidgetDelegate, root_window, gfx::Rect(0, 0, 600, 600));
toplevel->Show();
@@ -403,7 +405,7 @@ TEST_P(SystemGestureEventFilterTest, MultiFingerSwipeGestures) {
TEST_P(SystemGestureEventFilterTest, TwoFingerDrag) {
gfx::Rect bounds(0, 0, 600, 600);
- aura::RootWindow* root_window = Shell::GetPrimaryRootWindow();
+ aura::Window* root_window = Shell::GetPrimaryRootWindow();
views::Widget* toplevel = views::Widget::CreateWindowWithContextAndBounds(
new ResizableWidgetDelegate, root_window, bounds);
toplevel->Show();
@@ -460,7 +462,7 @@ TEST_P(SystemGestureEventFilterTest, TwoFingerDrag) {
}
TEST_P(SystemGestureEventFilterTest, TwoFingerDragTwoWindows) {
- aura::RootWindow* root_window = Shell::GetPrimaryRootWindow();
+ aura::Window* root_window = Shell::GetPrimaryRootWindow();
ui::GestureConfiguration::set_max_separation_for_gesture_touches_in_pixels(0);
views::Widget* first = views::Widget::CreateWindowWithContextAndBounds(
new ResizableWidgetDelegate, root_window, gfx::Rect(0, 0, 50, 100));
@@ -495,7 +497,7 @@ TEST_P(SystemGestureEventFilterTest, TwoFingerDragTwoWindows) {
TEST_P(SystemGestureEventFilterTest, WindowsWithMaxSizeDontSnap) {
gfx::Rect bounds(150, 150, 100, 100);
- aura::RootWindow* root_window = Shell::GetPrimaryRootWindow();
+ aura::Window* root_window = Shell::GetPrimaryRootWindow();
views::Widget* toplevel = views::Widget::CreateWindowWithContextAndBounds(
new MaxSizeWidgetDelegate, root_window, bounds);
toplevel->Show();
@@ -554,7 +556,7 @@ TEST_P(SystemGestureEventFilterTest, WindowsWithMaxSizeDontSnap) {
TEST_P(SystemGestureEventFilterTest, TwoFingerDragEdge) {
gfx::Rect bounds(0, 0, 100, 100);
- aura::RootWindow* root_window = Shell::GetPrimaryRootWindow();
+ aura::Window* root_window = Shell::GetPrimaryRootWindow();
views::Widget* toplevel = views::Widget::CreateWindowWithContextAndBounds(
new ResizableWidgetDelegate, root_window, bounds);
toplevel->Show();
@@ -581,7 +583,7 @@ TEST_P(SystemGestureEventFilterTest, TwoFingerDragEdge) {
TEST_P(SystemGestureEventFilterTest, TwoFingerDragDelayed) {
gfx::Rect bounds(0, 0, 100, 100);
- aura::RootWindow* root_window = Shell::GetPrimaryRootWindow();
+ aura::Window* root_window = Shell::GetPrimaryRootWindow();
views::Widget* toplevel = views::Widget::CreateWindowWithContextAndBounds(
new ResizableWidgetDelegate, root_window, bounds);
toplevel->Show();
@@ -616,7 +618,7 @@ TEST_P(SystemGestureEventFilterTest, TwoFingerDragDelayed) {
TEST_P(SystemGestureEventFilterTest, ThreeFingerGestureStopsDrag) {
gfx::Rect bounds(0, 0, 100, 100);
- aura::RootWindow* root_window = Shell::GetPrimaryRootWindow();
+ aura::Window* root_window = Shell::GetPrimaryRootWindow();
views::Widget* toplevel = views::Widget::CreateWindowWithContextAndBounds(
new ResizableWidgetDelegate, root_window, bounds);
toplevel->Show();
diff --git a/ash/wm/system_modal_container_layout_manager_unittest.cc b/ash/wm/system_modal_container_layout_manager_unittest.cc
index 0a11329..551382b 100644
--- a/ash/wm/system_modal_container_layout_manager_unittest.cc
+++ b/ash/wm/system_modal_container_layout_manager_unittest.cc
@@ -90,7 +90,7 @@ class EventTestWindow : public TestWindow {
mouse_presses_(0) {}
virtual ~EventTestWindow() {}
- aura::Window* OpenTestWindowWithContext(aura::RootWindow* context) {
+ aura::Window* OpenTestWindowWithContext(aura::Window* context) {
views::Widget* widget =
views::Widget::CreateWindowWithContext(this, context);
widget->Show();
diff --git a/ash/wm/toplevel_window_event_handler.cc b/ash/wm/toplevel_window_event_handler.cc
index f6d5902..ef8051d 100644
--- a/ash/wm/toplevel_window_event_handler.cc
+++ b/ash/wm/toplevel_window_event_handler.cc
@@ -335,7 +335,7 @@ aura::client::WindowMoveResult ToplevelWindowEventHandler::RunMoveLoop(
DCHECK(!in_move_loop_); // Can only handle one nested loop at a time.
in_move_loop_ = true;
move_cancelled_ = false;
- aura::RootWindow* root_window = source->GetRootWindow();
+ aura::Window* root_window = source->GetRootWindow();
DCHECK(root_window);
gfx::Point drag_location;
if (move_source == aura::client::WINDOW_MOVE_SOURCE_TOUCH &&
@@ -345,7 +345,7 @@ aura::client::WindowMoveResult ToplevelWindowEventHandler::RunMoveLoop(
GetLastTouchPointForTarget(source, &drag_location);
DCHECK(has_point);
} else {
- drag_location = root_window->GetLastMouseLocationInRoot();
+ drag_location = root_window->GetDispatcher()->GetLastMouseLocationInRoot();
aura::Window::ConvertPointToTarget(
root_window, source->parent(), &drag_location);
}
diff --git a/ash/wm/window_cycle_controller_unittest.cc b/ash/wm/window_cycle_controller_unittest.cc
index ef1f1e5..7bb9d27 100644
--- a/ash/wm/window_cycle_controller_unittest.cc
+++ b/ash/wm/window_cycle_controller_unittest.cc
@@ -18,6 +18,7 @@
#include "ui/aura/client/aura_constants.h"
#include "ui/aura/client/screen_position_client.h"
#include "ui/aura/env.h"
+#include "ui/aura/root_window.h"
#include "ui/aura/test/test_windows.h"
#include "ui/aura/window.h"
#include "ui/gfx/rect.h"
diff --git a/ash/wm/window_manager_unittest.cc b/ash/wm/window_manager_unittest.cc
index 2968f73..6f24d6d 100644
--- a/ash/wm/window_manager_unittest.cc
+++ b/ash/wm/window_manager_unittest.cc
@@ -143,7 +143,7 @@ TEST_F(WindowManagerTest, Focus) {
Shell::GetInstance()->RemovePreTargetHandler(
shell_test.input_method_event_filter());
- aura::RootWindow* root_window = Shell::GetPrimaryRootWindow();
+ aura::Window* root_window = Shell::GetPrimaryRootWindow();
root_window->SetBounds(gfx::Rect(0, 0, 510, 510));
// Supplied ids are negative so as not to collide with shell ids.
@@ -183,21 +183,23 @@ TEST_F(WindowManagerTest, Focus) {
aura::client::GetFocusClient(w121.get());
EXPECT_EQ(w121.get(), focus_client->GetFocusedWindow());
+ aura::WindowEventDispatcher* dispatcher = root_window->GetDispatcher();
+
// The key press should be sent to the focused sub-window.
ui::KeyEvent keyev(ui::ET_KEY_PRESSED, ui::VKEY_E, 0, false);
- root_window->AsRootWindowHostDelegate()->OnHostKeyEvent(&keyev);
+ dispatcher->AsRootWindowHostDelegate()->OnHostKeyEvent(&keyev);
EXPECT_EQ(ui::VKEY_E, w121delegate->last_key_code());
// Touch on a sub-window (w122) to focus it.
gfx::Point click_point = w122->bounds().CenterPoint();
aura::Window::ConvertPointToTarget(w122->parent(), root_window, &click_point);
ui::TouchEvent touchev(ui::ET_TOUCH_PRESSED, click_point, 0, getTime());
- root_window->AsRootWindowHostDelegate()->OnHostTouchEvent(&touchev);
+ dispatcher->AsRootWindowHostDelegate()->OnHostTouchEvent(&touchev);
focus_client = aura::client::GetFocusClient(w122.get());
EXPECT_EQ(w122.get(), focus_client->GetFocusedWindow());
// The key press should be sent to the focused sub-window.
- root_window->AsRootWindowHostDelegate()->OnHostKeyEvent(&keyev);
+ dispatcher->AsRootWindowHostDelegate()->OnHostKeyEvent(&keyev);
EXPECT_EQ(ui::VKEY_E, w122delegate->last_key_code());
// Hiding the focused window will set the focus to its parent if
@@ -234,7 +236,7 @@ TEST_F(WindowManagerTest, Focus) {
EXPECT_EQ(aura::client::GetFocusClient(w12.get()),
aura::client::GetFocusClient(w123.get()));
EXPECT_EQ(NULL, aura::client::GetFocusClient(w12.get())->GetFocusedWindow());
- EXPECT_FALSE(root_window->AsRootWindowHostDelegate()->OnHostKeyEvent(&keyev));
+ EXPECT_FALSE(dispatcher->AsRootWindowHostDelegate()->OnHostKeyEvent(&keyev));
// Set the focus back to w123
aura::client::SetActivationDelegate(w1.get(), NULL);
@@ -248,12 +250,12 @@ TEST_F(WindowManagerTest, Focus) {
// parent window is not focusable.
w12->RemoveChild(w123.get());
EXPECT_EQ(NULL, aura::client::GetFocusClient(w123.get()));
- EXPECT_FALSE(root_window->AsRootWindowHostDelegate()->OnHostKeyEvent(&keyev));
+ EXPECT_FALSE(dispatcher->AsRootWindowHostDelegate()->OnHostKeyEvent(&keyev));
}
// Various assertion testing for activating windows.
TEST_F(WindowManagerTest, ActivateOnMouse) {
- aura::RootWindow* root_window = Shell::GetPrimaryRootWindow();
+ aura::Window* root_window = Shell::GetPrimaryRootWindow();
test::TestActivationDelegate d1;
aura::test::TestWindowDelegate wd;
@@ -408,7 +410,7 @@ TEST_F(WindowManagerTest, PanelActivation) {
// Essentially the same as ActivateOnMouse, but for touch events.
TEST_F(WindowManagerTest, ActivateOnTouch) {
- aura::RootWindow* root_window = Shell::GetPrimaryRootWindow();
+ aura::Window* root_window = Shell::GetPrimaryRootWindow();
test::TestActivationDelegate d1;
aura::test::TestWindowDelegate wd;
@@ -438,7 +440,9 @@ TEST_F(WindowManagerTest, ActivateOnTouch) {
gfx::Point press_point = w2->bounds().CenterPoint();
aura::Window::ConvertPointToTarget(w2->parent(), root_window, &press_point);
ui::TouchEvent touchev1(ui::ET_TOUCH_PRESSED, press_point, 0, getTime());
- root_window->AsRootWindowHostDelegate()->OnHostTouchEvent(&touchev1);
+
+ aura::WindowEventDispatcher* dispatcher = root_window->GetDispatcher();
+ dispatcher->AsRootWindowHostDelegate()->OnHostTouchEvent(&touchev1);
// Window2 should have become active.
EXPECT_TRUE(wm::IsActiveWindow(w2.get()));
@@ -455,7 +459,7 @@ TEST_F(WindowManagerTest, ActivateOnTouch) {
aura::Window::ConvertPointToTarget(w1->parent(), root_window, &press_point);
d1.set_activate(false);
ui::TouchEvent touchev2(ui::ET_TOUCH_PRESSED, press_point, 1, getTime());
- root_window->AsRootWindowHostDelegate()->OnHostTouchEvent(&touchev2);
+ dispatcher->AsRootWindowHostDelegate()->OnHostTouchEvent(&touchev2);
// Window2 should still be active and focused.
EXPECT_TRUE(wm::IsActiveWindow(w2.get()));
@@ -479,7 +483,7 @@ TEST_F(WindowManagerTest, ActivateOnTouch) {
}
TEST_F(WindowManagerTest, MouseEventCursors) {
- aura::RootWindow* root_window = Shell::GetPrimaryRootWindow();
+ aura::Window* root_window = Shell::GetPrimaryRootWindow();
// Create a window.
const int kWindowLeft = 123;
@@ -497,76 +501,78 @@ TEST_F(WindowManagerTest, MouseEventCursors) {
gfx::Point point2(kWindowLeft + 1, kWindowTop + 1);
aura::Window::ConvertPointToTarget(window->parent(), root_window, &point2);
+ aura::WindowEventDispatcher* dispatcher = root_window->GetDispatcher();
+
// Cursor starts as a pointer (set during Shell::Init()).
- EXPECT_EQ(ui::kCursorPointer, root_window->last_cursor().native_type());
+ EXPECT_EQ(ui::kCursorPointer, dispatcher->last_cursor().native_type());
{
// Resize edges and corners show proper cursors.
window_delegate.set_hittest_code(HTBOTTOM);
ui::MouseEvent move1(ui::ET_MOUSE_MOVED, point1, point1, 0x0);
- root_window->AsRootWindowHostDelegate()->OnHostMouseEvent(&move1);
- EXPECT_EQ(ui::kCursorSouthResize, root_window->last_cursor().native_type());
+ dispatcher->AsRootWindowHostDelegate()->OnHostMouseEvent(&move1);
+ EXPECT_EQ(ui::kCursorSouthResize, dispatcher->last_cursor().native_type());
}
{
window_delegate.set_hittest_code(HTBOTTOMLEFT);
ui::MouseEvent move2(ui::ET_MOUSE_MOVED, point2, point2, 0x0);
- root_window->AsRootWindowHostDelegate()->OnHostMouseEvent(&move2);
+ dispatcher->AsRootWindowHostDelegate()->OnHostMouseEvent(&move2);
EXPECT_EQ(ui::kCursorSouthWestResize,
- root_window->last_cursor().native_type());
+ dispatcher->last_cursor().native_type());
}
{
window_delegate.set_hittest_code(HTBOTTOMRIGHT);
ui::MouseEvent move1(ui::ET_MOUSE_MOVED, point1, point1, 0x0);
- root_window->AsRootWindowHostDelegate()->OnHostMouseEvent(&move1);
+ dispatcher->AsRootWindowHostDelegate()->OnHostMouseEvent(&move1);
EXPECT_EQ(ui::kCursorSouthEastResize,
- root_window->last_cursor().native_type());
+ dispatcher->last_cursor().native_type());
}
{
window_delegate.set_hittest_code(HTLEFT);
ui::MouseEvent move2(ui::ET_MOUSE_MOVED, point2, point2, 0x0);
- root_window->AsRootWindowHostDelegate()->OnHostMouseEvent(&move2);
- EXPECT_EQ(ui::kCursorWestResize, root_window->last_cursor().native_type());
+ dispatcher->AsRootWindowHostDelegate()->OnHostMouseEvent(&move2);
+ EXPECT_EQ(ui::kCursorWestResize, dispatcher->last_cursor().native_type());
}
{
window_delegate.set_hittest_code(HTRIGHT);
ui::MouseEvent move1(ui::ET_MOUSE_MOVED, point1, point1, 0x0);
- root_window->AsRootWindowHostDelegate()->OnHostMouseEvent(&move1);
- EXPECT_EQ(ui::kCursorEastResize, root_window->last_cursor().native_type());
+ dispatcher->AsRootWindowHostDelegate()->OnHostMouseEvent(&move1);
+ EXPECT_EQ(ui::kCursorEastResize, dispatcher->last_cursor().native_type());
}
{
window_delegate.set_hittest_code(HTTOP);
ui::MouseEvent move2(ui::ET_MOUSE_MOVED, point2, point2, 0x0);
- root_window->AsRootWindowHostDelegate()->OnHostMouseEvent(&move2);
- EXPECT_EQ(ui::kCursorNorthResize, root_window->last_cursor().native_type());
+ dispatcher->AsRootWindowHostDelegate()->OnHostMouseEvent(&move2);
+ EXPECT_EQ(ui::kCursorNorthResize, dispatcher->last_cursor().native_type());
}
{
window_delegate.set_hittest_code(HTTOPLEFT);
ui::MouseEvent move1(ui::ET_MOUSE_MOVED, point1, point1, 0x0);
- root_window->AsRootWindowHostDelegate()->OnHostMouseEvent(&move1);
+ dispatcher->AsRootWindowHostDelegate()->OnHostMouseEvent(&move1);
EXPECT_EQ(ui::kCursorNorthWestResize,
- root_window->last_cursor().native_type());
+ dispatcher->last_cursor().native_type());
}
{
window_delegate.set_hittest_code(HTTOPRIGHT);
ui::MouseEvent move2(ui::ET_MOUSE_MOVED, point2, point2, 0x0);
- root_window->AsRootWindowHostDelegate()->OnHostMouseEvent(&move2);
+ dispatcher->AsRootWindowHostDelegate()->OnHostMouseEvent(&move2);
EXPECT_EQ(ui::kCursorNorthEastResize,
- root_window->last_cursor().native_type());
+ dispatcher->last_cursor().native_type());
}
{
// Client area uses null cursor.
window_delegate.set_hittest_code(HTCLIENT);
ui::MouseEvent move1(ui::ET_MOUSE_MOVED, point1, point1, 0x0);
- root_window->AsRootWindowHostDelegate()->OnHostMouseEvent(&move1);
- EXPECT_EQ(ui::kCursorNull, root_window->last_cursor().native_type());
+ dispatcher->AsRootWindowHostDelegate()->OnHostMouseEvent(&move1);
+ EXPECT_EQ(ui::kCursorNull, dispatcher->last_cursor().native_type());
}
}
@@ -576,7 +582,7 @@ TEST_F(WindowManagerTest, MouseEventCursors) {
#define MAYBE_TransformActivate TransformActivate
#endif
TEST_F(WindowManagerTest, MAYBE_TransformActivate) {
- aura::RootWindow* root_window = Shell::GetPrimaryRootWindow();
+ aura::Window* root_window = Shell::GetPrimaryRootWindow();
gfx::Size size = root_window->bounds().size();
EXPECT_EQ(gfx::Rect(size).ToString(),
Shell::GetScreen()->GetDisplayNearestPoint(
@@ -601,13 +607,14 @@ TEST_F(WindowManagerTest, MAYBE_TransformActivate) {
miss_point,
miss_point,
ui::EF_LEFT_MOUSE_BUTTON);
- root_window->AsRootWindowHostDelegate()->OnHostMouseEvent(&mouseev1);
+ aura::WindowEventDispatcher* dispatcher = root_window->GetDispatcher();
+ dispatcher->AsRootWindowHostDelegate()->OnHostMouseEvent(&mouseev1);
EXPECT_EQ(NULL, aura::client::GetFocusClient(w1.get())->GetFocusedWindow());
ui::MouseEvent mouseup(ui::ET_MOUSE_RELEASED,
miss_point,
miss_point,
ui::EF_LEFT_MOUSE_BUTTON);
- root_window->AsRootWindowHostDelegate()->OnHostMouseEvent(&mouseup);
+ dispatcher->AsRootWindowHostDelegate()->OnHostMouseEvent(&mouseup);
gfx::Point hit_point(5, 15);
transform.TransformPoint(&hit_point);
@@ -615,7 +622,7 @@ TEST_F(WindowManagerTest, MAYBE_TransformActivate) {
hit_point,
hit_point,
ui::EF_LEFT_MOUSE_BUTTON);
- root_window->AsRootWindowHostDelegate()->OnHostMouseEvent(&mouseev2);
+ dispatcher->AsRootWindowHostDelegate()->OnHostMouseEvent(&mouseev2);
EXPECT_TRUE(wm::IsActiveWindow(w1.get()));
EXPECT_EQ(w1.get(),
aura::client::GetFocusClient(w1.get())->GetFocusedWindow());
@@ -628,7 +635,7 @@ TEST_F(WindowManagerTest, AdditionalFilters) {
Shell::GetInstance()->RemovePreTargetHandler(
shell_test.input_method_event_filter());
- aura::RootWindow* root_window = Shell::GetPrimaryRootWindow();
+ aura::Window* root_window = Shell::GetPrimaryRootWindow();
// Creates a window and make it active
scoped_ptr<aura::Window> w1(CreateTestWindowInShell(
@@ -647,10 +654,11 @@ TEST_F(WindowManagerTest, AdditionalFilters) {
// Dispatches mouse and keyboard events.
ui::KeyEvent key_event(ui::ET_KEY_PRESSED, ui::VKEY_A, 0, false);
- root_window->AsRootWindowHostDelegate()->OnHostKeyEvent(&key_event);
+ aura::WindowEventDispatcher* dispatcher = root_window->GetDispatcher();
+ dispatcher->AsRootWindowHostDelegate()->OnHostKeyEvent(&key_event);
ui::MouseEvent mouse_pressed(
ui::ET_MOUSE_PRESSED, gfx::Point(0, 0), gfx::Point(0, 0), 0x0);
- root_window->AsRootWindowHostDelegate()->OnHostMouseEvent(&mouse_pressed);
+ dispatcher->AsRootWindowHostDelegate()->OnHostMouseEvent(&mouse_pressed);
// Both filters should get the events.
EXPECT_EQ(1, f1->num_key_events());
@@ -666,10 +674,10 @@ TEST_F(WindowManagerTest, AdditionalFilters) {
f1->set_mouse_event_handling_result(ui::ER_CONSUMED);
// Dispatches events.
- root_window->AsRootWindowHostDelegate()->OnHostKeyEvent(&key_event);
+ dispatcher->AsRootWindowHostDelegate()->OnHostKeyEvent(&key_event);
ui::MouseEvent mouse_released(
ui::ET_MOUSE_RELEASED, gfx::Point(0, 0), gfx::Point(0, 0), 0x0);
- root_window->AsRootWindowHostDelegate()->OnHostMouseEvent(&mouse_released);
+ dispatcher->AsRootWindowHostDelegate()->OnHostMouseEvent(&mouse_released);
// f1 should still get the events but f2 no longer gets them.
EXPECT_EQ(1, f1->num_key_events());
@@ -684,8 +692,8 @@ TEST_F(WindowManagerTest, AdditionalFilters) {
env_filter->RemoveHandler(f1.get());
// Dispatches events.
- root_window->AsRootWindowHostDelegate()->OnHostKeyEvent(&key_event);
- root_window->AsRootWindowHostDelegate()->OnHostMouseEvent(&mouse_pressed);
+ dispatcher->AsRootWindowHostDelegate()->OnHostKeyEvent(&key_event);
+ dispatcher->AsRootWindowHostDelegate()->OnHostMouseEvent(&mouse_pressed);
// f1 should get no events since it's out and f2 should get them.
EXPECT_EQ(0, f1->num_key_events());
diff --git a/ash/wm/window_positioner.cc b/ash/wm/window_positioner.cc
index f4bea7c..ceef02f 100644
--- a/ash/wm/window_positioner.cc
+++ b/ash/wm/window_positioner.cc
@@ -146,7 +146,7 @@ void AutoPlaceSingleWindow(aura::Window* window, bool animated) {
}
// Get the first open (non minimized) window which is on the screen defined.
-aura::Window* GetReferenceWindow(const aura::RootWindow* root_window,
+aura::Window* GetReferenceWindow(const aura::Window* root_window,
const aura::Window* exclude,
bool *single_window) {
if (single_window)
@@ -220,7 +220,7 @@ void WindowPositioner::GetBoundsAndShowStateForNewWindow(
ui::WindowShowState* show_state_out) {
// Always open new window in the target display.
- aura::RootWindow* target = Shell::GetTargetRootWindow();
+ aura::Window* target = Shell::GetTargetRootWindow();
aura::Window* top_window = GetReferenceWindow(target, NULL, NULL);
// Our window should not have any impact if we are already on top.
diff --git a/ash/wm/window_util.cc b/ash/wm/window_util.cc
index 66a6243..7f35840 100644
--- a/ash/wm/window_util.cc
+++ b/ash/wm/window_util.cc
@@ -100,7 +100,7 @@ bool MoveWindowToEventRoot(aura::Window* window, const ui::Event& event) {
views::View* target = static_cast<views::View*>(event.target());
if (!target)
return false;
- aura::RootWindow* target_root =
+ aura::Window* target_root =
target->GetWidget()->GetNativeView()->GetRootWindow();
if (!target_root || target_root == window->GetRootWindow())
return false;
diff --git a/ash/wm/workspace/phantom_window_controller.cc b/ash/wm/workspace/phantom_window_controller.cc
index cd2865e..0eb934d 100644
--- a/ash/wm/workspace/phantom_window_controller.cc
+++ b/ash/wm/workspace/phantom_window_controller.cc
@@ -104,7 +104,7 @@ void PhantomWindowController::Show(const gfx::Rect& bounds_in_screen) {
if (bounds_in_screen == bounds_in_screen_)
return;
bounds_in_screen_ = bounds_in_screen;
- aura::RootWindow* target_root = wm::GetRootWindowMatching(bounds_in_screen);
+ aura::Window* target_root = wm::GetRootWindowMatching(bounds_in_screen);
// Show the phantom at the current bounds of the window. We'll animate to the
// target bounds. If phantom exists, update the start bounds.
if (!phantom_widget_)
@@ -122,7 +122,7 @@ void PhantomWindowController::Show(const gfx::Rect& bounds_in_screen) {
// Create a secondary widget in a second screen if start_bounds_ lie at least
// partially in that other screen. This allows animations to start or restart
// in one root window and progress into another root.
- aura::RootWindow* start_root = wm::GetRootWindowMatching(start_bounds_);
+ aura::Window* start_root = wm::GetRootWindowMatching(start_bounds_);
if (start_root == target_root) {
Shell::RootWindowList root_windows = Shell::GetAllRootWindows();
for (size_t i = 0; i < root_windows.size(); ++i) {
@@ -172,7 +172,7 @@ void PhantomWindowController::AnimationProgressed(
}
views::Widget* PhantomWindowController::CreatePhantomWidget(
- aura::RootWindow* root_window,
+ aura::Window* root_window,
const gfx::Rect& bounds_in_screen) {
views::Widget* phantom_widget = new views::Widget;
views::Widget::InitParams params(views::Widget::InitParams::TYPE_POPUP);
diff --git a/ash/wm/workspace/phantom_window_controller.h b/ash/wm/workspace/phantom_window_controller.h
index 4a92792..77d4a28 100644
--- a/ash/wm/workspace/phantom_window_controller.h
+++ b/ash/wm/workspace/phantom_window_controller.h
@@ -13,7 +13,6 @@
#include "ui/gfx/rect.h"
namespace aura {
-class RootWindow;
class Window;
}
@@ -65,7 +64,7 @@ class ASH_EXPORT PhantomWindowController : public gfx::AnimationDelegate {
// Creates, shows and returns a phantom widget at |bounds|
// with kShellWindowId_ShelfContainer in |root_window| as a parent.
- views::Widget* CreatePhantomWidget(aura::RootWindow* root_window,
+ views::Widget* CreatePhantomWidget(aura::Window* root_window,
const gfx::Rect& bounds_in_screen);
// Window the phantom is placed beneath.
diff --git a/ash/wm/workspace/workspace_event_handler_unittest.cc b/ash/wm/workspace/workspace_event_handler_unittest.cc
index 61d55bd..d0dcdb6 100644
--- a/ash/wm/workspace/workspace_event_handler_unittest.cc
+++ b/ash/wm/workspace/workspace_event_handler_unittest.cc
@@ -256,7 +256,7 @@ TEST_F(WorkspaceEventHandlerTest, DoubleClickCaptionTogglesMaximize) {
wm::WindowState* window_state = wm::GetWindowState(window.get());
EXPECT_FALSE(window_state->IsMaximized());
- aura::RootWindow* root = Shell::GetPrimaryRootWindow();
+ aura::Window* root = Shell::GetPrimaryRootWindow();
aura::test::EventGenerator generator(root, window.get());
generator.DoubleClickLeftButton();
EXPECT_NE("1,2 30x40", window->bounds().ToString());
@@ -272,11 +272,12 @@ TEST_F(WorkspaceEventHandlerTest, DoubleClickCaptionTogglesMaximize) {
ui::MouseEvent press(ui::ET_MOUSE_PRESSED, generator.current_location(),
generator.current_location(),
ui::EF_MIDDLE_MOUSE_BUTTON | ui::EF_IS_DOUBLE_CLICK);
- root->AsRootWindowHostDelegate()->OnHostMouseEvent(&press);
+ aura::WindowEventDispatcher* dispatcher = root->GetDispatcher();
+ dispatcher->AsRootWindowHostDelegate()->OnHostMouseEvent(&press);
ui::MouseEvent release(ui::ET_MOUSE_RELEASED, generator.current_location(),
generator.current_location(),
ui::EF_IS_DOUBLE_CLICK);
- root->AsRootWindowHostDelegate()->OnHostMouseEvent(&release);
+ dispatcher->AsRootWindowHostDelegate()->OnHostMouseEvent(&release);
EXPECT_FALSE(window_state->IsMaximized());
EXPECT_EQ("1,2 30x40", window->bounds().ToString());
diff --git a/ash/wm/workspace/workspace_layout_manager.cc b/ash/wm/workspace/workspace_layout_manager.cc
index 3a313b2..cfe77ff 100644
--- a/ash/wm/workspace/workspace_layout_manager.cc
+++ b/ash/wm/workspace/workspace_layout_manager.cc
@@ -55,7 +55,7 @@ void MoveToDisplayForRestore(wm::WindowState* window_state) {
Shell::GetInstance()->display_controller();
const gfx::Display& display =
display_controller->GetDisplayMatching(restore_bounds);
- aura::RootWindow* new_root =
+ aura::Window* new_root =
display_controller->GetRootWindowForDisplayId(display.id());
if (new_root != window_state->window()->GetRootWindow()) {
aura::Window* new_container =
diff --git a/ash/wm/workspace/workspace_window_resizer.cc b/ash/wm/workspace/workspace_window_resizer.cc
index 61a58a1..a443332 100644
--- a/ash/wm/workspace/workspace_window_resizer.cc
+++ b/ash/wm/workspace/workspace_window_resizer.cc
@@ -394,7 +394,7 @@ void WorkspaceWindowResizer::Drag(const gfx::Point& location_in_parent,
gfx::Point location_in_screen = location_in_parent;
wm::ConvertPointToScreen(window()->parent(), &location_in_screen);
- aura::RootWindow* root = NULL;
+ aura::Window* root = NULL;
gfx::Display display =
ScreenAsh::FindDisplayContainingPoint(location_in_screen);
// Track the last screen that the pointer was on to keep the snap phantom
diff --git a/ash/wm/workspace/workspace_window_resizer_unittest.cc b/ash/wm/workspace/workspace_window_resizer_unittest.cc
index f3efaa52..1d5f0d2 100644
--- a/ash/wm/workspace/workspace_window_resizer_unittest.cc
+++ b/ash/wm/workspace/workspace_window_resizer_unittest.cc
@@ -107,7 +107,7 @@ class WorkspaceWindowResizerTest : public test::AshTestBase {
AshTestBase::SetUp();
UpdateDisplay(base::StringPrintf("800x%d", kRootHeight));
- aura::RootWindow* root = Shell::GetPrimaryRootWindow();
+ aura::Window* root = Shell::GetPrimaryRootWindow();
gfx::Rect root_bounds(root->bounds());
#if defined(OS_WIN)
// RootWindow and Display can't resize on Windows Ash.
@@ -462,7 +462,7 @@ TEST_F(WorkspaceWindowResizerTest, AttachedResize_BOTTOM_2) {
// windows.
TEST_F(WorkspaceWindowResizerTest, MAYBE_AttachedResize_BOTTOM_3) {
UpdateDisplay("600x800");
- aura::RootWindow* root = Shell::GetPrimaryRootWindow();
+ aura::Window* root = Shell::GetPrimaryRootWindow();
Shell::GetInstance()->SetDisplayWorkAreaInsets(root, gfx::Insets());
window_->SetBounds(gfx::Rect( 300, 100, 300, 200));
@@ -1478,7 +1478,7 @@ TEST_F(WorkspaceWindowResizerTest, PhantomSnapMaxSize) {
TEST_F(WorkspaceWindowResizerTest, DontRewardRightmostWindowForOverflows) {
UpdateDisplay("600x800");
- aura::RootWindow* root = Shell::GetPrimaryRootWindow();
+ aura::Window* root = Shell::GetPrimaryRootWindow();
Shell::GetInstance()->SetDisplayWorkAreaInsets(root, gfx::Insets());
// Four 100x100 windows flush against eachother, starting at 100,100.
@@ -1509,7 +1509,7 @@ TEST_F(WorkspaceWindowResizerTest, DontRewardRightmostWindowForOverflows) {
TEST_F(WorkspaceWindowResizerTest, DontExceedMaxWidth) {
UpdateDisplay("600x800");
- aura::RootWindow* root = Shell::GetPrimaryRootWindow();
+ aura::Window* root = Shell::GetPrimaryRootWindow();
Shell::GetInstance()->SetDisplayWorkAreaInsets(root, gfx::Insets());
// Four 100x100 windows flush against eachother, starting at 100,100.
@@ -1538,7 +1538,7 @@ TEST_F(WorkspaceWindowResizerTest, DontExceedMaxWidth) {
TEST_F(WorkspaceWindowResizerTest, DontExceedMaxHeight) {
UpdateDisplay("600x800");
- aura::RootWindow* root = Shell::GetPrimaryRootWindow();
+ aura::Window* root = Shell::GetPrimaryRootWindow();
Shell::GetInstance()->SetDisplayWorkAreaInsets(root, gfx::Insets());
// Four 100x100 windows flush against eachother, starting at 100,100.
@@ -1574,7 +1574,7 @@ TEST_F(WorkspaceWindowResizerTest, DontExceedMaxHeight) {
TEST_F(WorkspaceWindowResizerTest, MAYBE_DontExceedMinHeight) {
UpdateDisplay("600x500");
- aura::RootWindow* root = Shell::GetPrimaryRootWindow();
+ aura::Window* root = Shell::GetPrimaryRootWindow();
Shell::GetInstance()->SetDisplayWorkAreaInsets(root, gfx::Insets());
// Four 100x100 windows flush against eachother, starting at 100,100.
@@ -1603,7 +1603,7 @@ TEST_F(WorkspaceWindowResizerTest, MAYBE_DontExceedMinHeight) {
TEST_F(WorkspaceWindowResizerTest, DontExpandRightmostPastMaxWidth) {
UpdateDisplay("600x800");
- aura::RootWindow* root = Shell::GetPrimaryRootWindow();
+ aura::Window* root = Shell::GetPrimaryRootWindow();
Shell::GetInstance()->SetDisplayWorkAreaInsets(root, gfx::Insets());
// Three 100x100 windows flush against eachother, starting at 100,100.
@@ -1629,7 +1629,7 @@ TEST_F(WorkspaceWindowResizerTest, DontExpandRightmostPastMaxWidth) {
TEST_F(WorkspaceWindowResizerTest, MoveAttachedWhenGrownToMaxSize) {
UpdateDisplay("600x800");
- aura::RootWindow* root = Shell::GetPrimaryRootWindow();
+ aura::Window* root = Shell::GetPrimaryRootWindow();
Shell::GetInstance()->SetDisplayWorkAreaInsets(root, gfx::Insets());
// Three 100x100 windows flush against eachother, starting at 100,100.
@@ -1663,7 +1663,7 @@ TEST_F(WorkspaceWindowResizerTest, MoveAttachedWhenGrownToMaxSize) {
TEST_F(WorkspaceWindowResizerTest, MAYBE_MainWindowHonoursMaxWidth) {
UpdateDisplay("400x800");
- aura::RootWindow* root = Shell::GetPrimaryRootWindow();
+ aura::Window* root = Shell::GetPrimaryRootWindow();
Shell::GetInstance()->SetDisplayWorkAreaInsets(root, gfx::Insets());
// Three 100x100 windows flush against eachother, starting at 100,100.
@@ -1690,7 +1690,7 @@ TEST_F(WorkspaceWindowResizerTest, MAYBE_MainWindowHonoursMaxWidth) {
TEST_F(WorkspaceWindowResizerTest, MainWindowHonoursMinWidth) {
UpdateDisplay("400x800");
- aura::RootWindow* root = Shell::GetPrimaryRootWindow();
+ aura::Window* root = Shell::GetPrimaryRootWindow();
Shell::GetInstance()->SetDisplayWorkAreaInsets(root, gfx::Insets());
// Three 100x100 windows flush against eachother, starting at 100,100.