Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(47)

Unified Diff: services/ui/public/interfaces/window_tree.mojom

Issue 2266603002: mus: Implement interwindow drag and drop (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: more comments Created 4 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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..d7bbd53256872b458e9ecc92fcc7981ada84ee7b 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,45 @@ interface WindowTreeClient {
OnWindowPredefinedCursorChanged(uint32 window_id, Cursor cursor_id);
+ // Called when the mouse cursor enters a window on this connection 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.
+ OnDragDropStart(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.
+ OnCompleteDrop(uint32 window,
+ uint32 key_state,
+ gfx.mojom.Point position,
+ uint32 effect_bitmask) => (uint32 effect_taken);
+
+ // Called after OnDragDrop completes for every connection which received an
+ // OnDragDropStart() message. This signals that a client can forget the
+ // |drag_data| passed in via the first message.
+ OnDragDropDone();
+
// A change initiated from the client has completed. See description of
// change ids for details.
OnChangeCompleted(uint32 change_id, bool success);
« no previous file with comments | « services/ui/public/cpp/window_tree_client.cc ('k') | services/ui/public/interfaces/window_tree_constants.mojom » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698