OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "chrome/browser/automation/ui_controls.h" | 5 #include "chrome/browser/automation/ui_controls.h" |
6 | 6 |
7 #include <gdk/gdkkeysyms.h> | 7 #include <gdk/gdkkeysyms.h> |
8 #include <gtk/gtk.h> | 8 #include <gtk/gtk.h> |
9 | 9 |
10 #include "base/bind.h" | 10 #include "base/bind.h" |
(...skipping 292 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
303 int state, | 303 int state, |
304 const base::Closure& task) { | 304 const base::Closure& task) { |
305 gfx::Rect bounds = gtk_util::GetWidgetScreenBounds(widget); | 305 gfx::Rect bounds = gtk_util::GetWidgetScreenBounds(widget); |
306 SendMouseMoveNotifyWhenDone( | 306 SendMouseMoveNotifyWhenDone( |
307 bounds.x() + bounds.width() / 2, | 307 bounds.x() + bounds.width() / 2, |
308 bounds.y() + bounds.height() / 2, | 308 bounds.y() + bounds.height() / 2, |
309 base::Bind(&ui_controls::internal::ClickTask, button, state, task)); | 309 base::Bind(&ui_controls::internal::ClickTask, button, state, task)); |
310 } | 310 } |
311 #endif | 311 #endif |
312 | 312 |
| 313 #if defined(TOOLKIT_VIEWS) |
| 314 void RunClosureAfterAllPendingUIEvents(const base::Closure& task) { |
| 315 // Send noop event and run task. |
| 316 int x, y; |
| 317 gdk_window_at_pointer(&x, &y); |
| 318 SendMouseMoveNotifyWhenDone(x, y, task); |
| 319 } |
| 320 #endif |
| 321 |
313 } // namespace ui_controls | 322 } // namespace ui_controls |
OLD | NEW |