OLD | NEW |
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 COMPONENTS_MUS_WS_EVENT_DISPATCHER_DELEGATE_H_ | 5 #ifndef COMPONENTS_MUS_WS_EVENT_DISPATCHER_DELEGATE_H_ |
6 #define COMPONENTS_MUS_WS_EVENT_DISPATCHER_DELEGATE_H_ | 6 #define COMPONENTS_MUS_WS_EVENT_DISPATCHER_DELEGATE_H_ |
7 | 7 |
8 #include <stdint.h> | 8 #include <stdint.h> |
9 | 9 |
10 #include "components/mus/public/interfaces/input_events.mojom.h" | 10 #include "components/mus/public/interfaces/input_events.mojom.h" |
11 | 11 |
12 namespace mus { | 12 namespace mus { |
13 namespace ws { | 13 namespace ws { |
14 | 14 |
15 class ServerWindow; | 15 class ServerWindow; |
16 | 16 |
17 // Used by EventDispatcher for mocking in tests. | 17 // Used by EventDispatcher for mocking in tests. |
18 class EventDispatcherDelegate { | 18 class EventDispatcherDelegate { |
19 public: | 19 public: |
20 virtual void OnAccelerator(uint32_t accelerator, mojom::EventPtr event) = 0; | 20 virtual void OnAccelerator(uint32_t accelerator, mojom::EventPtr event) = 0; |
21 | 21 |
22 virtual void SetFocusedWindowFromEventDispatcher(ServerWindow* window) = 0; | 22 virtual void SetFocusedWindowFromEventDispatcher(ServerWindow* window) = 0; |
23 virtual ServerWindow* GetFocusedWindowForEventDispatcher() = 0; | 23 virtual ServerWindow* GetFocusedWindowForEventDispatcher() = 0; |
24 | 24 |
| 25 // Called when capture should be set on the native display. |
| 26 virtual void SetNativeCapture() = 0; |
| 27 // Called when the native display is having capture released. There is no |
| 28 // longer a ServerWindow holding capture. |
| 29 virtual void ReleaseNativeCapture() = 0; |
| 30 // Called when |window| has lost capture. The native display may still be |
| 31 // holding capture. The delegate should not change native display capture. |
| 32 // ReleaseNativeCapture is invoked if appropriate. |
| 33 virtual void OnServerWindowCaptureLost(ServerWindow* window) = 0; |
| 34 |
25 // |in_nonclient_area| is true if the event occurred in the non-client area. | 35 // |in_nonclient_area| is true if the event occurred in the non-client area. |
26 virtual void DispatchInputEventToWindow(ServerWindow* target, | 36 virtual void DispatchInputEventToWindow(ServerWindow* target, |
27 bool in_nonclient_area, | 37 bool in_nonclient_area, |
28 mojom::EventPtr event) = 0; | 38 mojom::EventPtr event) = 0; |
29 | 39 |
30 protected: | 40 protected: |
31 virtual ~EventDispatcherDelegate() {} | 41 virtual ~EventDispatcherDelegate() {} |
32 }; | 42 }; |
33 | 43 |
34 } // namespace ws | 44 } // namespace ws |
35 } // namespace mus | 45 } // namespace mus |
36 | 46 |
37 #endif // COMPONENTS_MUS_WS_EVENT_DISPATCHER_DELEGATE_H_ | 47 #endif // COMPONENTS_MUS_WS_EVENT_DISPATCHER_DELEGATE_H_ |
OLD | NEW |