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