Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1650)

Unified Diff: ui/views/test/ui_controls_factory_desktop_aurax11.cc

Issue 184903003: Window ownership -> WindowTreeHost (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . Created 6 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ui/views/event_utils_aura.cc ('k') | ui/views/widget/desktop_aura/desktop_capture_client.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/views/test/ui_controls_factory_desktop_aurax11.cc
diff --git a/ui/views/test/ui_controls_factory_desktop_aurax11.cc b/ui/views/test/ui_controls_factory_desktop_aurax11.cc
index 2819c5b17f6f87656a193a5b99c040aac89cd226..75abae60c865a32f11b3f19b022e72685a921c42 100644
--- a/ui/views/test/ui_controls_factory_desktop_aurax11.cc
+++ b/ui/views/test/ui_controls_factory_desktop_aurax11.cc
@@ -125,33 +125,31 @@ class UIControlsDesktopX11 : public UIControlsAura {
const base::Closure& closure) OVERRIDE {
DCHECK(!command); // No command key on Aura
- aura::WindowEventDispatcher* dispatcher = window->GetDispatcher();
+ aura::WindowTreeHost* host = window->GetHost();
XEvent xevent = {0};
xevent.xkey.type = KeyPress;
if (control) {
- SetKeycodeAndSendThenMask(dispatcher, &xevent, XK_Control_L,
- ControlMask);
+ SetKeycodeAndSendThenMask(host, &xevent, XK_Control_L, ControlMask);
}
if (shift)
- SetKeycodeAndSendThenMask(dispatcher, &xevent, XK_Shift_L, ShiftMask);
+ SetKeycodeAndSendThenMask(host, &xevent, XK_Shift_L, ShiftMask);
if (alt)
- SetKeycodeAndSendThenMask(dispatcher, &xevent, XK_Alt_L, Mod1Mask);
+ SetKeycodeAndSendThenMask(host, &xevent, XK_Alt_L, Mod1Mask);
xevent.xkey.keycode =
XKeysymToKeycode(x_display_,
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(dispatcher, &xevent, Mod1Mask, XK_Alt_L);
+ UnmaskAndSetKeycodeThenSend(host, &xevent, Mod1Mask, XK_Alt_L);
if (shift)
- UnmaskAndSetKeycodeThenSend(dispatcher, &xevent, ShiftMask, XK_Shift_L);
+ UnmaskAndSetKeycodeThenSend(host, &xevent, ShiftMask, XK_Shift_L);
if (control) {
- UnmaskAndSetKeycodeThenSend(dispatcher, &xevent, ControlMask,
- XK_Control_L);
+ UnmaskAndSetKeycodeThenSend(host, &xevent, ControlMask, XK_Control_L);
}
DCHECK(!xevent.xkey.state);
RunClosureAfterAllPendingUIEvents(closure);
@@ -176,10 +174,10 @@ class UIControlsDesktopX11 : public UIControlsAura {
&root_location);
}
- aura::WindowEventDispatcher* dispatcher = root_window->GetDispatcher();
+ aura::WindowTreeHost* host = root_window->GetHost();
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
@@ -194,7 +192,7 @@ class UIControlsDesktopX11 : public UIControlsAura {
xmotion->state = button_down_mask;
xmotion->same_screen = True;
// RootWindow will take care of other necessary fields.
- dispatcher->host()->PostNativeEvent(&xevent);
+ host->PostNativeEvent(&xevent);
}
RunClosureAfterAllPendingUIEvents(closure);
return true;
@@ -234,12 +232,12 @@ class UIControlsDesktopX11 : public UIControlsAura {
// RootWindow will take care of other necessary fields.
if (state & DOWN) {
xevent.xbutton.type = ButtonPress;
- root_window->GetDispatcher()->host()->PostNativeEvent(&xevent);
+ root_window->GetHost()->PostNativeEvent(&xevent);
button_down_mask |= xbutton->state;
}
if (state & UP) {
xevent.xbutton.type = ButtonRelease;
- root_window->GetDispatcher()->host()->PostNativeEvent(&xevent);
+ root_window->GetHost()->PostNativeEvent(&xevent);
button_down_mask = (button_down_mask | xbutton->state) ^ xbutton->state;
}
RunClosureAfterAllPendingUIEvents(closure);
@@ -285,22 +283,22 @@ class UIControlsDesktopX11 : public UIControlsAura {
return NULL;
}
- void SetKeycodeAndSendThenMask(aura::WindowEventDispatcher* dispatcher,
+ void SetKeycodeAndSendThenMask(aura::WindowTreeHost* host,
XEvent* xevent,
KeySym keysym,
unsigned int mask) {
xevent->xkey.keycode = XKeysymToKeycode(x_display_, keysym);
- dispatcher->host()->PostNativeEvent(xevent);
+ host->PostNativeEvent(xevent);
xevent->xkey.state |= mask;
}
- void UnmaskAndSetKeycodeThenSend(aura::WindowEventDispatcher* dispatcher,
+ void UnmaskAndSetKeycodeThenSend(aura::WindowTreeHost* host,
XEvent* xevent,
unsigned int mask,
KeySym keysym) {
xevent->xkey.state ^= mask;
xevent->xkey.keycode = XKeysymToKeycode(x_display_, keysym);
- dispatcher->host()->PostNativeEvent(xevent);
+ host->PostNativeEvent(xevent);
}
// Our X11 state.
« no previous file with comments | « ui/views/event_utils_aura.cc ('k') | ui/views/widget/desktop_aura/desktop_capture_client.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698