| 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 SERVICES_UI_WS_EVENT_DISPATCHER_DELEGATE_H_ | 5 #ifndef SERVICES_UI_WS_EVENT_DISPATCHER_DELEGATE_H_ |
| 6 #define SERVICES_UI_WS_EVENT_DISPATCHER_DELEGATE_H_ | 6 #define SERVICES_UI_WS_EVENT_DISPATCHER_DELEGATE_H_ |
| 7 | 7 |
| 8 #include <stdint.h> | 8 #include <stdint.h> |
| 9 | 9 |
| 10 #include "services/ui/common/types.h" | 10 #include "services/ui/common/types.h" |
| (...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 60 virtual void OnMouseCursorLocationChanged(const gfx::Point& point, | 60 virtual void OnMouseCursorLocationChanged(const gfx::Point& point, |
| 61 const int64_t display_id) = 0; | 61 const int64_t display_id) = 0; |
| 62 | 62 |
| 63 // Dispatches an event to the specific client. | 63 // Dispatches an event to the specific client. |
| 64 virtual void DispatchInputEventToWindow(ServerWindow* target, | 64 virtual void DispatchInputEventToWindow(ServerWindow* target, |
| 65 ClientSpecificId client_id, | 65 ClientSpecificId client_id, |
| 66 const int64_t display_id, | 66 const int64_t display_id, |
| 67 const ui::Event& event, | 67 const ui::Event& event, |
| 68 Accelerator* accelerator) = 0; | 68 Accelerator* accelerator) = 0; |
| 69 | 69 |
| 70 // Starts processing the next event in the event queue. |
| 71 virtual void ProcessNextEventFromQueue() = 0; |
| 72 |
| 70 // Returns the id of the client to send events to. |in_nonclient_area| is | 73 // Returns the id of the client to send events to. |in_nonclient_area| is |
| 71 // true if the event occurred in the non-client area of the window. | 74 // true if the event occurred in the non-client area of the window. |
| 72 virtual ClientSpecificId GetEventTargetClientId(const ServerWindow* window, | 75 virtual ClientSpecificId GetEventTargetClientId(const ServerWindow* window, |
| 73 bool in_nonclient_area) = 0; | 76 bool in_nonclient_area) = 0; |
| 74 | 77 |
| 75 // Returns the window to start searching from at the specified location, or | 78 // Returns the window to start searching from at the specified location, or |
| 76 // null if there is a no window containing |location_in_display|. | 79 // null if there is a no window containing |location_in_display|. |
| 77 // |location_in_display| is in display coordinates and in pixels. | 80 // |location_in_display| is in display coordinates and in pixels. |
| 78 // |location_in_display| and |display_id| are updated if the window we | 81 // |location_in_display| and |display_id| are updated if the window we |
| 79 // found is on a different display than the originated display. | 82 // found is on a different display than the originated display. |
| 80 // TODO(riajiang): No need to update |location_in_display| and |display_id| | 83 // TODO(riajiang): No need to update |location_in_display| and |display_id| |
| 81 // after ozone drm can tell us the right display the cursor is on for | 84 // after ozone drm can tell us the right display the cursor is on for |
| 82 // drag-n-drop events. crbug.com/726470 | 85 // drag-n-drop events. crbug.com/726470 |
| 83 virtual ServerWindow* GetRootWindowContaining(gfx::Point* location_in_display, | 86 virtual ServerWindow* GetRootWindowContaining(gfx::Point* location_in_display, |
| 84 int64_t* display_id) = 0; | 87 int64_t* display_id) = 0; |
| 85 | 88 |
| 86 // Called when event dispatch could not find a target. OnAccelerator may still | 89 // Called when event dispatch could not find a target. OnAccelerator may still |
| 87 // be called. | 90 // be called. |
| 88 virtual void OnEventTargetNotFound(const ui::Event& event, | 91 virtual void OnEventTargetNotFound(const ui::Event& event, |
| 89 const int64_t display_id) = 0; | 92 const int64_t display_id) = 0; |
| 90 | 93 |
| 91 protected: | 94 protected: |
| 92 virtual ~EventDispatcherDelegate() {} | 95 virtual ~EventDispatcherDelegate() {} |
| 93 }; | 96 }; |
| 94 | 97 |
| 95 } // namespace ws | 98 } // namespace ws |
| 96 } // namespace ui | 99 } // namespace ui |
| 97 | 100 |
| 98 #endif // SERVICES_UI_WS_EVENT_DISPATCHER_DELEGATE_H_ | 101 #endif // SERVICES_UI_WS_EVENT_DISPATCHER_DELEGATE_H_ |
| OLD | NEW |