summaryrefslogtreecommitdiffstats
path: root/ui
diff options
context:
space:
mode:
Diffstat (limited to 'ui')
-rw-r--r--ui/app_list/views/app_list_view.cc2
-rw-r--r--ui/aura/client/default_capture_client.cc2
-rw-r--r--ui/aura/client/focus_client.cc2
-rw-r--r--ui/aura/client/window_tree_client.cc4
-rw-r--r--ui/aura/root_window.cc19
-rw-r--r--ui/aura/root_window.h6
-rw-r--r--ui/aura/root_window_unittest.cc2
-rw-r--r--ui/aura/test/event_generator.cc12
-rw-r--r--ui/aura/test/event_generator.h6
-rw-r--r--ui/aura/test/ui_controls_factory_aurawin.cc4
-rw-r--r--ui/aura/window.cc88
-rw-r--r--ui/aura/window.h22
-rw-r--r--ui/keyboard/keyboard_ui_handler.cc14
-rw-r--r--ui/keyboard/keyboard_util.cc29
-rw-r--r--ui/keyboard/keyboard_util.h11
-rw-r--r--ui/shell_dialogs/select_file_dialog_win.cc4
-rw-r--r--ui/snapshot/snapshot_aura.cc6
-rw-r--r--ui/views/controls/menu/display_change_listener_aura.cc7
-rw-r--r--ui/views/controls/menu/menu_controller_aura.cc14
-rw-r--r--ui/views/corewm/capture_controller.cc17
-rw-r--r--ui/views/corewm/capture_controller.h14
-rw-r--r--ui/views/corewm/compound_event_filter.cc2
-rw-r--r--ui/views/corewm/focus_controller_unittest.cc2
-rw-r--r--ui/views/corewm/input_method_event_filter.cc14
-rw-r--r--ui/views/corewm/input_method_event_filter.h12
-rw-r--r--ui/views/corewm/tooltip_aura.cc5
-rw-r--r--ui/views/corewm/tooltip_controller.cc3
-rw-r--r--ui/views/corewm/tooltip_controller_unittest.cc8
-rw-r--r--ui/views/drag_utils.cc2
-rw-r--r--ui/views/event_utils_aura.cc7
-rw-r--r--ui/views/test/ui_controls_factory_desktop_aurax11.cc30
-rw-r--r--ui/views/widget/desktop_aura/desktop_drag_drop_client_aurax11.cc2
-rw-r--r--ui/views/widget/desktop_aura/desktop_drop_target_win.cc2
-rw-r--r--ui/views/widget/desktop_aura/desktop_root_window_host_win.cc15
-rw-r--r--ui/views/widget/desktop_aura/desktop_screen_position_client.cc16
-rw-r--r--ui/views/widget/desktop_aura/desktop_screen_win.cc4
-rw-r--r--ui/views/widget/desktop_aura/desktop_screen_x11.cc6
-rw-r--r--ui/views/widget/desktop_aura/x11_desktop_window_move_client.cc2
-rw-r--r--ui/views/widget/native_widget_aura.cc8
-rw-r--r--ui/views/widget/tooltip_manager_aura.cc12
-rw-r--r--ui/views/widget/tooltip_manager_aura.h3
-rw-r--r--ui/views/widget/widget_interactive_uitest.cc13
-rw-r--r--ui/views/widget/widget_unittest.cc8
-rw-r--r--ui/views/win/hwnd_util_aurawin.cc12
44 files changed, 248 insertions, 225 deletions
diff --git a/ui/app_list/views/app_list_view.cc b/ui/app_list/views/app_list_view.cc
index 5a9d79c..0f6d2df 100644
--- a/ui/app_list/views/app_list_view.cc
+++ b/ui/app_list/views/app_list_view.cc
@@ -168,7 +168,7 @@ HWND AppListView::GetHWND() const {
#if defined(USE_AURA)
gfx::NativeWindow window =
GetWidget()->GetTopLevelWidget()->GetNativeWindow();
- return window->GetRootWindow()->GetAcceleratedWidget();
+ return window->GetDispatcher()->GetAcceleratedWidget();
#else
return GetWidget()->GetTopLevelWidget()->GetNativeWindow();
#endif
diff --git a/ui/aura/client/default_capture_client.cc b/ui/aura/client/default_capture_client.cc
index 648f964..6008a89 100644
--- a/ui/aura/client/default_capture_client.cc
+++ b/ui/aura/client/default_capture_client.cc
@@ -30,7 +30,7 @@ void DefaultCaptureClient::SetCapture(Window* window) {
Window* old_capture_window = capture_window_;
capture_window_ = window;
- CaptureDelegate* capture_delegate = root_window_->GetRootWindow();
+ CaptureDelegate* capture_delegate = root_window_->GetDispatcher();
if (capture_window_)
capture_delegate->SetNativeCapture();
else
diff --git a/ui/aura/client/focus_client.cc b/ui/aura/client/focus_client.cc
index a9be6aa..0769b0d 100644
--- a/ui/aura/client/focus_client.cc
+++ b/ui/aura/client/focus_client.cc
@@ -25,7 +25,7 @@ FocusClient* GetFocusClient(Window* window) {
}
FocusClient* GetFocusClient(const Window* window) {
- const RootWindow* root_window = window->GetRootWindow();
+ const Window* root_window = window->GetRootWindow();
return root_window ?
root_window->GetProperty(kRootWindowFocusClientKey) : NULL;
}
diff --git a/ui/aura/client/window_tree_client.cc b/ui/aura/client/window_tree_client.cc
index b2ea10f..de1ece5 100644
--- a/ui/aura/client/window_tree_client.cc
+++ b/ui/aura/client/window_tree_client.cc
@@ -19,14 +19,14 @@ DEFINE_WINDOW_PROPERTY_KEY(
void SetWindowTreeClient(Window* window, WindowTreeClient* window_tree_client) {
DCHECK(window);
- RootWindow* root_window = window->GetRootWindow();
+ Window* root_window = window->GetRootWindow();
DCHECK(root_window);
root_window->SetProperty(kRootWindowWindowTreeClientKey, window_tree_client);
}
WindowTreeClient* GetWindowTreeClient(Window* window) {
DCHECK(window);
- RootWindow* root_window = window->GetRootWindow();
+ Window* root_window = window->GetRootWindow();
DCHECK(root_window);
WindowTreeClient* client =
root_window->GetProperty(kRootWindowWindowTreeClientKey);
diff --git a/ui/aura/root_window.cc b/ui/aura/root_window.cc
index 7195c2b..9c6d5ce 100644
--- a/ui/aura/root_window.cc
+++ b/ui/aura/root_window.cc
@@ -151,6 +151,7 @@ RootWindow::RootWindow(const CreateParams& params)
event_factory_(this),
held_event_factory_(this),
repostable_event_factory_(this) {
+ set_dispatcher(this);
SetName("RootWindow");
compositor_.reset(new ui::Compositor(params.use_software_renderer,
@@ -184,6 +185,8 @@ RootWindow::~RootWindow() {
// Destroying/removing child windows may try to access |host_| (eg.
// GetAcceleratedWidget())
host_.reset(NULL);
+
+ set_dispatcher(NULL);
}
// static
@@ -523,11 +526,11 @@ gfx::Transform RootWindow::GetRootTransform() const {
////////////////////////////////////////////////////////////////////////////////
// RootWindow, Window overrides:
-RootWindow* RootWindow::GetRootWindow() {
+Window* RootWindow::GetRootWindow() {
return this;
}
-const RootWindow* RootWindow::GetRootWindow() const {
+const Window* RootWindow::GetRootWindow() const {
return this;
}
@@ -616,7 +619,7 @@ void RootWindow::OnWindowAddedToRootWindow(Window* attached) {
}
void RootWindow::OnWindowRemovedFromRootWindow(Window* detached,
- RootWindow* new_root) {
+ Window* new_root) {
DCHECK(aura::client::GetCaptureWindow(this) != this);
DispatchMouseExitToHidingWindow(detached);
@@ -940,15 +943,15 @@ void RootWindow::DispatchMouseEventRepost(ui::MouseEvent* event) {
if (event->type() != ui::ET_MOUSE_PRESSED)
return;
Window* target = client::GetCaptureWindow(this);
- RootWindow* root = this;
+ WindowEventDispatcher* dispatcher = this;
if (!target) {
target = GetEventHandlerForPoint(event->location());
} else {
- root = target->GetRootWindow();
- CHECK(root); // Capture window better be in valid root.
+ dispatcher = target->GetDispatcher();
+ CHECK(dispatcher); // Capture window better be in valid root.
}
- root->mouse_pressed_handler_ = NULL;
- root->DispatchMouseEventToTarget(event, target);
+ dispatcher->mouse_pressed_handler_ = NULL;
+ dispatcher->DispatchMouseEventToTarget(event, target);
}
bool RootWindow::DispatchMouseEventToTarget(ui::MouseEvent* event,
diff --git a/ui/aura/root_window.h b/ui/aura/root_window.h
index 503ff9a..e716dcb 100644
--- a/ui/aura/root_window.h
+++ b/ui/aura/root_window.h
@@ -241,8 +241,8 @@ class AURA_EXPORT RootWindow : public Window,
gfx::Transform GetRootTransform() const;
// Overridden from Window:
- virtual RootWindow* GetRootWindow() OVERRIDE;
- virtual const RootWindow* GetRootWindow() const OVERRIDE;
+ virtual Window* GetRootWindow() OVERRIDE;
+ virtual const Window* GetRootWindow() const OVERRIDE;
virtual void SetTransform(const gfx::Transform& transform) OVERRIDE;
virtual bool CanFocus() const OVERRIDE;
virtual bool CanReceiveEvents() const OVERRIDE;
@@ -284,7 +284,7 @@ class AURA_EXPORT RootWindow : public Window,
// Called when a Window is attached or detached from the RootWindow.
void OnWindowAddedToRootWindow(Window* window);
- void OnWindowRemovedFromRootWindow(Window* window, RootWindow* new_root);
+ void OnWindowRemovedFromRootWindow(Window* window, Window* new_root);
// Called when a window becomes invisible, either by being removed
// from root window hierarchy, via SetVisible(false) or being destroyed.
diff --git a/ui/aura/root_window_unittest.cc b/ui/aura/root_window_unittest.cc
index 02966e8..5819305 100644
--- a/ui/aura/root_window_unittest.cc
+++ b/ui/aura/root_window_unittest.cc
@@ -992,7 +992,7 @@ class RepostGestureEventRecorder : public EventFilterRecorder {
EXPECT_NE(repost_target_, event->target());
reposted_ = true;
events().clear();
- repost_target_->GetRootWindow()->RepostEvent(*event);
+ repost_target_->GetDispatcher()->RepostEvent(*event);
// Ensure that the reposted gesture event above goes to the
// repost_target_;
repost_source_->GetRootWindow()->RemoveChild(repost_source_);
diff --git a/ui/aura/test/event_generator.cc b/ui/aura/test/event_generator.cc
index a5aad78..dea96a5e 100644
--- a/ui/aura/test/event_generator.cc
+++ b/ui/aura/test/event_generator.cc
@@ -31,13 +31,13 @@ void DummyCallback(ui::EventType, const gfx::Vector2dF&) {
class DefaultEventGeneratorDelegate : public EventGeneratorDelegate {
public:
- explicit DefaultEventGeneratorDelegate(RootWindow* root_window)
+ explicit DefaultEventGeneratorDelegate(Window* root_window)
: root_window_(root_window) {}
virtual ~DefaultEventGeneratorDelegate() {}
// EventGeneratorDelegate overrides:
virtual RootWindow* GetRootWindowAt(const gfx::Point& point) const OVERRIDE {
- return root_window_;
+ return root_window_->GetDispatcher();
}
virtual client::ScreenPositionClient* GetScreenPositionClient(
@@ -46,7 +46,7 @@ class DefaultEventGeneratorDelegate : public EventGeneratorDelegate {
}
private:
- RootWindow* root_window_;
+ Window* root_window_;
DISALLOW_COPY_AND_ASSIGN(DefaultEventGeneratorDelegate);
};
@@ -77,7 +77,7 @@ const int kAllButtonMask = ui::EF_LEFT_MOUSE_BUTTON | ui::EF_RIGHT_MOUSE_BUTTON;
} // namespace
-EventGenerator::EventGenerator(RootWindow* root_window)
+EventGenerator::EventGenerator(Window* root_window)
: delegate_(new DefaultEventGeneratorDelegate(root_window)),
current_root_window_(delegate_->GetRootWindowAt(current_location_)),
flags_(0),
@@ -85,7 +85,7 @@ EventGenerator::EventGenerator(RootWindow* root_window)
async_(false) {
}
-EventGenerator::EventGenerator(RootWindow* root_window, const gfx::Point& point)
+EventGenerator::EventGenerator(Window* root_window, const gfx::Point& point)
: delegate_(new DefaultEventGeneratorDelegate(root_window)),
current_location_(point),
current_root_window_(delegate_->GetRootWindowAt(current_location_)),
@@ -94,7 +94,7 @@ EventGenerator::EventGenerator(RootWindow* root_window, const gfx::Point& point)
async_(false) {
}
-EventGenerator::EventGenerator(RootWindow* root_window, Window* window)
+EventGenerator::EventGenerator(Window* root_window, Window* window)
: delegate_(new DefaultEventGeneratorDelegate(root_window)),
current_location_(CenterOfWindow(window)),
current_root_window_(delegate_->GetRootWindowAt(current_location_)),
diff --git a/ui/aura/test/event_generator.h b/ui/aura/test/event_generator.h
index 2a4649b..ee9ebda 100644
--- a/ui/aura/test/event_generator.h
+++ b/ui/aura/test/event_generator.h
@@ -87,7 +87,7 @@ class EventGenerator {
public:
// Creates an EventGenerator with the mouse/touch location (0,0),
// which uses the |root_window|'s coordinates.
- explicit EventGenerator(RootWindow* root_window);
+ explicit EventGenerator(Window* root_window);
// Create an EventGenerator with EventGeneratorDelegate,
// which uses the coordinates used by |delegate|.
@@ -95,11 +95,11 @@ class EventGenerator {
// Creates an EventGenerator with the mouse/touch location
// at |initial_location|, which uses the |root_window|'s coordinates.
- EventGenerator(RootWindow* root_window, const gfx::Point& initial_location);
+ EventGenerator(Window* root_window, const gfx::Point& initial_location);
// Creates an EventGenerator with the mouse/touch location
// centered over |window|, which uses the |root_window|'s coordinates.
- EventGenerator(RootWindow* root_window, Window* window);
+ EventGenerator(Window* root_window, Window* window);
virtual ~EventGenerator();
diff --git a/ui/aura/test/ui_controls_factory_aurawin.cc b/ui/aura/test/ui_controls_factory_aurawin.cc
index 48997fe..60a15c9 100644
--- a/ui/aura/test/ui_controls_factory_aurawin.cc
+++ b/ui/aura/test/ui_controls_factory_aurawin.cc
@@ -36,7 +36,7 @@ class UIControlsWin : public UIControlsAura {
bool alt,
bool command) {
DCHECK(!command); // No command key on Aura
- HWND window = native_window->GetRootWindow()->GetAcceleratedWidget();
+ HWND window = native_window->GetDispatcher()->GetAcceleratedWidget();
return SendKeyPressImpl(
window, key, control, shift, alt, base::Closure());
}
@@ -48,7 +48,7 @@ class UIControlsWin : public UIControlsAura {
bool command,
const base::Closure& task) {
DCHECK(!command); // No command key on Aura
- HWND window = native_window->GetRootWindow()->GetAcceleratedWidget();
+ HWND window = native_window->GetDispatcher()->GetAcceleratedWidget();
return SendKeyPressImpl(window, key, control, shift, alt, task);
}
virtual bool SendMouseMove(long x, long y) {
diff --git a/ui/aura/window.cc b/ui/aura/window.cc
index f32f1e7..1436ff9 100644
--- a/ui/aura/window.cc
+++ b/ui/aura/window.cc
@@ -34,7 +34,8 @@
namespace aura {
Window::Window(WindowDelegate* delegate)
- : type_(client::WINDOW_TYPE_UNKNOWN),
+ : dispatcher_(NULL),
+ type_(client::WINDOW_TYPE_UNKNOWN),
owned_by_parent_(true),
delegate_(delegate),
parent_(NULL),
@@ -63,9 +64,9 @@ Window::~Window() {
FOR_EACH_OBSERVER(WindowObserver, observers_, OnWindowDestroying(this));
// Let the root know so that it can remove any references to us.
- RootWindow* root_window = GetRootWindow();
- if (root_window)
- root_window->OnWindowDestroying(this);
+ WindowEventDispatcher* dispatcher = GetDispatcher();
+ if (dispatcher)
+ dispatcher->OnWindowDestroying(this);
// Then destroy the children.
RemoveOrDestroyChildren();
@@ -174,15 +175,25 @@ void Window::SetTransparent(bool transparent) {
transparent_ = transparent;
}
-RootWindow* Window::GetRootWindow() {
- return const_cast<RootWindow*>(
+Window* Window::GetRootWindow() {
+ return const_cast<Window*>(
static_cast<const Window*>(this)->GetRootWindow());
}
-const RootWindow* Window::GetRootWindow() const {
+const Window* Window::GetRootWindow() const {
return parent_ ? parent_->GetRootWindow() : NULL;
}
+WindowEventDispatcher* Window::GetDispatcher() {
+ return const_cast<WindowEventDispatcher*>(const_cast<const Window*>(this)->
+ GetDispatcher());
+}
+
+const WindowEventDispatcher* Window::GetDispatcher() const {
+ const Window* root_window = GetRootWindow();
+ return root_window ? root_window->dispatcher_ : NULL;
+}
+
void Window::Show() {
SetVisible(true);
}
@@ -217,7 +228,7 @@ gfx::Rect Window::GetBoundsInRootWindow() const {
gfx::Rect Window::GetBoundsInScreen() const {
gfx::Rect bounds(GetBoundsInRootWindow());
- const RootWindow* root = GetRootWindow();
+ const Window* root = GetRootWindow();
if (root) {
aura::client::ScreenPositionClient* screen_position_client =
aura::client::GetScreenPositionClient(root);
@@ -231,12 +242,12 @@ gfx::Rect Window::GetBoundsInScreen() const {
}
void Window::SetTransform(const gfx::Transform& transform) {
- RootWindow* root_window = GetRootWindow();
- bool contained_mouse = IsVisible() && root_window &&
- ContainsPointInRoot(root_window->GetLastMouseLocationInRoot());
+ WindowEventDispatcher* dispatcher = GetDispatcher();
+ bool contained_mouse = IsVisible() && dispatcher &&
+ ContainsPointInRoot(dispatcher->GetLastMouseLocationInRoot());
layer()->SetTransform(transform);
- if (root_window)
- root_window->OnWindowTransformed(this, contained_mouse);
+ if (dispatcher)
+ dispatcher->OnWindowTransformed(this, contained_mouse);
}
void Window::SetLayoutManager(LayoutManager* layout_manager) {
@@ -262,7 +273,7 @@ void Window::SetBounds(const gfx::Rect& new_bounds) {
void Window::SetBoundsInScreen(const gfx::Rect& new_bounds_in_screen,
const gfx::Display& dst_display) {
- RootWindow* root = GetRootWindow();
+ Window* root = GetRootWindow();
if (root) {
gfx::Point origin = new_bounds_in_screen.origin();
aura::client::ScreenPositionClient* screen_position_client =
@@ -316,7 +327,7 @@ void Window::AddChild(Window* child) {
params.phase = WindowObserver::HierarchyChangeParams::HIERARCHY_CHANGING;
NotifyWindowHierarchyChange(params);
- RootWindow* old_root = child->GetRootWindow();
+ Window* old_root = child->GetRootWindow();
DCHECK(std::find(children_.begin(), children_.end(), child) ==
children_.end());
@@ -332,9 +343,9 @@ void Window::AddChild(Window* child) {
FOR_EACH_OBSERVER(WindowObserver, observers_, OnWindowAdded(child));
child->OnParentChanged();
- RootWindow* root_window = GetRootWindow();
+ Window* root_window = GetRootWindow();
if (root_window && old_root != root_window) {
- root_window->OnWindowAddedToRootWindow(child);
+ root_window->GetDispatcher()->OnWindowAddedToRootWindow(child);
child->NotifyAddedToRootWindow();
}
@@ -410,11 +421,11 @@ void Window::ConvertPointToTarget(const Window* source,
return;
if (source->GetRootWindow() != target->GetRootWindow()) {
client::ScreenPositionClient* source_client =
- GetScreenPositionClient(source->GetRootWindow());
+ client::GetScreenPositionClient(source->GetRootWindow());
source_client->ConvertPointToScreen(source, point);
client::ScreenPositionClient* target_client =
- GetScreenPositionClient(target->GetRootWindow());
+ client::GetScreenPositionClient(target->GetRootWindow());
target_client->ConvertPointFromScreen(target, point);
} else {
ui::Layer::ConvertPointToLayer(source->layer(), target->layer(), point);
@@ -422,11 +433,11 @@ void Window::ConvertPointToTarget(const Window* source,
}
void Window::MoveCursorTo(const gfx::Point& point_in_window) {
- RootWindow* root_window = GetRootWindow();
+ Window* root_window = GetRootWindow();
DCHECK(root_window);
gfx::Point point_in_root(point_in_window);
ConvertPointToTarget(this, root_window, &point_in_root);
- root_window->MoveCursorTo(point_in_root);
+ root_window->GetDispatcher()->MoveCursorTo(point_in_root);
}
gfx::NativeCursor Window::GetCursor(const gfx::Point& point) const {
@@ -552,21 +563,21 @@ void Window::SetCapture() {
if (!IsVisible())
return;
- RootWindow* root_window = GetRootWindow();
+ Window* root_window = GetRootWindow();
if (!root_window)
return;
client::GetCaptureClient(root_window)->SetCapture(this);
}
void Window::ReleaseCapture() {
- RootWindow* root_window = GetRootWindow();
+ Window* root_window = GetRootWindow();
if (!root_window)
return;
client::GetCaptureClient(root_window)->ReleaseCapture(this);
}
bool Window::HasCapture() {
- RootWindow* root_window = GetRootWindow();
+ Window* root_window = GetRootWindow();
return root_window &&
client::GetCaptureClient(root_window)->GetCaptureWindow() == this;
}
@@ -692,9 +703,9 @@ void Window::SetVisible(bool visible) {
FOR_EACH_OBSERVER(WindowObserver, observers_,
OnWindowVisibilityChanging(this, visible));
- RootWindow* root_window = GetRootWindow();
- if (root_window)
- root_window->DispatchMouseExitToHidingWindow(this);
+ WindowEventDispatcher* dispatcher = GetDispatcher();
+ if (dispatcher)
+ dispatcher->DispatchMouseExitToHidingWindow(this);
client::VisibilityClient* visibility_client =
client::GetVisibilityClient(this);
@@ -712,8 +723,8 @@ void Window::SetVisible(bool visible) {
NotifyWindowVisibilityChanged(this, visible);
- if (root_window)
- root_window->OnWindowVisibilityChanged(this, visible);
+ if (dispatcher)
+ dispatcher->OnWindowVisibilityChanged(this, visible);
}
void Window::SchedulePaint() {
@@ -780,10 +791,11 @@ void Window::RemoveChildImpl(Window* child, Window* new_parent) {
if (layout_manager_)
layout_manager_->OnWillRemoveWindowFromLayout(child);
FOR_EACH_OBSERVER(WindowObserver, observers_, OnWillRemoveWindow(child));
- RootWindow* root_window = child->GetRootWindow();
- RootWindow* new_root_window = new_parent ? new_parent->GetRootWindow() : NULL;
+ Window* root_window = child->GetRootWindow();
+ Window* new_root_window = new_parent ? new_parent->GetRootWindow() : NULL;
if (root_window && root_window != new_root_window) {
- root_window->OnWindowRemovedFromRootWindow(child, new_root_window);
+ root_window->GetDispatcher()->OnWindowRemovedFromRootWindow(
+ child, new_root_window);
child->NotifyRemovingFromRootWindow();
}
child->parent_ = NULL;
@@ -1082,9 +1094,9 @@ void Window::OnLayerBoundsChanged(const gfx::Rect& old_bounds,
FOR_EACH_OBSERVER(WindowObserver,
observers_,
OnWindowBoundsChanged(this, old_bounds, bounds()));
- RootWindow* root_window = GetRootWindow();
- if (root_window)
- root_window->OnWindowBoundsChanged(this, contained_mouse);
+ WindowEventDispatcher* dispatcher = GetDispatcher();
+ if (dispatcher)
+ dispatcher->OnWindowBoundsChanged(this, contained_mouse);
}
void Window::OnPaintLayer(gfx::Canvas* canvas) {
@@ -1132,9 +1144,9 @@ void Window::UpdateLayerName(const std::string& name) {
bool Window::ContainsMouse() {
bool contains_mouse = false;
if (IsVisible()) {
- RootWindow* root_window = GetRootWindow();
- contains_mouse = root_window &&
- ContainsPointInRoot(root_window->GetLastMouseLocationInRoot());
+ WindowEventDispatcher* dispatcher = GetDispatcher();
+ contains_mouse = dispatcher &&
+ ContainsPointInRoot(dispatcher->GetLastMouseLocationInRoot());
}
return contains_mouse;
}
diff --git a/ui/aura/window.h b/ui/aura/window.h
index e908de4..e11f83a 100644
--- a/ui/aura/window.h
+++ b/ui/aura/window.h
@@ -46,6 +46,9 @@ class RootWindow;
class WindowDelegate;
class WindowObserver;
+// TODO(beng): remove once RootWindow is renamed.
+typedef RootWindow WindowEventDispatcher;
+
// Defined in window_property.h (which we do not include)
template<typename T>
struct WindowProperty;
@@ -108,10 +111,19 @@ class AURA_EXPORT Window : public ui::LayerDelegate,
Window* parent() { return parent_; }
const Window* parent() const { return parent_; }
- // Returns the RootWindow that contains this Window or NULL if the Window is
- // not contained by a RootWindow.
- virtual RootWindow* GetRootWindow();
- virtual const RootWindow* GetRootWindow() const;
+ // Returns the root Window that contains this Window. The root Window is
+ // defined as the Window that has a dispatcher. These functions return NULL if
+ // the Window is contained in a hierarchy that does not have a dispatcher at
+ // its root.
+ virtual Window* GetRootWindow();
+ virtual const Window* GetRootWindow() const;
+
+ WindowEventDispatcher* GetDispatcher();
+ const WindowEventDispatcher* GetDispatcher() const;
+ void set_dispatcher(WindowEventDispatcher* dispatcher) {
+ dispatcher_ = dispatcher;
+ }
+ bool HasDispatcher() const { return !!dispatcher_; }
// The Window does not own this object.
void set_user_data(void* user_data) { user_data_ = user_data; }
@@ -475,6 +487,8 @@ class AURA_EXPORT Window : public ui::LayerDelegate,
// Returns true if the mouse is currently within our bounds.
bool ContainsMouse();
+ WindowEventDispatcher* dispatcher_;
+
client::WindowType type_;
// True if the Window is owned by its parent - i.e. it will be deleted by its
diff --git a/ui/keyboard/keyboard_ui_handler.cc b/ui/keyboard/keyboard_ui_handler.cc
index c4b29ac..610d0e2 100644
--- a/ui/keyboard/keyboard_ui_handler.cc
+++ b/ui/keyboard/keyboard_ui_handler.cc
@@ -54,7 +54,7 @@ void KeyboardUIHandler::HandleInsertTextMessage(const base::ListValue* args) {
return;
}
- aura::RootWindow* root_window =
+ aura::Window* root_window =
web_ui()->GetWebContents()->GetView()->GetNativeView()->GetRootWindow();
if (!root_window) {
LOG(ERROR) << "insertText failed: no root window";
@@ -75,7 +75,7 @@ void KeyboardUIHandler::HandleGetInputContextMessage(
base::DictionaryValue results;
results.SetInteger("requestId", request_id);
- aura::RootWindow* root_window =
+ aura::Window* root_window =
web_ui()->GetWebContents()->GetView()->GetNativeView()->GetRootWindow();
if (!root_window) {
LOG(ERROR) << "getInputContext failed: no root window";
@@ -113,10 +113,10 @@ void KeyboardUIHandler::HandleSendKeyEventMessage(
return;
}
- aura::RootWindow* root_window =
- web_ui()->GetWebContents()->GetView()->GetNativeView()->GetRootWindow();
- if (!root_window) {
- LOG(ERROR) << "sendKeyEvent failed: no root window";
+ aura::WindowEventDispatcher* dispatcher =
+ web_ui()->GetWebContents()->GetView()->GetNativeView()->GetDispatcher();
+ if (!dispatcher) {
+ LOG(ERROR) << "sendKeyEvent failed: no dispatcher";
return;
}
@@ -124,7 +124,7 @@ void KeyboardUIHandler::HandleSendKeyEventMessage(
char_value,
key_code,
modifiers,
- root_window)) {
+ dispatcher)) {
LOG(ERROR) << "sendKeyEvent failed";
}
}
diff --git a/ui/keyboard/keyboard_util.cc b/ui/keyboard/keyboard_util.cc
index 32cf8c4..ac2d723 100644
--- a/ui/keyboard/keyboard_util.cc
+++ b/ui/keyboard/keyboard_util.cc
@@ -23,11 +23,12 @@ namespace {
const char kKeyDown[] ="keydown";
const char kKeyUp[] = "keyup";
-void SendProcessKeyEvent(ui::EventType type, aura::RootWindow* root_window) {
+void SendProcessKeyEvent(ui::EventType type,
+ aura::WindowEventDispatcher* dispatcher) {
ui::TranslatedKeyEvent event(type == ui::ET_KEY_PRESSED,
ui::VKEY_PROCESSKEY,
ui::EF_NONE);
- root_window->AsRootWindowHostDelegate()->OnHostKeyEvent(&event);
+ dispatcher->AsRootWindowHostDelegate()->OnHostKeyEvent(&event);
}
} // namespace
@@ -42,7 +43,7 @@ bool IsKeyboardEnabled() {
}
-bool InsertText(const base::string16& text, aura::RootWindow* root_window) {
+bool InsertText(const base::string16& text, aura::Window* root_window) {
if (!root_window)
return false;
@@ -66,8 +67,8 @@ bool InsertText(const base::string16& text, aura::RootWindow* root_window) {
// ui::TextInputClient from that (see above in InsertText()).
bool MoveCursor(int swipe_direction,
int modifier_flags,
- aura::RootWindow* root_window) {
- if (!root_window)
+ aura::WindowEventDispatcher* dispatcher) {
+ if (!dispatcher)
return false;
ui::KeyboardCode codex = ui::VKEY_UNKNOWN;
ui::KeyboardCode codey = ui::VKEY_UNKNOWN;
@@ -84,17 +85,17 @@ bool MoveCursor(int swipe_direction,
// First deal with the x movement.
if (codex != ui::VKEY_UNKNOWN) {
ui::KeyEvent press_event(ui::ET_KEY_PRESSED, codex, modifier_flags, 0);
- root_window->AsRootWindowHostDelegate()->OnHostKeyEvent(&press_event);
+ dispatcher->AsRootWindowHostDelegate()->OnHostKeyEvent(&press_event);
ui::KeyEvent release_event(ui::ET_KEY_RELEASED, codex, modifier_flags, 0);
- root_window->AsRootWindowHostDelegate()->OnHostKeyEvent(&release_event);
+ dispatcher->AsRootWindowHostDelegate()->OnHostKeyEvent(&release_event);
}
// Then deal with the y movement.
if (codey != ui::VKEY_UNKNOWN) {
ui::KeyEvent press_event(ui::ET_KEY_PRESSED, codey, modifier_flags, 0);
- root_window->AsRootWindowHostDelegate()->OnHostKeyEvent(&press_event);
+ dispatcher->AsRootWindowHostDelegate()->OnHostKeyEvent(&press_event);
ui::KeyEvent release_event(ui::ET_KEY_RELEASED, codey, modifier_flags, 0);
- root_window->AsRootWindowHostDelegate()->OnHostKeyEvent(&release_event);
+ dispatcher->AsRootWindowHostDelegate()->OnHostKeyEvent(&release_event);
}
return true;
}
@@ -103,7 +104,7 @@ bool SendKeyEvent(const std::string type,
int key_value,
int key_code,
int modifiers,
- aura::RootWindow* root_window) {
+ aura::WindowEventDispatcher* dispatcher) {
ui::EventType event_type = ui::ET_UNKNOWN;
if (type == kKeyDown)
event_type = ui::ET_KEY_PRESSED;
@@ -118,16 +119,16 @@ bool SendKeyEvent(const std::string type,
// Handling of special printable characters (e.g. accented characters) for
// which there is no key code.
if (event_type == ui::ET_KEY_RELEASED) {
- ui::InputMethod* input_method = root_window->GetProperty(
+ ui::InputMethod* input_method = dispatcher->GetProperty(
aura::client::kRootWindowInputMethodKey);
if (!input_method)
return false;
ui::TextInputClient* tic = input_method->GetTextInputClient();
- SendProcessKeyEvent(ui::ET_KEY_PRESSED, root_window);
+ SendProcessKeyEvent(ui::ET_KEY_PRESSED, dispatcher);
tic->InsertChar(static_cast<uint16>(key_value), ui::EF_NONE);
- SendProcessKeyEvent(ui::ET_KEY_RELEASED, root_window);
+ SendProcessKeyEvent(ui::ET_KEY_RELEASED, dispatcher);
}
} else {
if (event_type == ui::ET_KEY_RELEASED) {
@@ -146,7 +147,7 @@ bool SendKeyEvent(const std::string type,
}
ui::KeyEvent event(event_type, code, modifiers, false);
- root_window->AsRootWindowHostDelegate()->OnHostKeyEvent(&event);
+ dispatcher->AsRootWindowHostDelegate()->OnHostKeyEvent(&event);
}
return true;
}
diff --git a/ui/keyboard/keyboard_util.h b/ui/keyboard/keyboard_util.h
index f35f7d7a..653e32b 100644
--- a/ui/keyboard/keyboard_util.h
+++ b/ui/keyboard/keyboard_util.h
@@ -8,11 +8,10 @@
#include <string>
#include "base/strings/string16.h"
+// TODO(beng): replace with forward decl once RootWindow is renamed.
+#include "ui/aura/window.h"
#include "ui/keyboard/keyboard_export.h"
-namespace aura {
-class RootWindow;
-}
struct GritResourceMap;
namespace keyboard {
@@ -41,13 +40,13 @@ KEYBOARD_EXPORT bool IsKeyboardEnabled();
// that this may convert |text| into ui::KeyEvents for injection in some
// special circumstances (i.e. VKEY_RETURN, VKEY_BACK).
KEYBOARD_EXPORT bool InsertText(const base::string16& text,
- aura::RootWindow* root_window);
+ aura::Window* root_window);
// Move cursor when swipe on the virtualkeyboard. Returns true if cursor was
// successfully moved according to |swipe_direction|.
KEYBOARD_EXPORT bool MoveCursor(int swipe_direction,
int modifier_flags,
- aura::RootWindow* root_window);
+ aura::WindowEventDispatcher* dispatcher);
// Sends a fabricated key event, where |type| is the event type, |key_value|
// is the unicode value of the character, |key_code| is the legacy key code
@@ -58,7 +57,7 @@ KEYBOARD_EXPORT bool SendKeyEvent(std::string type,
int key_value,
int key_code,
int modifiers,
- aura::RootWindow* root_window);
+ aura::WindowEventDispatcher* dispatcher);
// Get the list of keyboard resources. |size| is populated with the number of
// resources in the returned array.
diff --git a/ui/shell_dialogs/select_file_dialog_win.cc b/ui/shell_dialogs/select_file_dialog_win.cc
index c028d22..7cec71d 100644
--- a/ui/shell_dialogs/select_file_dialog_win.cc
+++ b/ui/shell_dialogs/select_file_dialog_win.cc
@@ -599,7 +599,7 @@ void SelectFileDialogImpl::SelectFileImpl(
}
}
HWND owner = owning_window && owning_window->GetRootWindow()
- ? owning_window->GetRootWindow()->GetAcceleratedWidget() : NULL;
+ ? owning_window->GetDispatcher()->GetAcceleratedWidget() : NULL;
#else
HWND owner = owning_window;
#endif
@@ -621,7 +621,7 @@ bool SelectFileDialogImpl::IsRunning(gfx::NativeWindow owning_window) const {
#if defined(USE_AURA)
if (!owning_window->GetRootWindow())
return false;
- HWND owner = owning_window->GetRootWindow()->GetAcceleratedWidget();
+ HWND owner = owning_window->GetDispatcher()->GetAcceleratedWidget();
#else
HWND owner = owning_window;
#endif
diff --git a/ui/snapshot/snapshot_aura.cc b/ui/snapshot/snapshot_aura.cc
index 29daf9f..ea4cb1b 100644
--- a/ui/snapshot/snapshot_aura.cc
+++ b/ui/snapshot/snapshot_aura.cc
@@ -40,9 +40,9 @@ bool GrabWindowSnapshot(gfx::NativeWindow window,
// We must take into account the window's position on the desktop.
read_pixels_bounds.Offset(
window->GetBoundsInRootWindow().origin().OffsetFromOrigin());
- aura::RootWindow* root_window = window->GetRootWindow();
- if (root_window)
- root_window->GetRootTransform().TransformRect(&read_pixels_bounds);
+ aura::WindowEventDispatcher* dispatcher = window->GetDispatcher();
+ if (dispatcher)
+ dispatcher->GetRootTransform().TransformRect(&read_pixels_bounds);
gfx::Rect read_pixels_bounds_in_pixel =
gfx::ToEnclosingRect(read_pixels_bounds);
diff --git a/ui/views/controls/menu/display_change_listener_aura.cc b/ui/views/controls/menu/display_change_listener_aura.cc
index 1cec651..e6df560 100644
--- a/ui/views/controls/menu/display_change_listener_aura.cc
+++ b/ui/views/controls/menu/display_change_listener_aura.cc
@@ -2,10 +2,9 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#include "ui/views/controls/menu/menu_runner.h"
-
-#include "ui/aura/root_window.h"
+#include "ui/aura/window.h"
#include "ui/aura/window_observer.h"
+#include "ui/views/controls/menu/menu_runner.h"
#include "ui/views/widget/widget.h"
namespace views {
@@ -28,7 +27,7 @@ class AuraDisplayChangeListener
private:
MenuRunner* menu_runner_;
- aura::RootWindow* root_window_;
+ aura::Window* root_window_;
DISALLOW_COPY_AND_ASSIGN(AuraDisplayChangeListener);
};
diff --git a/ui/views/controls/menu/menu_controller_aura.cc b/ui/views/controls/menu/menu_controller_aura.cc
index c65c97f..48bf311 100644
--- a/ui/views/controls/menu/menu_controller_aura.cc
+++ b/ui/views/controls/menu/menu_controller_aura.cc
@@ -9,7 +9,7 @@
#include "ui/aura/client/activation_client.h"
#include "ui/aura/client/dispatcher_client.h"
#include "ui/aura/client/drag_drop_client.h"
-#include "ui/aura/root_window.h"
+#include "ui/aura/window.h"
#include "ui/aura/window_observer.h"
#include "ui/gfx/screen.h"
#include "ui/views/widget/widget.h"
@@ -27,7 +27,7 @@ class ActivationChangeObserverImpl
public ui::EventHandler {
public:
ActivationChangeObserverImpl(MenuController* controller,
- aura::RootWindow* root)
+ aura::Window* root)
: controller_(controller),
root_(root) {
aura::client::GetActivationClient(root_)->AddObserver(this);
@@ -71,12 +71,12 @@ class ActivationChangeObserverImpl
}
MenuController* controller_;
- aura::RootWindow* root_;
+ aura::Window* root_;
DISALLOW_COPY_AND_ASSIGN(ActivationChangeObserverImpl);
};
-aura::RootWindow* GetOwnerRootWindow(views::Widget* owner) {
+aura::Window* GetOwnerRootWindow(views::Widget* owner) {
return owner ? owner->GetNativeWindow()->GetRootWindow() : NULL;
}
@@ -84,7 +84,7 @@ aura::RootWindow* GetOwnerRootWindow(views::Widget* owner) {
void MenuController::RunMessageLoop(bool nested_menu) {
// |owner_| may be NULL.
- aura::RootWindow* root = GetOwnerRootWindow(owner_);
+ aura::Window* root = GetOwnerRootWindow(owner_);
if (root) {
scoped_ptr<ActivationChangeObserverImpl> observer;
if (!nested_menu)
@@ -100,13 +100,13 @@ void MenuController::RunMessageLoop(bool nested_menu) {
}
bool MenuController::ShouldQuitNow() const {
- aura::RootWindow* root = GetOwnerRootWindow(owner_);
+ aura::Window* root = GetOwnerRootWindow(owner_);
return !aura::client::GetDragDropClient(root) ||
!aura::client::GetDragDropClient(root)->IsDragDropInProgress();
}
gfx::Screen* MenuController::GetScreen() {
- aura::RootWindow* root = GetOwnerRootWindow(owner_);
+ aura::Window* root = GetOwnerRootWindow(owner_);
return root ?
gfx::Screen::GetScreenFor(root) : gfx::Screen::GetNativeScreen();
}
diff --git a/ui/views/corewm/capture_controller.cc b/ui/views/corewm/capture_controller.cc
index 1276c82b..59ff199 100644
--- a/ui/views/corewm/capture_controller.cc
+++ b/ui/views/corewm/capture_controller.cc
@@ -13,13 +13,13 @@ namespace corewm {
////////////////////////////////////////////////////////////////////////////////
// CaptureController, public:
-void CaptureController::Attach(aura::RootWindow* root) {
+void CaptureController::Attach(aura::Window* root) {
DCHECK_EQ(0u, root_windows_.count(root));
root_windows_.insert(root);
aura::client::SetCaptureClient(root, this);
}
-void CaptureController::Detach(aura::RootWindow* root) {
+void CaptureController::Detach(aura::Window* root) {
root_windows_.erase(root);
aura::client::SetCaptureClient(root, NULL);
}
@@ -36,7 +36,7 @@ void CaptureController::SetCapture(aura::Window* new_capture_window) {
DCHECK(!capture_window_ || capture_window_->GetRootWindow());
aura::Window* old_capture_window = capture_window_;
- aura::RootWindow* old_capture_root = old_capture_window ?
+ aura::Window* old_capture_root = old_capture_window ?
old_capture_window->GetRootWindow() : NULL;
// Copy the list in case it's modified out from under us.
@@ -57,19 +57,20 @@ void CaptureController::SetCapture(aura::Window* new_capture_window) {
for (RootWindows::const_iterator i = root_windows.begin();
i != root_windows.end(); ++i) {
- aura::client::CaptureDelegate* delegate = *i;
+ aura::client::CaptureDelegate* delegate = (*i)->GetDispatcher();
delegate->UpdateCapture(old_capture_window, new_capture_window);
}
- aura::RootWindow* capture_root =
+ aura::Window* capture_root =
capture_window_ ? capture_window_->GetRootWindow() : NULL;
if (capture_root != old_capture_root) {
if (old_capture_root) {
- aura::client::CaptureDelegate* delegate = old_capture_root;
+ aura::client::CaptureDelegate* delegate =
+ old_capture_root->GetDispatcher();
delegate->ReleaseNativeCapture();
}
if (capture_root) {
- aura::client::CaptureDelegate* delegate = capture_root;
+ aura::client::CaptureDelegate* delegate = capture_root->GetDispatcher();
delegate->SetNativeCapture();
}
}
@@ -101,7 +102,7 @@ CaptureController::~CaptureController() {
// static
CaptureController* ScopedCaptureClient::capture_controller_ = NULL;
-ScopedCaptureClient::ScopedCaptureClient(aura::RootWindow* root)
+ScopedCaptureClient::ScopedCaptureClient(aura::Window* root)
: root_window_(root) {
root->AddObserver(this);
if (!capture_controller_)
diff --git a/ui/views/corewm/capture_controller.h b/ui/views/corewm/capture_controller.h
index f7e8128..3250221 100644
--- a/ui/views/corewm/capture_controller.h
+++ b/ui/views/corewm/capture_controller.h
@@ -13,10 +13,6 @@
#include "ui/aura/window_observer.h"
#include "ui/views/views_export.h"
-namespace aura {
-class RootWindow;
-}
-
namespace views {
namespace corewm {
@@ -24,10 +20,10 @@ namespace corewm {
class VIEWS_EXPORT CaptureController : public aura::client::CaptureClient {
public:
// Adds |root| to the list of RootWindows notified when capture changes.
- void Attach(aura::RootWindow* root);
+ void Attach(aura::Window* root);
// Removes |root| from the list of RootWindows notified when capture changes.
- void Detach(aura::RootWindow* root);
+ void Detach(aura::Window* root);
// Returns true if this CaptureController is installed on at least one
// RootWindow.
@@ -40,7 +36,7 @@ class VIEWS_EXPORT CaptureController : public aura::client::CaptureClient {
private:
friend class ScopedCaptureClient;
- typedef std::set<aura::RootWindow*> RootWindows;
+ typedef std::set<aura::Window*> RootWindows;
CaptureController();
virtual ~CaptureController();
@@ -59,7 +55,7 @@ class VIEWS_EXPORT CaptureController : public aura::client::CaptureClient {
// among all ScopedCaptureClients and adds the RootWindow to it.
class VIEWS_EXPORT ScopedCaptureClient : public aura::WindowObserver {
public:
- explicit ScopedCaptureClient(aura::RootWindow* root);
+ explicit ScopedCaptureClient(aura::Window* root);
virtual ~ScopedCaptureClient();
// Returns true if there is a CaptureController with at least one RootWindow.
@@ -80,7 +76,7 @@ class VIEWS_EXPORT ScopedCaptureClient : public aura::WindowObserver {
static CaptureController* capture_controller_;
// RootWindow this ScopedCaptureClient was create for.
- aura::RootWindow* root_window_;
+ aura::Window* root_window_;
DISALLOW_COPY_AND_ASSIGN(ScopedCaptureClient);
};
diff --git a/ui/views/corewm/compound_event_filter.cc b/ui/views/corewm/compound_event_filter.cc
index 0d021bd..146edb3 100644
--- a/ui/views/corewm/compound_event_filter.cc
+++ b/ui/views/corewm/compound_event_filter.cc
@@ -123,7 +123,7 @@ void CompoundEventFilter::UpdateCursor(aura::Window* target,
ui::MouseEvent* event) {
// If drag and drop is in progress, let the drag drop client set the cursor
// instead of setting the cursor here.
- aura::RootWindow* root_window = target->GetRootWindow();
+ aura::Window* root_window = target->GetRootWindow();
aura::client::DragDropClient* drag_drop_client =
aura::client::GetDragDropClient(root_window);
if (drag_drop_client && drag_drop_client->IsDragDropInProgress())
diff --git a/ui/views/corewm/focus_controller_unittest.cc b/ui/views/corewm/focus_controller_unittest.cc
index 964fd58..2177271 100644
--- a/ui/views/corewm/focus_controller_unittest.cc
+++ b/ui/views/corewm/focus_controller_unittest.cc
@@ -98,7 +98,7 @@ class ScopedFocusNotificationObserver : public FocusNotificationObserver {
class ScopedTargetFocusNotificationObserver : public FocusNotificationObserver {
public:
- ScopedTargetFocusNotificationObserver(aura::RootWindow* root_window, int id)
+ ScopedTargetFocusNotificationObserver(aura::Window* root_window, int id)
: target_(root_window->GetChildById(id)) {
aura::client::SetActivationChangeObserver(target_, this);
aura::client::SetFocusChangeObserver(target_, this);
diff --git a/ui/views/corewm/input_method_event_filter.cc b/ui/views/corewm/input_method_event_filter.cc
index cfdab6b..8c99063 100644
--- a/ui/views/corewm/input_method_event_filter.cc
+++ b/ui/views/corewm/input_method_event_filter.cc
@@ -18,7 +18,7 @@ namespace corewm {
InputMethodEventFilter::InputMethodEventFilter(gfx::AcceleratedWidget widget)
: input_method_(ui::CreateInputMethod(this, widget)),
- target_root_window_(NULL) {
+ target_dispatcher_(NULL) {
// TODO(yusukes): Check if the root window is currently focused and pass the
// result to Init().
input_method_->Init(true);
@@ -28,7 +28,7 @@ InputMethodEventFilter::~InputMethodEventFilter() {
}
void InputMethodEventFilter::SetInputMethodPropertyInRootWindow(
- aura::RootWindow* root_window) {
+ aura::Window* root_window) {
root_window->SetProperty(aura::client::kRootWindowInputMethodKey,
input_method_.get());
}
@@ -45,10 +45,10 @@ void InputMethodEventFilter::OnKeyEvent(ui::KeyEvent* event) {
static_cast<ui::TranslatedKeyEvent*>(event)->ConvertToKeyEvent();
} else {
// If the focused window is changed, all requests to IME will be
- // discarded so it's safe to update the target_root_window_ here.
+ // discarded so it's safe to update the target_dispatcher_ here.
aura::Window* target = static_cast<aura::Window*>(event->target());
- target_root_window_ = target->GetRootWindow();
- DCHECK(target_root_window_);
+ target_dispatcher_ = target->GetRootWindow()->GetDispatcher();
+ DCHECK(target_dispatcher_);
bool handled = false;
if (event->HasNativeEvent())
handled = input_method_->DispatchKeyEvent(event->native_event());
@@ -68,7 +68,7 @@ bool InputMethodEventFilter::DispatchKeyEventPostIME(
DCHECK(event.message != WM_CHAR);
#endif
ui::TranslatedKeyEvent aura_event(event, false /* is_char */);
- return target_root_window_->AsRootWindowHostDelegate()->OnHostKeyEvent(
+ return target_dispatcher_->AsRootWindowHostDelegate()->OnHostKeyEvent(
&aura_event);
}
@@ -78,7 +78,7 @@ bool InputMethodEventFilter::DispatchFabricatedKeyEventPostIME(
int flags) {
ui::TranslatedKeyEvent aura_event(type == ui::ET_KEY_PRESSED, key_code,
flags);
- return target_root_window_->AsRootWindowHostDelegate()->OnHostKeyEvent(
+ return target_dispatcher_->AsRootWindowHostDelegate()->OnHostKeyEvent(
&aura_event);
}
diff --git a/ui/views/corewm/input_method_event_filter.h b/ui/views/corewm/input_method_event_filter.h
index cb1fae4..902244c 100644
--- a/ui/views/corewm/input_method_event_filter.h
+++ b/ui/views/corewm/input_method_event_filter.h
@@ -8,15 +8,12 @@
#include "base/basictypes.h"
#include "base/compiler_specific.h"
#include "base/memory/scoped_ptr.h"
+#include "ui/aura/window.h"
#include "ui/base/ime/input_method_delegate.h"
#include "ui/events/event_handler.h"
#include "ui/gfx/native_widget_types.h"
#include "ui/views/views_export.h"
-namespace aura {
-class RootWindow;
-}
-
namespace ui {
class InputMethod;
}
@@ -33,7 +30,7 @@ class VIEWS_EXPORT InputMethodEventFilter
explicit InputMethodEventFilter(gfx::AcceleratedWidget widget);
virtual ~InputMethodEventFilter();
- void SetInputMethodPropertyInRootWindow(aura::RootWindow* root_window);
+ void SetInputMethodPropertyInRootWindow(aura::Window* root_window);
ui::InputMethod* input_method() const { return input_method_.get(); }
@@ -49,9 +46,8 @@ class VIEWS_EXPORT InputMethodEventFilter
scoped_ptr<ui::InputMethod> input_method_;
- // The target root window to which the key event translated by IME will
- // be dispatched.
- aura::RootWindow* target_root_window_;
+ // The target dispatcher that will receive translated key events from the IME.
+ aura::WindowEventDispatcher* target_dispatcher_;
DISALLOW_COPY_AND_ASSIGN(InputMethodEventFilter);
};
diff --git a/ui/views/corewm/tooltip_aura.cc b/ui/views/corewm/tooltip_aura.cc
index 70e07e3..1f7029e 100644
--- a/ui/views/corewm/tooltip_aura.cc
+++ b/ui/views/corewm/tooltip_aura.cc
@@ -172,8 +172,9 @@ gfx::Rect TooltipAura::GetBoundsForTooltip(
// (which comes from the RootWindow).
if (screen_type_ == gfx::SCREEN_TYPE_NATIVE &&
gfx::SCREEN_TYPE_NATIVE != gfx::SCREEN_TYPE_ALTERNATE) {
- aura::RootWindow* root = tooltip_window_->GetRootWindow();
- widget_bounds = gfx::Rect(root->GetHostOrigin(), root->GetHostSize());
+ aura::WindowEventDispatcher* dispatcher = tooltip_window_->GetDispatcher();
+ widget_bounds = gfx::Rect(dispatcher->GetHostOrigin(),
+ dispatcher->GetHostSize());
}
gfx::Screen* screen = gfx::Screen::GetScreenByType(screen_type_);
gfx::Rect bounds(screen->GetDisplayNearestPoint(origin).bounds());
diff --git a/ui/views/corewm/tooltip_controller.cc b/ui/views/corewm/tooltip_controller.cc
index a51d4d4..adfff86 100644
--- a/ui/views/corewm/tooltip_controller.cc
+++ b/ui/views/corewm/tooltip_controller.cc
@@ -10,7 +10,6 @@
#include "ui/aura/client/cursor_client.h"
#include "ui/aura/client/drag_drop_client.h"
#include "ui/aura/env.h"
-#include "ui/aura/root_window.h"
#include "ui/aura/window.h"
#include "ui/events/event.h"
#include "ui/gfx/font.h"
@@ -234,7 +233,7 @@ bool TooltipController::IsDragDropInProgress() {
bool TooltipController::IsCursorVisible() {
if (!tooltip_window_)
return false;
- aura::RootWindow* root = tooltip_window_->GetRootWindow();
+ aura::Window* root = tooltip_window_->GetRootWindow();
if (!root)
return false;
aura::client::CursorClient* cursor_client =
diff --git a/ui/views/corewm/tooltip_controller_unittest.cc b/ui/views/corewm/tooltip_controller_unittest.cc
index ebde564..4898792 100644
--- a/ui/views/corewm/tooltip_controller_unittest.cc
+++ b/ui/views/corewm/tooltip_controller_unittest.cc
@@ -101,7 +101,7 @@ class TooltipControllerTest : public aura::test::AuraTestBase {
return widget_->GetNativeWindow();
}
- aura::RootWindow* GetRootWindow() {
+ aura::Window* GetRootWindow() {
return GetWindow()->GetRootWindow();
}
@@ -159,7 +159,7 @@ TEST_F(TooltipControllerTest, TooltipsInMultipleViews) {
PrepareSecondView();
aura::Window* window = GetWindow();
- aura::RootWindow* root_window = GetRootWindow();
+ aura::Window* root_window = GetRootWindow();
// Fire tooltip timer so tooltip becomes visible.
generator_->MoveMouseRelativeTo(window, view_->bounds().CenterPoint());
@@ -356,7 +356,7 @@ TEST_F(TooltipControllerTest, TooltipsInMultipleRootWindows) {
EXPECT_EQ(NULL, helper_->GetTooltipWindow());
aura::Window* window = GetWindow();
- aura::RootWindow* root_window = GetRootWindow();
+ aura::Window* root_window = GetRootWindow();
// Fire tooltip timer so tooltip becomes visible.
generator_->MoveMouseRelativeTo(window, view_->bounds().CenterPoint());
@@ -386,7 +386,7 @@ TEST_F(TooltipControllerTest, TooltipsInMultipleRootWindows) {
view2->set_tooltip_text(ASCIIToUTF16("Tooltip Text For RootWindow2"));
aura::Window* window2 = widget2->GetNativeWindow();
- aura::RootWindow* root_window2 =
+ aura::Window* root_window2 =
widget2->GetNativeWindow()->GetRootWindow();
// Fire tooltip timer so tooltip becomes visible.
generator_->MoveMouseRelativeTo(window2, view2->bounds().CenterPoint());
diff --git a/ui/views/drag_utils.cc b/ui/views/drag_utils.cc
index b156276..0b9c317 100644
--- a/ui/views/drag_utils.cc
+++ b/ui/views/drag_utils.cc
@@ -47,7 +47,7 @@ void RunShellDrag(gfx::NativeView view,
ui::DragDropTypes::DragEventSource source) {
#if defined(USE_AURA)
gfx::Point root_location(location);
- aura::RootWindow* root_window = view->GetRootWindow();
+ aura::Window* root_window = view->GetRootWindow();
aura::Window::ConvertPointToTarget(view, root_window, &root_location);
if (aura::client::GetDragDropClient(root_window)) {
aura::client::GetDragDropClient(root_window)->StartDragAndDrop(
diff --git a/ui/views/event_utils_aura.cc b/ui/views/event_utils_aura.cc
index 455ec1a..054b280 100644
--- a/ui/views/event_utils_aura.cc
+++ b/ui/views/event_utils_aura.cc
@@ -20,10 +20,11 @@ bool RepostLocatedEvent(gfx::NativeWindow window,
if (!window)
return false;
- aura::RootWindow* root_window = window->GetRootWindow();
+ aura::Window* root_window = window->GetRootWindow();
gfx::Point root_loc(event.location());
- ScreenPositionClient* spc = GetScreenPositionClient(root_window);
+ ScreenPositionClient* spc =
+ aura::client::GetScreenPositionClient(root_window);
if (!spc)
return false;
@@ -43,7 +44,7 @@ bool RepostLocatedEvent(gfx::NativeWindow window,
relocated->set_location(root_loc);
relocated->set_root_location(root_loc);
- root_window->RepostEvent(*relocated);
+ root_window->GetDispatcher()->RepostEvent(*relocated);
return true;
}
diff --git a/ui/views/test/ui_controls_factory_desktop_aurax11.cc b/ui/views/test/ui_controls_factory_desktop_aurax11.cc
index f6f4f7e..bffa77b 100644
--- a/ui/views/test/ui_controls_factory_desktop_aurax11.cc
+++ b/ui/views/test/ui_controls_factory_desktop_aurax11.cc
@@ -125,32 +125,32 @@ class UIControlsDesktopX11 : public UIControlsAura {
const base::Closure& closure) OVERRIDE {
DCHECK(!command); // No command key on Aura
- aura::RootWindow* root_window = window->GetRootWindow();
+ aura::WindowEventDispatcher* dispatcher = window->GetDispatcher();
XEvent xevent = {0};
xevent.xkey.type = KeyPress;
if (control) {
- SetKeycodeAndSendThenMask(root_window, &xevent, XK_Control_L,
+ SetKeycodeAndSendThenMask(dispatcher, &xevent, XK_Control_L,
ControlMask);
}
if (shift)
- SetKeycodeAndSendThenMask(root_window, &xevent, XK_Shift_L, ShiftMask);
+ SetKeycodeAndSendThenMask(dispatcher, &xevent, XK_Shift_L, ShiftMask);
if (alt)
- SetKeycodeAndSendThenMask(root_window, &xevent, XK_Alt_L, Mod1Mask);
+ SetKeycodeAndSendThenMask(dispatcher, &xevent, XK_Alt_L, Mod1Mask);
xevent.xkey.keycode =
XKeysymToKeycode(x_display_,
ui::XKeysymForWindowsKeyCode(key, shift));
- root_window->PostNativeEvent(&xevent);
+ dispatcher->PostNativeEvent(&xevent);
// Send key release events.
xevent.xkey.type = KeyRelease;
- root_window->PostNativeEvent(&xevent);
+ dispatcher->PostNativeEvent(&xevent);
if (alt)
- UnmaskAndSetKeycodeThenSend(root_window, &xevent, Mod1Mask, XK_Alt_L);
+ UnmaskAndSetKeycodeThenSend(dispatcher, &xevent, Mod1Mask, XK_Alt_L);
if (shift)
- UnmaskAndSetKeycodeThenSend(root_window, &xevent, ShiftMask, XK_Shift_L);
+ UnmaskAndSetKeycodeThenSend(dispatcher, &xevent, ShiftMask, XK_Shift_L);
if (control) {
- UnmaskAndSetKeycodeThenSend(root_window, &xevent, ControlMask,
+ UnmaskAndSetKeycodeThenSend(dispatcher, &xevent, ControlMask,
XK_Control_L);
}
DCHECK(!xevent.xkey.state);
@@ -168,7 +168,7 @@ class UIControlsDesktopX11 : public UIControlsAura {
const base::Closure& closure) OVERRIDE {
gfx::Point screen_point(x, y);
gfx::Point window_point = screen_point;
- aura::RootWindow* root_window = RootWindowForPoint(screen_point);
+ aura::Window* root_window = RootWindowForPoint(screen_point);
aura::client::ScreenPositionClient* screen_position_client =
aura::client::GetScreenPositionClient(root_window);
@@ -185,7 +185,7 @@ class UIControlsDesktopX11 : public UIControlsAura {
xmotion->state = button_down_mask;
xmotion->same_screen = True;
// RootWindow will take care of other necessary fields.
- root_window->PostNativeEvent(&xevent);
+ root_window->GetDispatcher()->PostNativeEvent(&xevent);
RunClosureAfterAllPendingUIEvents(closure);
return true;
}
@@ -199,7 +199,7 @@ class UIControlsDesktopX11 : public UIControlsAura {
XEvent xevent = {0};
XButtonEvent* xbutton = &xevent.xbutton;
gfx::Point mouse_loc = aura::Env::GetInstance()->last_mouse_location();
- aura::RootWindow* root_window = RootWindowForPoint(mouse_loc);
+ aura::Window* root_window = RootWindowForPoint(mouse_loc);
aura::client::ScreenPositionClient* screen_position_client =
aura::client::GetScreenPositionClient(root_window);
if (screen_position_client)
@@ -224,12 +224,12 @@ class UIControlsDesktopX11 : public UIControlsAura {
// RootWindow will take care of other necessary fields.
if (state & DOWN) {
xevent.xbutton.type = ButtonPress;
- root_window->PostNativeEvent(&xevent);
+ root_window->GetDispatcher()->PostNativeEvent(&xevent);
button_down_mask |= xbutton->state;
}
if (state & UP) {
xevent.xbutton.type = ButtonRelease;
- root_window->PostNativeEvent(&xevent);
+ root_window->GetDispatcher()->PostNativeEvent(&xevent);
button_down_mask = (button_down_mask | xbutton->state) ^ xbutton->state;
}
RunClosureAfterAllPendingUIEvents(closure);
@@ -255,7 +255,7 @@ class UIControlsDesktopX11 : public UIControlsAura {
new EventWaiter(closure, &Matcher);
}
private:
- aura::RootWindow* RootWindowForPoint(const gfx::Point& point) {
+ aura::Window* RootWindowForPoint(const gfx::Point& point) {
// Most interactive_ui_tests run inside of the aura_test_helper
// environment. This means that we can't rely on gfx::Screen and several
// other things to work properly. Therefore we hack around this by
diff --git a/ui/views/widget/desktop_aura/desktop_drag_drop_client_aurax11.cc b/ui/views/widget/desktop_aura/desktop_drag_drop_client_aurax11.cc
index 2764da1..3b3ae39 100644
--- a/ui/views/widget/desktop_aura/desktop_drag_drop_client_aurax11.cc
+++ b/ui/views/widget/desktop_aura/desktop_drag_drop_client_aurax11.cc
@@ -681,7 +681,7 @@ void DesktopDragDropClientAuraX11::DragTranslate(
scoped_ptr<ui::DropTargetEvent>* event,
aura::client::DragDropDelegate** delegate) {
gfx::Point root_location = root_window_location;
- root_window_->GetRootWindow()->ConvertPointFromNativeScreen(&root_location);
+ root_window_->GetDispatcher()->ConvertPointFromNativeScreen(&root_location);
aura::Window* target_window =
root_window_->GetEventHandlerForPoint(root_location);
bool target_window_changed = false;
diff --git a/ui/views/widget/desktop_aura/desktop_drop_target_win.cc b/ui/views/widget/desktop_aura/desktop_drop_target_win.cc
index 252826a..1a9150f 100644
--- a/ui/views/widget/desktop_aura/desktop_drop_target_win.cc
+++ b/ui/views/widget/desktop_aura/desktop_drop_target_win.cc
@@ -96,7 +96,7 @@ void DesktopDropTargetWin::Translate(
DragDropDelegate** delegate) {
gfx::Point location(position.x, position.y);
gfx::Point root_location = location;
- root_window_->GetRootWindow()->ConvertPointFromNativeScreen(&root_location);
+ root_window_->GetDispatcher()->ConvertPointFromNativeScreen(&root_location);
aura::Window* target_window =
root_window_->GetEventHandlerForPoint(root_location);
bool target_window_changed = false;
diff --git a/ui/views/widget/desktop_aura/desktop_root_window_host_win.cc b/ui/views/widget/desktop_aura/desktop_root_window_host_win.cc
index d448d50..2dad0d9 100644
--- a/ui/views/widget/desktop_aura/desktop_root_window_host_win.cc
+++ b/ui/views/widget/desktop_aura/desktop_root_window_host_win.cc
@@ -79,11 +79,12 @@ aura::Window* DesktopRootWindowHostWin::GetContentWindowForHWND(HWND hwnd) {
ui::NativeTheme* DesktopRootWindowHost::GetNativeTheme(aura::Window* window) {
// Use NativeThemeWin for windows shown on the desktop, those not on the
// desktop come from Ash and get NativeThemeAura.
- aura::RootWindow* root = window ? window->GetRootWindow() : NULL;
- if (root) {
- HWND root_hwnd = root->GetAcceleratedWidget();
- if (root_hwnd &&
- DesktopRootWindowHostWin::GetContentWindowForHWND(root_hwnd)) {
+ aura::WindowEventDispatcher* dispatcher =
+ window ? window->GetDispatcher() : NULL;
+ if (dispatcher) {
+ HWND host_hwnd = dispatcher->GetAcceleratedWidget();
+ if (host_hwnd &&
+ DesktopRootWindowHostWin::GetContentWindowForHWND(host_hwnd)) {
return ui::NativeThemeWin::instance();
}
}
@@ -107,8 +108,8 @@ void DesktopRootWindowHostWin::Init(
native_widget_delegate_);
HWND parent_hwnd = NULL;
- if (params.parent && params.parent->GetRootWindow())
- parent_hwnd = params.parent->GetRootWindow()->GetAcceleratedWidget();
+ if (params.parent && params.parent->GetDispatcher())
+ parent_hwnd = params.parent->GetDispatcher()->GetAcceleratedWidget();
message_handler_->set_remove_standard_frame(params.remove_standard_frame);
diff --git a/ui/views/widget/desktop_aura/desktop_screen_position_client.cc b/ui/views/widget/desktop_aura/desktop_screen_position_client.cc
index 08e5d92..1d21740 100644
--- a/ui/views/widget/desktop_aura/desktop_screen_position_client.cc
+++ b/ui/views/widget/desktop_aura/desktop_screen_position_client.cc
@@ -14,9 +14,9 @@ namespace views {
namespace {
-gfx::Point GetOrigin(const aura::RootWindow* root_window) {
- gfx::Point origin_in_pixels = root_window->GetHostOrigin();
- aura::RootWindow* window = const_cast<aura::RootWindow*>(root_window);
+gfx::Point GetOrigin(const aura::Window* root_window) {
+ gfx::Point origin_in_pixels = root_window->GetDispatcher()->GetHostOrigin();
+ aura::Window* window = const_cast<aura::Window*>(root_window);
float scale = gfx::Screen::GetScreenFor(window)->
GetDisplayNearestWindow(window).device_scale_factor();
return gfx::ToFlooredPoint(
@@ -44,7 +44,7 @@ DesktopScreenPositionClient::~DesktopScreenPositionClient() {
void DesktopScreenPositionClient::ConvertPointToScreen(
const aura::Window* window, gfx::Point* point) {
- const aura::RootWindow* root_window = window->GetRootWindow();
+ const aura::Window* root_window = window->GetRootWindow();
aura::Window::ConvertPointToTarget(window, root_window, point);
gfx::Point origin = GetOrigin(root_window);
point->Offset(origin.x(), origin.y());
@@ -52,7 +52,7 @@ void DesktopScreenPositionClient::ConvertPointToScreen(
void DesktopScreenPositionClient::ConvertPointFromScreen(
const aura::Window* window, gfx::Point* point) {
- const aura::RootWindow* root_window = window->GetRootWindow();
+ const aura::Window* root_window = window->GetRootWindow();
gfx::Point origin = GetOrigin(root_window);
point->Offset(-origin.x(), -origin.y());
aura::Window::ConvertPointToTarget(root_window, window, point);
@@ -60,7 +60,7 @@ void DesktopScreenPositionClient::ConvertPointFromScreen(
void DesktopScreenPositionClient::ConvertHostPointToScreen(
aura::Window* window, gfx::Point* point) {
- aura::RootWindow* root_window = window->GetRootWindow();
+ aura::Window* root_window = window->GetRootWindow();
ConvertPointToScreen(root_window, point);
}
@@ -69,7 +69,7 @@ void DesktopScreenPositionClient::SetBounds(
const gfx::Rect& bounds,
const gfx::Display& display) {
// TODO: Use the 3rd parameter, |display|.
- aura::RootWindow* root = window->GetRootWindow();
+ aura::Window* root = window->GetRootWindow();
if (PositionWindowInScreenCoordinates(window)) {
// The caller expects windows we consider "embedded" to be placed in the
@@ -88,7 +88,7 @@ void DesktopScreenPositionClient::SetBounds(
DesktopNativeWidgetAura* desktop_native_widget =
DesktopNativeWidgetAura::ForWindow(window);
if (desktop_native_widget) {
- root->SetHostBounds(bounds);
+ root->GetDispatcher()->SetHostBounds(bounds);
// Setting bounds of root resizes |window|.
} else {
window->SetBounds(bounds);
diff --git a/ui/views/widget/desktop_aura/desktop_screen_win.cc b/ui/views/widget/desktop_aura/desktop_screen_win.cc
index 93721bce..f1a7767 100644
--- a/ui/views/widget/desktop_aura/desktop_screen_win.cc
+++ b/ui/views/widget/desktop_aura/desktop_screen_win.cc
@@ -53,8 +53,8 @@ gfx::Display DesktopScreenWin::GetDisplayMatching(
}
HWND DesktopScreenWin::GetHWNDFromNativeView(gfx::NativeView window) const {
- aura::RootWindow* root_window = window->GetRootWindow();
- return root_window ? root_window->GetAcceleratedWidget() : NULL;
+ aura::WindowEventDispatcher* dispatcher = window->GetDispatcher();
+ return dispatcher ? dispatcher->GetAcceleratedWidget() : NULL;
}
gfx::NativeWindow DesktopScreenWin::GetNativeWindowFromHWND(HWND hwnd) const {
diff --git a/ui/views/widget/desktop_aura/desktop_screen_x11.cc b/ui/views/widget/desktop_aura/desktop_screen_x11.cc
index 9358875..8d8bd02 100644
--- a/ui/views/widget/desktop_aura/desktop_screen_x11.cc
+++ b/ui/views/widget/desktop_aura/desktop_screen_x11.cc
@@ -187,10 +187,10 @@ gfx::Display DesktopScreenX11::GetDisplayNearestWindow(
// create the aura::RootWindow. So we ask what the DRWHX11 believes the
// window bounds are instead of going through the aura::Window's screen
// bounds.
- aura::RootWindow* root_window = window->GetRootWindow();
- if (root_window) {
+ aura::WindowEventDispatcher* dispatcher = window->GetDispatcher();
+ if (dispatcher) {
DesktopRootWindowHostX11* rwh = DesktopRootWindowHostX11::GetHostForXID(
- root_window->GetAcceleratedWidget());
+ dispatcher->GetAcceleratedWidget());
if (rwh)
return GetDisplayMatching(rwh->GetX11RootWindowBounds());
}
diff --git a/ui/views/widget/desktop_aura/x11_desktop_window_move_client.cc b/ui/views/widget/desktop_aura/x11_desktop_window_move_client.cc
index 273372f..41573fe 100644
--- a/ui/views/widget/desktop_aura/x11_desktop_window_move_client.cc
+++ b/ui/views/widget/desktop_aura/x11_desktop_window_move_client.cc
@@ -50,7 +50,7 @@ aura::client::WindowMoveResult X11DesktopWindowMoveClient::RunMoveLoop(
const gfx::Vector2d& drag_offset,
aura::client::WindowMoveSource move_source) {
window_offset_ = drag_offset;
- root_window_ = source->GetRootWindow();
+ root_window_ = source->GetDispatcher();
bool success = move_loop_.RunMoveLoop(source, root_window_->last_cursor());
return success ? aura::client::MOVE_SUCCESSFUL : aura::client::MOVE_CANCELED;
diff --git a/ui/views/widget/native_widget_aura.cc b/ui/views/widget/native_widget_aura.cc
index 8366092..dd2f7e8 100644
--- a/ui/views/widget/native_widget_aura.cc
+++ b/ui/views/widget/native_widget_aura.cc
@@ -276,7 +276,7 @@ bool NativeWidgetAura::HasCapture() const {
InputMethod* NativeWidgetAura::CreateInputMethod() {
if (!window_)
return NULL;
- aura::RootWindow* root_window = window_->GetRootWindow();
+ aura::Window* root_window = window_->GetRootWindow();
ui::InputMethod* host =
root_window->GetProperty(aura::client::kRootWindowInputMethodKey);
return new InputMethodBridge(this, host, true);
@@ -391,7 +391,7 @@ void NativeWidgetAura::SetBounds(const gfx::Rect& bounds) {
if (!window_)
return;
- aura::RootWindow* root = window_->GetRootWindow();
+ aura::Window* root = window_->GetRootWindow();
if (root) {
aura::client::ScreenPositionClient* screen_position_client =
aura::client::GetScreenPositionClient(root);
@@ -523,7 +523,7 @@ bool NativeWidgetAura::IsActive() const {
// We may up here during destruction of the root, in which case
// GetRootWindow() returns NULL (~RootWindow() has run and we're in ~Window).
- aura::RootWindow* root = window_->GetRootWindow();
+ aura::Window* root = window_->GetRootWindow();
return root &&
aura::client::GetActivationClient(root)->GetActiveWindow() == window_;
}
@@ -1118,7 +1118,7 @@ void NativeWidgetPrivate::ReparentNativeView(gfx::NativeView native_view,
// in this case is the stacking client of the current RootWindow. This
// matches our previous behaviour; the global stacking client would almost
// always reattach the window to the same RootWindow.
- aura::RootWindow* root_window = native_view->GetRootWindow();
+ aura::Window* root_window = native_view->GetRootWindow();
aura::client::ParentWindowWithContext(
native_view, root_window, root_window->GetBoundsInScreen());
}
diff --git a/ui/views/widget/tooltip_manager_aura.cc b/ui/views/widget/tooltip_manager_aura.cc
index dc812b8..6909001 100644
--- a/ui/views/widget/tooltip_manager_aura.cc
+++ b/ui/views/widget/tooltip_manager_aura.cc
@@ -48,9 +48,10 @@ const gfx::FontList& TooltipManagerAura::GetFontList() const {
}
void TooltipManagerAura::UpdateTooltip() {
- aura::RootWindow* root_window = window_->GetRootWindow();
+ aura::Window* root_window = window_->GetRootWindow();
if (aura::client::GetTooltipClient(root_window)) {
- gfx::Point view_point = root_window->GetLastMouseLocationInRoot();
+ gfx::Point view_point =
+ root_window->GetDispatcher()->GetLastMouseLocationInRoot();
aura::Window::ConvertPointToTarget(root_window, window_, &view_point);
View* view = GetViewUnderPoint(view_point);
UpdateTooltipForTarget(view, view_point, root_window);
@@ -58,9 +59,10 @@ void TooltipManagerAura::UpdateTooltip() {
}
void TooltipManagerAura::TooltipTextChanged(View* view) {
- aura::RootWindow* root_window = window_->GetRootWindow();
+ aura::Window* root_window = window_->GetRootWindow();
if (aura::client::GetTooltipClient(root_window)) {
- gfx::Point view_point = root_window->GetLastMouseLocationInRoot();
+ gfx::Point view_point =
+ root_window->GetDispatcher()->GetLastMouseLocationInRoot();
aura::Window::ConvertPointToTarget(root_window, window_, &view_point);
View* target = GetViewUnderPoint(view_point);
if (target != view)
@@ -78,7 +80,7 @@ View* TooltipManagerAura::GetViewUnderPoint(const gfx::Point& point) {
void TooltipManagerAura::UpdateTooltipForTarget(View* target,
const gfx::Point& point,
- aura::RootWindow* root_window) {
+ aura::Window* root_window) {
if (target) {
gfx::Point view_point = point;
View::ConvertPointFromWidget(target, &view_point);
diff --git a/ui/views/widget/tooltip_manager_aura.h b/ui/views/widget/tooltip_manager_aura.h
index 009d7e6..3915492 100644
--- a/ui/views/widget/tooltip_manager_aura.h
+++ b/ui/views/widget/tooltip_manager_aura.h
@@ -11,7 +11,6 @@
#include "ui/views/widget/tooltip_manager.h"
namespace aura {
-class RootWindow;
class Window;
}
@@ -41,7 +40,7 @@ class TooltipManagerAura : public TooltipManager {
View* GetViewUnderPoint(const gfx::Point& point);
void UpdateTooltipForTarget(View* target,
const gfx::Point& point,
- aura::RootWindow* root_window);
+ aura::Window* root_window);
aura::Window* window_;
Widget* widget_;
diff --git a/ui/views/widget/widget_interactive_uitest.cc b/ui/views/widget/widget_interactive_uitest.cc
index 8c10ccc3..f08fe8b 100644
--- a/ui/views/widget/widget_interactive_uitest.cc
+++ b/ui/views/widget/widget_interactive_uitest.cc
@@ -171,7 +171,7 @@ TEST_F(WidgetTest, DesktopNativeWidgetAuraActivationAndFocusTest) {
widget1.Init(init_params);
widget1.SetContentsView(contents_view1);
widget1.Show();
- aura::RootWindow* root_window1= widget1.GetNativeView()->GetRootWindow();
+ aura::Window* root_window1= widget1.GetNativeView()->GetRootWindow();
contents_view1->RequestFocus();
EXPECT_TRUE(root_window1 != NULL);
@@ -191,9 +191,9 @@ TEST_F(WidgetTest, DesktopNativeWidgetAuraActivationAndFocusTest) {
widget2.Init(init_params2);
widget2.SetContentsView(contents_view2);
widget2.Show();
- aura::RootWindow* root_window2 = widget2.GetNativeView()->GetRootWindow();
+ aura::Window* root_window2 = widget2.GetNativeView()->GetRootWindow();
contents_view2->RequestFocus();
- ::SetActiveWindow(root_window2->GetAcceleratedWidget());
+ ::SetActiveWindow(root_window2->GetDispatcher()->GetAcceleratedWidget());
aura::client::ActivationClient* activation_client2 =
aura::client::GetActivationClient(root_window2);
@@ -205,7 +205,7 @@ TEST_F(WidgetTest, DesktopNativeWidgetAuraActivationAndFocusTest) {
// Now set focus back to widget 1 and expect the active window to be its
// window.
contents_view1->RequestFocus();
- ::SetActiveWindow(root_window1->GetAcceleratedWidget());
+ ::SetActiveWindow(root_window1->GetDispatcher()->GetAcceleratedWidget());
EXPECT_EQ(activation_client2->GetActiveWindow(),
reinterpret_cast<aura::Window*>(NULL));
EXPECT_EQ(activation_client1->GetActiveWindow(), widget1.GetNativeView());
@@ -732,9 +732,8 @@ TEST_F(WidgetCaptureTest, MAYBE_MouseEventDispatchedToRightWindow) {
// |widget2| has capture, |widget1| should still get the event.
ui::MouseEvent mouse_event(ui::ET_MOUSE_EXITED, gfx::Point(), gfx::Point(),
ui::EF_NONE);
- static_cast<aura::RootWindowHostDelegate*>(
- widget1.GetNativeWindow()->GetRootWindow())->OnHostMouseEvent(
- &mouse_event);
+ widget1.GetNativeWindow()->GetDispatcher()->AsRootWindowHostDelegate()->
+ OnHostMouseEvent(&mouse_event);
EXPECT_TRUE(widget1.GetAndClearGotMouseEvent());
EXPECT_FALSE(widget2.GetAndClearGotMouseEvent());
}
diff --git a/ui/views/widget/widget_unittest.cc b/ui/views/widget/widget_unittest.cc
index dcc4f0d..abdb000 100644
--- a/ui/views/widget/widget_unittest.cc
+++ b/ui/views/widget/widget_unittest.cc
@@ -1310,7 +1310,7 @@ void GenerateMouseEvents(Widget* widget, ui::EventType last_event_type) {
ui::MouseEvent move_event(ui::ET_MOUSE_MOVED, screen_bounds.CenterPoint(),
screen_bounds.CenterPoint(), 0);
aura::RootWindowHostDelegate* rwhd =
- widget->GetNativeWindow()->GetRootWindow()->AsRootWindowHostDelegate();
+ widget->GetNativeWindow()->GetDispatcher()->AsRootWindowHostDelegate();
rwhd->OnHostMouseEvent(&move_event);
if (last_event_type == ui::ET_MOUSE_ENTERED)
return;
@@ -2017,7 +2017,7 @@ TEST_F(WidgetTest, WindowMouseModalityTest) {
cursor_location_main,
cursor_location_main,
ui::EF_NONE);
- top_level_widget.GetNativeView()->GetRootWindow()->
+ top_level_widget.GetNativeView()->GetDispatcher()->
AsRootWindowHostDelegate()->OnHostMouseEvent(&move_main);
EXPECT_EQ(1, widget_view->GetEventCount(ui::ET_MOUSE_ENTERED));
@@ -2043,7 +2043,7 @@ TEST_F(WidgetTest, WindowMouseModalityTest) {
cursor_location_dialog,
cursor_location_dialog,
ui::EF_NONE);
- top_level_widget.GetNativeView()->GetRootWindow()->
+ top_level_widget.GetNativeView()->GetDispatcher()->
AsRootWindowHostDelegate()->OnHostMouseEvent(&mouse_down_dialog);
EXPECT_EQ(1, dialog_widget_view->GetEventCount(ui::ET_MOUSE_PRESSED));
@@ -2054,7 +2054,7 @@ TEST_F(WidgetTest, WindowMouseModalityTest) {
cursor_location_main2,
cursor_location_main2,
ui::EF_NONE);
- top_level_widget.GetNativeView()->GetRootWindow()->
+ top_level_widget.GetNativeView()->GetDispatcher()->
AsRootWindowHostDelegate()->OnHostMouseEvent(&mouse_down_main);
EXPECT_EQ(0, widget_view->GetEventCount(ui::ET_MOUSE_MOVED));
diff --git a/ui/views/win/hwnd_util_aurawin.cc b/ui/views/win/hwnd_util_aurawin.cc
index 6062478..a927df1 100644
--- a/ui/views/win/hwnd_util_aurawin.cc
+++ b/ui/views/win/hwnd_util_aurawin.cc
@@ -19,21 +19,21 @@ HWND HWNDForWidget(const Widget* widget) {
HWND HWNDForNativeView(const gfx::NativeView view) {
return view && view->GetRootWindow() ?
- view->GetRootWindow()->GetAcceleratedWidget() : NULL;
+ view->GetDispatcher()->GetAcceleratedWidget() : NULL;
}
HWND HWNDForNativeWindow(const gfx::NativeWindow window) {
return window && window->GetRootWindow() ?
- window->GetRootWindow()->GetAcceleratedWidget() : NULL;
+ window->GetDispatcher()->GetAcceleratedWidget() : NULL;
}
gfx::Rect GetWindowBoundsForClientBounds(View* view,
const gfx::Rect& client_bounds) {
DCHECK(view);
- aura::RootWindow* window =
- view->GetWidget()->GetNativeWindow()->GetRootWindow();
- if (window) {
- HWND hwnd = window->GetAcceleratedWidget();
+ aura::WindowEventDispatcher* dispatcher =
+ view->GetWidget()->GetNativeWindow()->GetDispatcher();
+ if (dispatcher) {
+ HWND hwnd = dispatcher->GetAcceleratedWidget();
RECT rect = client_bounds.ToRECT();
DWORD style = ::GetWindowLong(hwnd, GWL_STYLE);
DWORD ex_style = ::GetWindowLong(hwnd, GWL_EXSTYLE);