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..1f191581723c33be641b9aabf9f0f91418062013 100644 |
--- a/services/ui/public/interfaces/window_tree.mojom |
+++ b/services/ui/public/interfaces/window_tree.mojom |
@@ -12,6 +12,7 @@ import "services/ui/public/interfaces/surface.mojom"; |
import "services/ui/public/interfaces/window_manager.mojom"; |
import "services/ui/public/interfaces/window_manager_constants.mojom"; |
import "services/ui/public/interfaces/window_tree_constants.mojom"; |
+import "skia/public/interfaces/bitmap.mojom"; |
import "ui/events/mojo/event.mojom"; |
import "ui/gfx/geometry/mojo/geometry.mojom"; |
import "ui/platform_window/mojo/text_input_state.mojom"; |
@@ -113,6 +114,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 |
+ // 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 +276,20 @@ 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. |
+ // |
+ // This will cause the window server to create a window with |
+ // |drag_representation| and start processing events for drag and |
+ // drop. It will set the clipboard’s DRAG clipboard to |drag_data| |
+ // (this is part of this interface since mojom.Clipboard is usually |
+ // on a different pipe). |
+ PerformDragDrop(uint32 change_id, |
+ uint32 source_window_id, |
+ map<string, array<uint8>> drag_data, |
+ uint32 drag_operation, |
+ gfx.mojom.Point cursor_location, |
+ skia.mojom.Bitmap drag_representation); |
}; |
// Changes to windows are not sent to the connection that originated the |
@@ -400,6 +420,35 @@ interface WindowTreeClient { |
OnWindowPredefinedCursorChanged(uint32 window_id, Cursor cursor_id); |
+ // 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, |
+ map<string, array<uint8>> drag_data, |
+ 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); |
+ |
// A change initiated from the client has completed. See description of |
// change ids for details. |
OnChangeCompleted(uint32 change_id, bool success); |