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..eeb0948da7147d5560edf848d7769fadeb65086f 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 drags. Windows default |
sky
2016/09/06 21:11:26
Similar comment about drops.
|
+ // to this being disabled; a window must actively opt-in to |
+ // receiving Drag*() calls. |
+ SetCanAcceptDrags(uint32 window_id, bool accepts_drags); |
+ |
// 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,15 @@ 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, |
sky
2016/09/06 21:11:26
Don't you need an image and offset into that image
Elliot Glaysher
2016/09/07 21:42:23
I removed all management of drag representations f
|
+ uint32 source_window_id, |
+ map<string, array<uint8>> drag_data, |
+ uint32 drag_operation); |
}; |
// Changes to windows are not sent to the connection that originated the |
@@ -400,6 +414,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, |
+ 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, |
+ uint32 key_state, |
+ gfx.mojom.Point position, |
+ uint32 effect_bitmask) => (uint32 effect_taken); |
+ |
+ // Called after OnDragDrop completes for every |window| which received an |
+ // OnDragFirstEnter() message. This signals that a client can forget the |
sky
2016/09/06 21:11:26
OnDragStart?
|
+ // |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); |