| 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 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 48 // Called when EventDispatcher has a new value for the cursor and our | 48 // Called when EventDispatcher has a new value for the cursor and our |
| 49 // delegate should perform the native updates. | 49 // delegate should perform the native updates. |
| 50 virtual void UpdateNativeCursorFromDispatcher() = 0; | 50 virtual void UpdateNativeCursorFromDispatcher() = 0; |
| 51 | 51 |
| 52 // Called when |window| has lost capture. The native display may still be | 52 // Called when |window| has lost capture. The native display may still be |
| 53 // holding capture. The delegate should not change native display capture. | 53 // holding capture. The delegate should not change native display capture. |
| 54 // ReleaseNativeCapture() is invoked if appropriate. | 54 // ReleaseNativeCapture() is invoked if appropriate. |
| 55 virtual void OnCaptureChanged(ServerWindow* new_capture, | 55 virtual void OnCaptureChanged(ServerWindow* new_capture, |
| 56 ServerWindow* old_capture) = 0; | 56 ServerWindow* old_capture) = 0; |
| 57 | 57 |
| 58 virtual void OnMouseCursorLocationChanged(const gfx::Point& point) = 0; | 58 virtual void OnMouseCursorLocationChanged(const gfx::Point& point, |
| 59 const int64_t display_id) = 0; |
| 59 | 60 |
| 60 // Dispatches an event to the specific client. | 61 // Dispatches an event to the specific client. |
| 61 virtual void DispatchInputEventToWindow(ServerWindow* target, | 62 virtual void DispatchInputEventToWindow(ServerWindow* target, |
| 62 ClientSpecificId client_id, | 63 ClientSpecificId client_id, |
| 63 const ui::Event& event, | 64 const ui::Event& event, |
| 64 Accelerator* accelerator) = 0; | 65 Accelerator* accelerator) = 0; |
| 65 | 66 |
| 66 // Returns the id of the client to send events to. |in_nonclient_area| is | 67 // Returns the id of the client to send events to. |in_nonclient_area| is |
| 67 // true if the event occurred in the non-client area of the window. | 68 // true if the event occurred in the non-client area of the window. |
| 68 virtual ClientSpecificId GetEventTargetClientId(const ServerWindow* window, | 69 virtual ClientSpecificId GetEventTargetClientId(const ServerWindow* window, |
| 69 bool in_nonclient_area) = 0; | 70 bool in_nonclient_area) = 0; |
| 70 | 71 |
| 71 // Returns the window to start searching from at the specified location, or | 72 // Returns the window to start searching from at the specified location, or |
| 72 // null if there is a no window containing |location|. |location| should be in | 73 // null if there is a no window containing |location_in_display|. |
| 73 // screen coordinates and if a window is returned then |location| will be | 74 // |location_in_display| should be in display coordinates and in pixels. |
| 74 // updated to be relative to the origin of the window. | 75 // |location_in_display| and |display_id| will be updated if the window we |
| 75 virtual ServerWindow* GetRootWindowContaining(gfx::Point* location) = 0; | 76 // found is on a different display than the originated display. |
| 77 virtual ServerWindow* GetRootWindowContaining(gfx::Point* location_in_display, |
| 78 int64_t* display_id) = 0; |
| 76 | 79 |
| 77 // Called when event dispatch could not find a target. OnAccelerator may still | 80 // Called when event dispatch could not find a target. OnAccelerator may still |
| 78 // be called. | 81 // be called. |
| 79 virtual void OnEventTargetNotFound(const ui::Event& event) = 0; | 82 virtual void OnEventTargetNotFound(const ui::Event& event) = 0; |
| 80 | 83 |
| 81 protected: | 84 protected: |
| 82 virtual ~EventDispatcherDelegate() {} | 85 virtual ~EventDispatcherDelegate() {} |
| 83 }; | 86 }; |
| 84 | 87 |
| 85 } // namespace ws | 88 } // namespace ws |
| 86 } // namespace ui | 89 } // namespace ui |
| 87 | 90 |
| 88 #endif // SERVICES_UI_WS_EVENT_DISPATCHER_DELEGATE_H_ | 91 #endif // SERVICES_UI_WS_EVENT_DISPATCHER_DELEGATE_H_ |
| OLD | NEW |