Chromium Code Reviews| Index: services/ui/public/interfaces/window_tree.mojom |
| diff --git a/services/ui/public/interfaces/window_tree.mojom b/services/ui/public/interfaces/window_tree.mojom |
| index 5adcca21706011d8fa3405bc58ed6ff48fa7a4b2..9060a1328d082019995d32ab1b7beb05999c9113 100644 |
| --- a/services/ui/public/interfaces/window_tree.mojom |
| +++ b/services/ui/public/interfaces/window_tree.mojom |
| @@ -113,6 +113,11 @@ interface WindowTree { |
| // TODO(jamescook): Convert |mask| to a path. http://crbug.com/613210 |
| SetHitTestMask(uint32 window_id, gfx.mojom.Rect? mask); |
| + // Called by clients that want to accept drag and drops. Windows default to |
| + // this being disabled; a window must actively opt-in to receiving OnDrag*() |
| + // calls. |
| + SetCanAcceptDrops(uint32 window_id, bool accepts_drops); |
| + |
| // Sets the visibility of the specified window to |visible|. Connections are |
| // allowed to change the visibility of any window they have created, as well |
| // as any of their roots. |
| @@ -270,6 +275,16 @@ interface WindowTree { |
| // Tells the window manager to cancel any in progress window move started with |
| // StartWindowMove() and to revert the window bounds to how they were. |
| CancelWindowMove(uint32 window_id); |
| + |
| + // Called by the client to start a drag operation. |source_window_id| is the |
| + // source window, |drag_data| is the entire set of mime to raw data |
| + // mapping. We send this during the start of the drag because most views |
| + // clients will try to read all this data on first entry. |
| + PerformDragDrop(uint32 change_id, |
| + uint32 source_window_id, |
| + int32 drag_pointer, |
| + map<string, array<uint8>> drag_data, |
| + uint32 drag_operation); |
| }; |
| // Changes to windows are not sent to the connection that originated the |
| @@ -400,6 +415,46 @@ interface WindowTreeClient { |
| OnWindowPredefinedCursorChanged(uint32 window_id, Cursor cursor_id); |
| + // Called when the mouse cursor enters a window that has opted into accepting |
| + // drags for the first time, providing a list of available mime types. We |
| + // want to send this set of data only one time, so this isn't part of |
| + // OnDragEnter(), which occurs every time the mouse enters a window. |
| + OnDragStart(uint32 window, |
|
sky
2016/09/08 23:37:20
Based on the name I thought this was a callback fr
Elliot Glaysher
2016/09/13 00:14:19
I renamed this and also changed it to transfer onc
|
| + map<string, array<uint8>> drag_data); |
| + |
| + // Called when the mouse cursor enters a window that has opted into |
| + // accepting drags through SetAcceptsDrags(), providing a list |
| + // of available mime types. Returns a bitmask of the supported |
| + // operations. |
| + OnDragEnter(uint32 window, |
| + uint32 key_state, |
| + gfx.mojom.Point position, |
| + uint32 effect_bitmask) => (uint32 supported_op_bitmask); |
| + |
| + // Called when the pointer moves over the window after the initial |
| + // DragEnter. Returns a bitmask of the supported operations at this |
| + // location. |
| + OnDragOver(uint32 window, |
| + uint32 key_state, |
| + gfx.mojom.Point position, |
| + uint32 effect_bitmask) => (uint32 supported_op_bitmask); |
| + |
| + // Called when the pointer leaves a window or if the drop is |
| + // canceled. |
| + OnDragLeave(uint32 window); |
| + |
| + // Called when the drop occurs on a window. Returns the action |
| + // taken. |
| + OnDragDrop(uint32 window, |
|
sky
2016/09/08 23:37:20
The 'Drag' in the name here is mildly confusing. H
Elliot Glaysher
2016/09/13 00:14:19
Renamed to OnCompleteDrop (I'm already using the w
|
| + uint32 key_state, |
| + gfx.mojom.Point position, |
| + uint32 effect_bitmask) => (uint32 effect_taken); |
| + |
| + // Called after OnDragDrop completes for every |window| which received an |
| + // OnDragStart() message. This signals that a client can forget the |
| + // |drag_data| passed in via the first message. |
| + OnDragFinish(uint32 window); |
| + |
| // A change initiated from the client has completed. See description of |
| // change ids for details. |
| OnChangeCompleted(uint32 change_id, bool success); |