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

Unified Diff: chrome/browser/automation/ui_controls_aurax11.cc

Issue 8872057: Makes ui_controls_aurax11 maintain button state so that it can send (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 9 years 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/automation/ui_controls_aurax11.cc
diff --git a/chrome/browser/automation/ui_controls_aurax11.cc b/chrome/browser/automation/ui_controls_aurax11.cc
index 2080a1dc15f30af59cd951f05e7cba10956895a3..bc23fb4452fe397e4be96273c44ddcfc1e6361bd 100644
--- a/chrome/browser/automation/ui_controls_aurax11.cc
+++ b/chrome/browser/automation/ui_controls_aurax11.cc
@@ -22,6 +22,9 @@
namespace {
+// Mask of the buttons currently down.
+unsigned button_down_mask = 0;
+
// Event waiter executes the specified closure|when a matching event
// is found.
// TODO(oshima): Move this to base.
@@ -155,6 +158,7 @@ bool SendMouseMoveNotifyWhenDone(long x, long y, const base::Closure& closure) {
xmotion->type = MotionNotify;
g_current_x = xmotion->x = x;
g_current_y = xmotion->y = y;
+ xmotion->state = button_down_mask;
xmotion->same_screen = True;
// RootWindow will take care of other necessary fields.
aura::RootWindow::GetInstance()->PostNativeEvent(&xevent);
@@ -196,10 +200,12 @@ bool SendMouseEventsNotifyWhenDone(MouseButton type,
if (state & DOWN) {
xevent.xbutton.type = ButtonPress;
root_window->PostNativeEvent(&xevent);
+ button_down_mask |= xbutton->state;
}
if (state & UP) {
xevent.xbutton.type = ButtonRelease;
root_window->PostNativeEvent(&xevent);
+ button_down_mask = (button_down_mask | xbutton->state) ^ xbutton->state;
}
RunClosureAfterAllPendingUIEvents(closure);
return true;
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698