OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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_EVENTS_TEST_EVENT_GENERATOR_H_ | 5 #ifndef UI_EVENTS_TEST_EVENT_GENERATOR_H_ |
6 #define UI_EVENTS_TEST_EVENT_GENERATOR_H_ | 6 #define UI_EVENTS_TEST_EVENT_GENERATOR_H_ |
7 | 7 |
8 #include <list> | 8 #include <list> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
(...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
122 // various methods that take a location but can be manipulated directly, | 122 // various methods that take a location but can be manipulated directly, |
123 // typically for touch. | 123 // typically for touch. |
124 void set_current_location(const gfx::Point& location) { | 124 void set_current_location(const gfx::Point& location) { |
125 current_location_ = location; | 125 current_location_ = location; |
126 } | 126 } |
127 const gfx::Point& current_location() const { return current_location_; } | 127 const gfx::Point& current_location() const { return current_location_; } |
128 | 128 |
129 void set_async(bool async) { async_ = async; } | 129 void set_async(bool async) { async_ = async; } |
130 bool async() const { return async_; } | 130 bool async() const { return async_; } |
131 | 131 |
| 132 // Dispatch events through the application instead of directly to the |
| 133 // target window. Currently only supported on Mac. |
| 134 void set_targeting_application(bool targeting_application) { |
| 135 targeting_application_ = targeting_application; |
| 136 } |
| 137 bool targeting_application() const { return targeting_application_; } |
| 138 |
132 // Resets the event flags bitmask. | 139 // Resets the event flags bitmask. |
133 void set_flags(int flags) { flags_ = flags; } | 140 void set_flags(int flags) { flags_ = flags; } |
134 int flags() const { return flags_; } | 141 int flags() const { return flags_; } |
135 | 142 |
136 // Generates a left button press event. | 143 // Generates a left button press event. |
137 void PressLeftButton(); | 144 void PressLeftButton(); |
138 | 145 |
139 // Generates a left button release event. | 146 // Generates a left button release event. |
140 void ReleaseLeftButton(); | 147 void ReleaseLeftButton(); |
141 | 148 |
(...skipping 234 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
376 EventGeneratorDelegate* delegate(); | 383 EventGeneratorDelegate* delegate(); |
377 | 384 |
378 scoped_ptr<EventGeneratorDelegate> delegate_; | 385 scoped_ptr<EventGeneratorDelegate> delegate_; |
379 gfx::Point current_location_; | 386 gfx::Point current_location_; |
380 EventTarget* current_target_; | 387 EventTarget* current_target_; |
381 int flags_; | 388 int flags_; |
382 bool grab_; | 389 bool grab_; |
383 std::list<Event*> pending_events_; | 390 std::list<Event*> pending_events_; |
384 // Set to true to cause events to be posted asynchronously. | 391 // Set to true to cause events to be posted asynchronously. |
385 bool async_; | 392 bool async_; |
| 393 bool targeting_application_; |
386 scoped_ptr<base::TickClock> tick_clock_; | 394 scoped_ptr<base::TickClock> tick_clock_; |
387 | 395 |
388 DISALLOW_COPY_AND_ASSIGN(EventGenerator); | 396 DISALLOW_COPY_AND_ASSIGN(EventGenerator); |
389 }; | 397 }; |
390 | 398 |
391 } // namespace test | 399 } // namespace test |
392 } // namespace ui | 400 } // namespace ui |
393 | 401 |
394 #endif // UI_EVENTS_TEST_EVENT_GENERATOR_H_ | 402 #endif // UI_EVENTS_TEST_EVENT_GENERATOR_H_ |
OLD | NEW |