| Index: ui/aura/test/ui_controls_factory_aurax11.cc
|
| diff --git a/ui/aura/test/ui_controls_factory_aurax11.cc b/ui/aura/test/ui_controls_factory_aurax11.cc
|
| index 452acabc4ecd2c560926ca7e6f1cbed77ee49fa2..e763c8e2f5e11c6b82a127e531339a5a63b557d1 100644
|
| --- a/ui/aura/test/ui_controls_factory_aurax11.cc
|
| +++ b/ui/aura/test/ui_controls_factory_aurax11.cc
|
| @@ -10,7 +10,7 @@
|
| #include "ui/aura/env.h"
|
| #include "ui/aura/test/ui_controls_factory_aura.h"
|
| #include "ui/aura/window.h"
|
| -#include "ui/aura/window_event_dispatcher.h"
|
| +#include "ui/aura/window_tree_host.h"
|
| #include "ui/base/test/ui_controls_aura.h"
|
| #include "ui/base/x/x11_util.h"
|
| #include "ui/compositor/dip_util.h"
|
| @@ -80,7 +80,7 @@ bool Matcher(const base::NativeEvent& event) {
|
|
|
| class UIControlsX11 : public UIControlsAura {
|
| public:
|
| - UIControlsX11(WindowEventDispatcher* dispatcher) : dispatcher_(dispatcher) {
|
| + UIControlsX11(WindowTreeHost* host) : host_(host) {
|
| }
|
|
|
| virtual bool SendKeyPress(gfx::NativeWindow window,
|
| @@ -113,11 +113,11 @@ class UIControlsX11 : public UIControlsAura {
|
| xevent.xkey.keycode =
|
| XKeysymToKeycode(gfx::GetXDisplay(),
|
| ui::XKeysymForWindowsKeyCode(key, shift));
|
| - dispatcher_->host()->PostNativeEvent(&xevent);
|
| + host_->PostNativeEvent(&xevent);
|
|
|
| // Send key release events.
|
| xevent.xkey.type = KeyRelease;
|
| - dispatcher_->host()->PostNativeEvent(&xevent);
|
| + host_->PostNativeEvent(&xevent);
|
| if (alt)
|
| UnmaskAndSetKeycodeThenSend(&xevent, Mod1Mask, XK_Alt_L);
|
| if (shift)
|
| @@ -138,19 +138,19 @@ class UIControlsX11 : public UIControlsAura {
|
| const base::Closure& closure) OVERRIDE {
|
| gfx::Point root_location(screen_x, screen_y);
|
| aura::client::ScreenPositionClient* screen_position_client =
|
| - aura::client::GetScreenPositionClient(dispatcher_->window());
|
| + aura::client::GetScreenPositionClient(host_->window());
|
| if (screen_position_client) {
|
| - screen_position_client->ConvertPointFromScreen(dispatcher_->window(),
|
| + screen_position_client->ConvertPointFromScreen(host_->window(),
|
| &root_location);
|
| }
|
| gfx::Point root_current_location;
|
| - dispatcher_->host()->QueryMouseLocation(&root_current_location);
|
| - dispatcher_->host()->ConvertPointFromHost(&root_current_location);
|
| + host_->QueryMouseLocation(&root_current_location);
|
| + host_->ConvertPointFromHost(&root_current_location);
|
|
|
| if (root_location != root_current_location && button_down_mask == 0) {
|
| // Move the cursor because EnterNotify/LeaveNotify are generated with the
|
| // current mouse position as a result of XGrabPointer()
|
| - dispatcher_->window()->MoveCursorTo(root_location);
|
| + host_->window()->MoveCursorTo(root_location);
|
| } else {
|
| XEvent xevent = {0};
|
| XMotionEvent* xmotion = &xevent.xmotion;
|
| @@ -159,8 +159,8 @@ class UIControlsX11 : public UIControlsAura {
|
| xmotion->y = root_location.y();
|
| xmotion->state = button_down_mask;
|
| xmotion->same_screen = True;
|
| - // WindowEventDispatcher will take care of other necessary fields.
|
| - dispatcher_->host()->PostNativeEvent(&xevent);
|
| + // WindowTreeHost will take care of other necessary fields.
|
| + host_->PostNativeEvent(&xevent);
|
| }
|
| RunClosureAfterAllPendingUIEvents(closure);
|
| return true;
|
| @@ -176,9 +176,9 @@ class UIControlsX11 : public UIControlsAura {
|
| XButtonEvent* xbutton = &xevent.xbutton;
|
| gfx::Point mouse_loc = aura::Env::GetInstance()->last_mouse_location();
|
| aura::client::ScreenPositionClient* screen_position_client =
|
| - aura::client::GetScreenPositionClient(dispatcher_->window());
|
| + aura::client::GetScreenPositionClient(host_->window());
|
| if (screen_position_client) {
|
| - screen_position_client->ConvertPointFromScreen(dispatcher_->window(),
|
| + screen_position_client->ConvertPointFromScreen(host_->window(),
|
| &mouse_loc);
|
| }
|
| xbutton->x = mouse_loc.x();
|
| @@ -201,12 +201,12 @@ class UIControlsX11 : public UIControlsAura {
|
| // WindowEventDispatcher will take care of other necessary fields.
|
| if (state & DOWN) {
|
| xevent.xbutton.type = ButtonPress;
|
| - dispatcher_->host()->PostNativeEvent(&xevent);
|
| + host_->PostNativeEvent(&xevent);
|
| button_down_mask |= xbutton->state;
|
| }
|
| if (state & UP) {
|
| xevent.xbutton.type = ButtonRelease;
|
| - dispatcher_->host()->PostNativeEvent(&xevent);
|
| + host_->PostNativeEvent(&xevent);
|
| button_down_mask = (button_down_mask | xbutton->state) ^ xbutton->state;
|
| }
|
| RunClosureAfterAllPendingUIEvents(closure);
|
| @@ -228,7 +228,7 @@ class UIControlsX11 : public UIControlsAura {
|
| marker_event->xclient.format = 8;
|
| }
|
| marker_event->xclient.message_type = MarkerEventAtom();
|
| - dispatcher_->host()->PostNativeEvent(marker_event);
|
| + host_->PostNativeEvent(marker_event);
|
| new EventWaiter(closure, &Matcher);
|
| }
|
| private:
|
| @@ -237,7 +237,7 @@ class UIControlsX11 : public UIControlsAura {
|
| unsigned int mask) {
|
| xevent->xkey.keycode =
|
| XKeysymToKeycode(gfx::GetXDisplay(), keysym);
|
| - dispatcher_->host()->PostNativeEvent(xevent);
|
| + host_->PostNativeEvent(xevent);
|
| xevent->xkey.state |= mask;
|
| }
|
|
|
| @@ -247,18 +247,18 @@ class UIControlsX11 : public UIControlsAura {
|
| xevent->xkey.state ^= mask;
|
| xevent->xkey.keycode =
|
| XKeysymToKeycode(gfx::GetXDisplay(), keysym);
|
| - dispatcher_->host()->PostNativeEvent(xevent);
|
| + host_->PostNativeEvent(xevent);
|
| }
|
|
|
| - WindowEventDispatcher* dispatcher_;
|
| + WindowTreeHost* host_;
|
|
|
| DISALLOW_COPY_AND_ASSIGN(UIControlsX11);
|
| };
|
|
|
| } // namespace
|
|
|
| -UIControlsAura* CreateUIControlsAura(WindowEventDispatcher* dispatcher) {
|
| - return new UIControlsX11(dispatcher);
|
| +UIControlsAura* CreateUIControlsAura(WindowTreeHost* host) {
|
| + return new UIControlsX11(host);
|
| }
|
|
|
| } // namespace test
|
|
|