OLD | NEW |
1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 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 #ifndef CHROME_BROWSER_AUTOMATION_UI_CONTROLS_H_ | 5 #ifndef CHROME_BROWSER_AUTOMATION_UI_CONTROLS_H_ |
6 #define CHROME_BROWSER_AUTOMATION_UI_CONTROLS_H_ | 6 #define CHROME_BROWSER_AUTOMATION_UI_CONTROLS_H_ |
7 | 7 |
8 #include "build/build_config.h" | 8 #include "build/build_config.h" |
9 | 9 |
10 #include <string> | 10 #include <string> |
11 | 11 |
12 #if defined(OS_WIN) | 12 #if defined(OS_WIN) |
13 #include <wtypes.h> | 13 #include <wtypes.h> |
14 #endif | 14 #endif |
15 | 15 |
16 #include "base/gfx/native_widget_types.h" | 16 #include "base/gfx/native_widget_types.h" |
17 #include "base/gfx/point.h" | 17 #include "base/gfx/point.h" |
18 | 18 |
| 19 #if defined(TOOLKIT_VIEWS) |
19 namespace views { | 20 namespace views { |
20 class View; | 21 class View; |
21 } | 22 } |
| 23 #endif |
22 | 24 |
23 class Task; | 25 class Task; |
24 | 26 |
25 namespace ui_controls { | 27 namespace ui_controls { |
26 | 28 |
27 // Many of the functions in this class include a variant that takes a Task. | 29 // Many of the functions in this class include a variant that takes a Task. |
28 // The version that takes a Task waits until the generated event is processed. | 30 // The version that takes a Task waits until the generated event is processed. |
29 // Once the generated event is processed the Task is Run (and deleted). Note | 31 // Once the generated event is processed the Task is Run (and deleted). Note |
30 // that this is a somewhat fragile process in that any event of the correct | 32 // that this is a somewhat fragile process in that any event of the correct |
31 // type (key down, mouse click, etc.) will trigger the Task to be run. Hence | 33 // type (key down, mouse click, etc.) will trigger the Task to be run. Hence |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
66 // the cursor currently is, so be sure to move the cursor before calling this | 68 // the cursor currently is, so be sure to move the cursor before calling this |
67 // (and be sure the cursor has arrived!). | 69 // (and be sure the cursor has arrived!). |
68 bool SendMouseEvents(MouseButton type, int state); | 70 bool SendMouseEvents(MouseButton type, int state); |
69 bool SendMouseEventsNotifyWhenDone(MouseButton type, int state, Task* task); | 71 bool SendMouseEventsNotifyWhenDone(MouseButton type, int state, Task* task); |
70 // Same as SendMouseEvents with UP | DOWN. | 72 // Same as SendMouseEvents with UP | DOWN. |
71 bool SendMouseClick(MouseButton type); | 73 bool SendMouseClick(MouseButton type); |
72 | 74 |
73 // A combination of SendMouseMove to the middle of the view followed by | 75 // A combination of SendMouseMove to the middle of the view followed by |
74 // SendMouseEvents. | 76 // SendMouseEvents. |
75 void MoveMouseToCenterAndPress( | 77 void MoveMouseToCenterAndPress( |
76 #if defined(OS_WIN) | 78 #if defined(TOOLKIT_VIEWS) |
77 views::View* view, | 79 views::View* view, |
78 #elif defined(OS_LINUX) | 80 #elif defined(OS_LINUX) |
79 GtkWidget* widget, | 81 GtkWidget* widget, |
80 #endif | 82 #endif |
81 MouseButton button, | 83 MouseButton button, |
82 int state, | 84 int state, |
83 Task* task); | 85 Task* task); |
84 | 86 |
85 } // ui_controls | 87 } // ui_controls |
86 | 88 |
87 #endif // CHROME_BROWSER_AUTOMATION_UI_CONTROLS_H_ | 89 #endif // CHROME_BROWSER_AUTOMATION_UI_CONTROLS_H_ |
OLD | NEW |