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" |
11 #include "base/logging.h" | 11 #include "base/logging.h" |
12 #include "base/message_loop.h" | 12 #include "base/message_loop.h" |
13 #include "chrome/browser/automation/ui_controls_internal.h" | 13 #include "chrome/browser/automation/ui_controls_internal.h" |
14 #include "chrome/browser/ui/gtk/gtk_util.h" | 14 #include "chrome/browser/ui/gtk/gtk_util.h" |
15 #include "chrome/common/automation_constants.h" | 15 #include "chrome/common/automation_constants.h" |
16 #include "ui/base/gtk/event_synthesis_gtk.h" | 16 #include "ui/base/gtk/event_synthesis_gtk.h" |
17 #include "ui/gfx/rect.h" | 17 #include "ui/gfx/rect.h" |
18 | 18 |
19 #if defined(TOOLKIT_VIEWS) | 19 #if defined(TOOLKIT_VIEWS) |
| 20 #include "ui/views/widget/widget.h" |
20 #include "views/view.h" | 21 #include "views/view.h" |
21 #include "views/widget/widget.h" | |
22 #endif | 22 #endif |
23 | 23 |
24 namespace { | 24 namespace { |
25 | 25 |
26 // static | 26 // static |
27 guint32 XTimeNow() { | 27 guint32 XTimeNow() { |
28 struct timespec ts; | 28 struct timespec ts; |
29 clock_gettime(CLOCK_MONOTONIC, &ts); | 29 clock_gettime(CLOCK_MONOTONIC, &ts); |
30 return ts.tv_sec * 1000 + ts.tv_nsec / 1000000; | 30 return ts.tv_sec * 1000 + ts.tv_nsec / 1000000; |
31 } | 31 } |
(...skipping 279 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
311 const base::Closure& task) { | 311 const base::Closure& task) { |
312 gfx::Rect bounds = gtk_util::GetWidgetScreenBounds(widget); | 312 gfx::Rect bounds = gtk_util::GetWidgetScreenBounds(widget); |
313 SendMouseMoveNotifyWhenDone( | 313 SendMouseMoveNotifyWhenDone( |
314 bounds.x() + bounds.width() / 2, | 314 bounds.x() + bounds.width() / 2, |
315 bounds.y() + bounds.height() / 2, | 315 bounds.y() + bounds.height() / 2, |
316 base::Bind(&ui_controls::ClickTask, button, state, task)); | 316 base::Bind(&ui_controls::ClickTask, button, state, task)); |
317 } | 317 } |
318 #endif | 318 #endif |
319 | 319 |
320 } // namespace ui_controls | 320 } // namespace ui_controls |
OLD | NEW |