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 "ui/mojo/events/input_events.mojom.h" | 8 #include "ui/mojo/events/input_events.mojom.h" |
9 | 9 |
10 namespace mus { | 10 namespace mus { |
11 namespace ws { | 11 namespace ws { |
12 | 12 |
13 class ServerWindow; | 13 class ServerWindow; |
14 | 14 |
15 // Used by EventDispatcher for mocking in tests. | 15 // Used by EventDispatcher for mocking in tests. |
16 class EventDispatcherDelegate { | 16 class EventDispatcherDelegate { |
17 public: | 17 public: |
18 virtual void OnAccelerator(uint32_t accelerator, mojo::EventPtr event) = 0; | 18 virtual void OnAccelerator(uint32_t accelerator, mojo::EventPtr event) = 0; |
19 | 19 |
20 virtual void SetFocusedWindowFromEventDispatcher(ServerWindow* window) = 0; | 20 virtual void SetFocusedWindowFromEventDispatcher(ServerWindow* window) = 0; |
21 virtual ServerWindow* GetFocusedWindowForEventDispatcher() = 0; | 21 virtual ServerWindow* GetFocusedWindowForEventDispatcher() = 0; |
22 | 22 |
| 23 // |in_nonclient_area| is true if the event occurred in the non-client area. |
23 virtual void DispatchInputEventToWindow(ServerWindow* target, | 24 virtual void DispatchInputEventToWindow(ServerWindow* target, |
| 25 bool in_nonclient_area, |
24 mojo::EventPtr event) = 0; | 26 mojo::EventPtr event) = 0; |
25 | 27 |
26 protected: | 28 protected: |
27 virtual ~EventDispatcherDelegate() {} | 29 virtual ~EventDispatcherDelegate() {} |
28 }; | 30 }; |
29 | 31 |
30 } // namespace ws | 32 } // namespace ws |
31 } // namespace mus | 33 } // namespace mus |
32 | 34 |
33 #endif // COMPONENTS_MUS_WS_EVENT_DISPATCHER_DELEGATE_H_ | 35 #endif // COMPONENTS_MUS_WS_EVENT_DISPATCHER_DELEGATE_H_ |
OLD | NEW |