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 virtual void OnLostCapture(ServerWindow* window) = 0; |
| 26 |
25 // |in_nonclient_area| is true if the event occurred in the non-client area. | 27 // |in_nonclient_area| is true if the event occurred in the non-client area. |
26 virtual void DispatchInputEventToWindow(ServerWindow* target, | 28 virtual void DispatchInputEventToWindow(ServerWindow* target, |
27 bool in_nonclient_area, | 29 bool in_nonclient_area, |
28 mojom::EventPtr event) = 0; | 30 mojom::EventPtr event) = 0; |
29 | 31 |
30 protected: | 32 protected: |
31 virtual ~EventDispatcherDelegate() {} | 33 virtual ~EventDispatcherDelegate() {} |
32 }; | 34 }; |
33 | 35 |
34 } // namespace ws | 36 } // namespace ws |
35 } // namespace mus | 37 } // namespace mus |
36 | 38 |
37 #endif // COMPONENTS_MUS_WS_EVENT_DISPATCHER_DELEGATE_H_ | 39 #endif // COMPONENTS_MUS_WS_EVENT_DISPATCHER_DELEGATE_H_ |
OLD | NEW |