Avi Drissman | 3e1a26c | 2022-09-15 20:26:03 | [diff] [blame] | 1 | // Copyright 2017 The Chromium Authors |
sadrul | 8a7826a | 2017-05-15 17:04:39 | [diff] [blame] | 2 | // Use of this source code is governed by a BSD-style license that can be |
| 3 | // found in the LICENSE file. |
| 4 | |
| 5 | #ifndef UI_AURA_EVENT_INJECTOR_H_ |
| 6 | #define UI_AURA_EVENT_INJECTOR_H_ |
| 7 | |
sadrul | 8a7826a | 2017-05-15 17:04:39 | [diff] [blame] | 8 | #include "ui/aura/aura_export.h" |
| 9 | |
| 10 | namespace ui { |
| 11 | class Event; |
| 12 | struct EventDispatchDetails; |
| 13 | } |
| 14 | |
| 15 | namespace aura { |
| 16 | |
| 17 | class WindowTreeHost; |
| 18 | |
Scott Violet | 83d69d2 | 2019-05-16 14:45:28 | [diff] [blame] | 19 | // Used to inject events as if they came from the OS. |
sadrul | 8a7826a | 2017-05-15 17:04:39 | [diff] [blame] | 20 | class AURA_EXPORT EventInjector { |
| 21 | public: |
| 22 | EventInjector(); |
Peter Boström | c8c1235 | 2021-09-21 23:37:15 | [diff] [blame] | 23 | |
| 24 | EventInjector(const EventInjector&) = delete; |
| 25 | EventInjector& operator=(const EventInjector&) = delete; |
| 26 | |
sadrul | 8a7826a | 2017-05-15 17:04:39 | [diff] [blame] | 27 | ~EventInjector(); |
| 28 | |
Scott Violet | 83d69d2 | 2019-05-16 14:45:28 | [diff] [blame] | 29 | // Inject |event| to |host|. If |event| is a LocatedEvent, then coordinates |
| 30 | // are relative to host and in DIPs. |
| 31 | ui::EventDispatchDetails Inject(WindowTreeHost* host, ui::Event* event); |
sadrul | 8a7826a | 2017-05-15 17:04:39 | [diff] [blame] | 32 | }; |
| 33 | |
| 34 | } // namespace aura |
| 35 | |
| 36 | #endif // UI_AURA_EVENT_INJECTOR_H_ |