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 <X11/keysym.h> | 7 #include <X11/keysym.h> |
8 #include <X11/Xlib.h> | 8 #include <X11/Xlib.h> |
9 | 9 |
10 #include "base/callback.h" | 10 #include "base/callback.h" |
11 #include "base/logging.h" | 11 #include "base/logging.h" |
12 #include "base/message_pump_x.h" | 12 #include "base/message_pump_x.h" |
13 #include "chrome/browser/automation/ui_controls_internal.h" | 13 #include "chrome/browser/automation/ui_controls_internal.h" |
14 #include "ui/aura/desktop.h" | 14 #include "ui/aura/desktop.h" |
15 #include "ui/base/keycodes/keyboard_code_conversion_x.h" | 15 #include "ui/base/keycodes/keyboard_code_conversion_x.h" |
16 #include "views/view.h" | 16 #include "ui/views/view.h" |
17 | 17 |
18 namespace { | 18 namespace { |
19 | 19 |
20 // Event waiter executes the specified closure|when a matching event | 20 // Event waiter executes the specified closure|when a matching event |
21 // is found. | 21 // is found. |
22 // TODO(oshima): Move this to base. | 22 // TODO(oshima): Move this to base. |
23 class EventWaiter : public MessageLoopForUI::Observer { | 23 class EventWaiter : public MessageLoopForUI::Observer { |
24 public: | 24 public: |
25 typedef bool (*EventWaiterMatcher)(const base::NativeEvent& event); | 25 typedef bool (*EventWaiterMatcher)(const base::NativeEvent& event); |
26 | 26 |
(...skipping 191 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
218 int state, const base::Closure& closure) { | 218 int state, const base::Closure& closure) { |
219 DCHECK(view); | 219 DCHECK(view); |
220 DCHECK(view->GetWidget()); | 220 DCHECK(view->GetWidget()); |
221 gfx::Point view_center(view->width() / 2, view->height() / 2); | 221 gfx::Point view_center(view->width() / 2, view->height() / 2); |
222 views::View::ConvertPointToScreen(view, &view_center); | 222 views::View::ConvertPointToScreen(view, &view_center); |
223 SendMouseMove(view_center.x(), view_center.y()); | 223 SendMouseMove(view_center.x(), view_center.y()); |
224 SendMouseEventsNotifyWhenDone(button, state, closure); | 224 SendMouseEventsNotifyWhenDone(button, state, closure); |
225 } | 225 } |
226 | 226 |
227 } // namespace ui_controls | 227 } // namespace ui_controls |
OLD | NEW |