Index: chrome/browser/automation/ui_controls_aurax11.cc |
=================================================================== |
--- chrome/browser/automation/ui_controls_aurax11.cc (revision 113187) |
+++ chrome/browser/automation/ui_controls_aurax11.cc (working copy) |
@@ -70,22 +70,6 @@ |
event->xclient.message_type == MarkerEventAtom(); |
} |
-void RunClosureAfterEvents(const base::Closure closure) { |
- if (closure.is_null()) |
- return; |
- static XEvent* marker_event = NULL; |
- if (!marker_event) { |
- marker_event = new XEvent(); |
- marker_event->xclient.type = ClientMessage; |
- marker_event->xclient.display = NULL; |
- marker_event->xclient.window = None; |
- marker_event->xclient.format = 8; |
- } |
- marker_event->xclient.message_type = MarkerEventAtom(); |
- aura::Desktop::GetInstance()->PostNativeEvent(marker_event); |
- new EventWaiter(closure, &Matcher); |
-} |
- |
} // namespace |
namespace ui_controls { |
@@ -133,9 +117,7 @@ |
SetMaskAndKeycodeThenSend(&xevent, ShiftMask, XK_Shift_L); |
if (alt) |
SetMaskAndKeycodeThenSend(&xevent, Mod1Mask, XK_Alt_L); |
- xevent.xkey.keycode = |
- XKeysymToKeycode(base::MessagePumpX::GetDefaultXDisplay(), |
- ui::XKeysymForWindowsKeyCode(key, shift)); |
+ xevent.xkey.keycode = ui::XKeysymForWindowsKeyCode(key, shift); |
aura::Desktop::GetInstance()->PostNativeEvent(&xevent); |
// Send key release events. |
@@ -148,7 +130,7 @@ |
if (control) |
SetKeycodeAndSendThenUnmask(&xevent, ControlMask, XK_Control_L); |
DCHECK(!xevent.xkey.state); |
- RunClosureAfterEvents(closure); |
+ RunClosureAfterAllPendingUIEvents(closure); |
return true; |
} |
@@ -165,7 +147,7 @@ |
xmotion->same_screen = True; |
// Desktop will take care of other necessary fields. |
aura::Desktop::GetInstance()->PostNativeEvent(&xevent); |
- RunClosureAfterEvents(closure); |
+ RunClosureAfterAllPendingUIEvents(closure); |
return false; |
} |
@@ -208,7 +190,7 @@ |
xevent.xbutton.type = ButtonRelease; |
desktop->PostNativeEvent(&xevent); |
} |
- RunClosureAfterEvents(closure); |
+ RunClosureAfterAllPendingUIEvents(closure); |
return false; |
} |
@@ -226,4 +208,20 @@ |
SendMouseEventsNotifyWhenDone(button, state, closure); |
} |
+void RunClosureAfterAllPendingUIEvents(const base::Closure& closure) { |
+ if (closure.is_null()) |
+ return; |
+ static XEvent* marker_event = NULL; |
+ if (!marker_event) { |
+ marker_event = new XEvent(); |
+ marker_event->xclient.type = ClientMessage; |
+ marker_event->xclient.display = NULL; |
+ marker_event->xclient.window = None; |
+ marker_event->xclient.format = 8; |
+ } |
+ marker_event->xclient.message_type = MarkerEventAtom(); |
+ aura::Desktop::GetInstance()->PostNativeEvent(marker_event); |
+ new EventWaiter(closure, &Matcher); |
+} |
+ |
} // namespace ui_controls |