| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 UI_AURA_TEST_EVENT_GENERATOR_H_ | 5 #ifndef UI_AURA_TEST_EVENT_GENERATOR_H_ |
| 6 #define UI_AURA_TEST_EVENT_GENERATOR_H_ | 6 #define UI_AURA_TEST_EVENT_GENERATOR_H_ |
| 7 | 7 |
| 8 #include <list> | 8 #include <list> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| (...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 104 | 104 |
| 105 // Generates a double click event using the left button. | 105 // Generates a double click event using the left button. |
| 106 void DoubleClickLeftButton(); | 106 void DoubleClickLeftButton(); |
| 107 | 107 |
| 108 // Generates a right button press event. | 108 // Generates a right button press event. |
| 109 void PressRightButton(); | 109 void PressRightButton(); |
| 110 | 110 |
| 111 // Generates a right button release event. | 111 // Generates a right button release event. |
| 112 void ReleaseRightButton(); | 112 void ReleaseRightButton(); |
| 113 | 113 |
| 114 // Generates events to move mouse to be the given |point|. | 114 // Generates events to move mouse to be the given |point| in the |
| 115 void MoveMouseTo(const gfx::Point& point, int count); | 115 // |current_root_window_|'s host window coordinates. |
| 116 void MoveMouseTo(const gfx::Point& point) { | 116 void MoveMouseToInHost(const gfx::Point& point_in_host); |
| 117 MoveMouseTo(point, 1); | 117 void MoveMouseToInHost(int x, int y) { |
| 118 MoveMouseToInHost(gfx::Point(x, y)); |
| 119 } |
| 120 |
| 121 // Generates events to move mouse to be the given |point| in screen |
| 122 // coordinates. |
| 123 void MoveMouseTo(const gfx::Point& point_in_screen, int count); |
| 124 void MoveMouseTo(const gfx::Point& point_in_screen) { |
| 125 MoveMouseTo(point_in_screen, 1); |
| 118 } | 126 } |
| 119 void MoveMouseTo(int x, int y) { | 127 void MoveMouseTo(int x, int y) { |
| 120 MoveMouseTo(gfx::Point(x, y)); | 128 MoveMouseTo(gfx::Point(x, y)); |
| 121 } | 129 } |
| 122 | 130 |
| 123 // Generates events to move mouse to be the given |point| in |window|'s | 131 // Generates events to move mouse to be the given |point| in |window|'s |
| 124 // coordinates. | 132 // coordinates. |
| 125 void MoveMouseRelativeTo(const Window* window, const gfx::Point& point); | 133 void MoveMouseRelativeTo(const Window* window, const gfx::Point& point); |
| 126 void MoveMouseRelativeTo(const Window* window, int x, int y) { | 134 void MoveMouseRelativeTo(const Window* window, int x, int y) { |
| 127 MoveMouseRelativeTo(window, gfx::Point(x, y)); | 135 MoveMouseRelativeTo(window, gfx::Point(x, y)); |
| (...skipping 151 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 279 // Set to true to cause events to be posted asynchronously. | 287 // Set to true to cause events to be posted asynchronously. |
| 280 bool async_; | 288 bool async_; |
| 281 | 289 |
| 282 DISALLOW_COPY_AND_ASSIGN(EventGenerator); | 290 DISALLOW_COPY_AND_ASSIGN(EventGenerator); |
| 283 }; | 291 }; |
| 284 | 292 |
| 285 } // namespace test | 293 } // namespace test |
| 286 } // namespace aura | 294 } // namespace aura |
| 287 | 295 |
| 288 #endif // UI_AURA_TEST_EVENT_GENERATOR_H_ | 296 #endif // UI_AURA_TEST_EVENT_GENERATOR_H_ |
| OLD | NEW |