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 SetCapture(ServerWindow* window) = 0; | |
sky
2016/02/10 17:38:22
Clarify when these are called. In particular it's
jonross
2016/02/10 19:45:49
Done.
As discussed offline the two OnLostCapture
| |
26 virtual void ReleaseCapture(ServerWindow* window) = 0; | |
27 virtual void OnLostCapture(ServerWindow* window) = 0; | |
28 | |
25 // |in_nonclient_area| is true if the event occurred in the non-client area. | 29 // |in_nonclient_area| is true if the event occurred in the non-client area. |
26 virtual void DispatchInputEventToWindow(ServerWindow* target, | 30 virtual void DispatchInputEventToWindow(ServerWindow* target, |
27 bool in_nonclient_area, | 31 bool in_nonclient_area, |
28 mojom::EventPtr event) = 0; | 32 mojom::EventPtr event) = 0; |
29 | 33 |
30 protected: | 34 protected: |
31 virtual ~EventDispatcherDelegate() {} | 35 virtual ~EventDispatcherDelegate() {} |
32 }; | 36 }; |
33 | 37 |
34 } // namespace ws | 38 } // namespace ws |
35 } // namespace mus | 39 } // namespace mus |
36 | 40 |
37 #endif // COMPONENTS_MUS_WS_EVENT_DISPATCHER_DELEGATE_H_ | 41 #endif // COMPONENTS_MUS_WS_EVENT_DISPATCHER_DELEGATE_H_ |
OLD | NEW |