Chromium Code Reviews| Index: ui/events/test/event_generator.h |
| diff --git a/ui/events/test/event_generator.h b/ui/events/test/event_generator.h |
| index d889f69807ff4651f0ac8fd36fe626969c0cefa0..6a897581e1428582f2429c86fa99341f850e8545 100644 |
| --- a/ui/events/test/event_generator.h |
| +++ b/ui/events/test/event_generator.h |
| @@ -138,12 +138,22 @@ class EventGenerator { |
| void set_async(bool async) { async_ = async; } |
| bool async() const { return async_; } |
| - // Dispatch events through the application instead of directly to the |
| - // target window. Currently only supported on Mac. |
| - void set_targeting_application(bool targeting_application) { |
| - targeting_application_ = targeting_application; |
| + // Events could be dispatched using different methods. |
|
tapted
2016/11/18 07:28:04
I'd add a sentence like
"The choice is a tradeoff
themblsha
2016/11/18 13:31:50
Done.
|
| + // Currently only supported on Mac. |
| + enum class Target { |
| + // Dispatch through the application. |
|
tapted
2016/11/18 07:28:04
"Least robust."
themblsha
2016/11/18 13:31:50
Done.
|
| + APPLICATION, |
| + // Dispatch directly to target window. |
| + WINDOW, |
| + // Default. Emulates default Window dispatch. |
|
tapted
2016/11/18 07:28:04
"Most robust."
themblsha
2016/11/18 13:31:50
Done.
|
| + WIDGET, |
| + }; |
| + |
| + // Selects dispatch method. Currently only supported on Mac. |
| + void set_target(Target target) { |
| + target_ = target; |
| } |
| - bool targeting_application() const { return targeting_application_; } |
| + Target target() const { return target_; } |
| // Resets the event flags bitmask. |
| void set_flags(int flags) { flags_ = flags; } |
| @@ -405,7 +415,7 @@ class EventGenerator { |
| std::list<std::unique_ptr<Event>> pending_events_; |
| // Set to true to cause events to be posted asynchronously. |
| bool async_; |
| - bool targeting_application_; |
| + Target target_; |
| std::unique_ptr<base::TickClock> tick_clock_; |
| DISALLOW_COPY_AND_ASSIGN(EventGenerator); |