| Index: services/ui/ws/event_dispatcher.h
|
| diff --git a/services/ui/ws/event_dispatcher.h b/services/ui/ws/event_dispatcher.h
|
| index 8d0ca2919ccff37d9c9dac6def55fa7819e483a8..a3f3dd77b18087dfc4c9b0f0f5d3164fbdf76a0a 100644
|
| --- a/services/ui/ws/event_dispatcher.h
|
| +++ b/services/ui/ws/event_dispatcher.h
|
| @@ -38,6 +38,15 @@ class EventDispatcherTestApi;
|
| // Handles dispatching events to the right location as well as updating focus.
|
| class EventDispatcher : public ServerWindowObserver {
|
| public:
|
| + enum class AcceleratorMatchPhase {
|
| + // Both pre and post should be considered.
|
| + ANY,
|
| +
|
| + // PRE_TARGETs are not considered, only the actual target and any
|
| + // accelerators registered with POST_TARGET.
|
| + POST_ONLY,
|
| + };
|
| +
|
| explicit EventDispatcher(EventDispatcherDelegate* delegate);
|
| ~EventDispatcher() override;
|
|
|
| @@ -104,8 +113,11 @@ class EventDispatcher : public ServerWindowObserver {
|
| void RemoveAccelerator(uint32_t id);
|
|
|
| // Processes the supplied event, informing the delegate as approriate. This
|
| - // may result in generating any number of events.
|
| - void ProcessEvent(const ui::Event& event);
|
| + // may result in generating any number of events. If |match_phase| is
|
| + // ANY and there is a matching accelerator with PRE_TARGET found, than only
|
| + // OnAccelerator() is called. The expectation is after the PRE_TARGET has been
|
| + // handled this is again called with an AcceleratorMatchPhase of POST_ONLY.
|
| + void ProcessEvent(const ui::Event& event, AcceleratorMatchPhase match_phase);
|
|
|
| private:
|
| friend class test::EventDispatcherTestApi;
|
| @@ -130,7 +142,8 @@ class EventDispatcher : public ServerWindowObserver {
|
| bool is_pointer_down;
|
| };
|
|
|
| - void ProcessKeyEvent(const ui::KeyEvent& event);
|
| + void ProcessKeyEvent(const ui::KeyEvent& event,
|
| + AcceleratorMatchPhase match_phase);
|
|
|
| bool IsTrackingPointer(int32_t pointer_id) const {
|
| return pointer_targets_.count(pointer_id) > 0;
|
|
|