Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(471)

Side by Side Diff: services/ui/ws/event_dispatcher_delegate.h

Issue 2125883003: Adds ability for pre-target accelerators to not consume events (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: merge Created 4 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « services/ui/ws/event_dispatcher.cc ('k') | services/ui/ws/event_dispatcher_unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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 SERVICES_UI_WS_EVENT_DISPATCHER_DELEGATE_H_ 5 #ifndef SERVICES_UI_WS_EVENT_DISPATCHER_DELEGATE_H_
6 #define SERVICES_UI_WS_EVENT_DISPATCHER_DELEGATE_H_ 6 #define SERVICES_UI_WS_EVENT_DISPATCHER_DELEGATE_H_
7 7
8 #include <stdint.h> 8 #include <stdint.h>
9 9
10 #include "services/ui/common/types.h" 10 #include "services/ui/common/types.h"
11 11
12 namespace gfx { 12 namespace gfx {
13 class Point; 13 class Point;
14 } 14 }
15 15
16 namespace ui { 16 namespace ui {
17 class Event; 17 class Event;
18 } 18 }
19 19
20 namespace ui { 20 namespace ui {
21 namespace ws { 21 namespace ws {
22 22
23 class Accelerator; 23 class Accelerator;
24 class ServerWindow; 24 class ServerWindow;
25 25
26 // Used by EventDispatcher for mocking in tests. 26 // Used by EventDispatcher for mocking in tests.
27 class EventDispatcherDelegate { 27 class EventDispatcherDelegate {
28 public: 28 public:
29 virtual void OnAccelerator(uint32_t accelerator, const ui::Event& event) = 0; 29 enum class AcceleratorPhase {
30 PRE,
31 POST,
32 };
33
34 virtual void OnAccelerator(uint32_t accelerator,
35 const ui::Event& event,
36 AcceleratorPhase phase) = 0;
30 37
31 virtual void SetFocusedWindowFromEventDispatcher(ServerWindow* window) = 0; 38 virtual void SetFocusedWindowFromEventDispatcher(ServerWindow* window) = 0;
32 virtual ServerWindow* GetFocusedWindowForEventDispatcher() = 0; 39 virtual ServerWindow* GetFocusedWindowForEventDispatcher() = 0;
33 40
34 // Called when capture should be set on the native display. |window| is the 41 // Called when capture should be set on the native display. |window| is the
35 // window capture is being set on. 42 // window capture is being set on.
36 virtual void SetNativeCapture(ServerWindow* window) = 0; 43 virtual void SetNativeCapture(ServerWindow* window) = 0;
37 // Called when the native display is having capture released. There is no 44 // Called when the native display is having capture released. There is no
38 // longer a ServerWindow holding capture. 45 // longer a ServerWindow holding capture.
39 virtual void ReleaseNativeCapture() = 0; 46 virtual void ReleaseNativeCapture() = 0;
(...skipping 24 matching lines...) Expand all
64 virtual void OnEventTargetNotFound(const ui::Event& event) = 0; 71 virtual void OnEventTargetNotFound(const ui::Event& event) = 0;
65 72
66 protected: 73 protected:
67 virtual ~EventDispatcherDelegate() {} 74 virtual ~EventDispatcherDelegate() {}
68 }; 75 };
69 76
70 } // namespace ws 77 } // namespace ws
71 } // namespace ui 78 } // namespace ui
72 79
73 #endif // SERVICES_UI_WS_EVENT_DISPATCHER_DELEGATE_H_ 80 #endif // SERVICES_UI_WS_EVENT_DISPATCHER_DELEGATE_H_
OLDNEW
« no previous file with comments | « services/ui/ws/event_dispatcher.cc ('k') | services/ui/ws/event_dispatcher_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698