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

Side by Side 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: Clear the implicit pointer drags before start. 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 unified diff | Download patch
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 module ui.mojom; 5 module ui.mojom;
6 6
7 import "cc/ipc/surface_id.mojom"; 7 import "cc/ipc/surface_id.mojom";
8 import "services/ui/public/interfaces/cursor.mojom"; 8 import "services/ui/public/interfaces/cursor.mojom";
9 import "services/ui/public/interfaces/event_matcher.mojom"; 9 import "services/ui/public/interfaces/event_matcher.mojom";
10 import "services/ui/public/interfaces/mus_constants.mojom"; 10 import "services/ui/public/interfaces/mus_constants.mojom";
(...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after
106 // TODO(sky): convert additional_client_areas to a path. 106 // TODO(sky): convert additional_client_areas to a path.
107 SetClientArea(uint32 window_id, 107 SetClientArea(uint32 window_id,
108 gfx.mojom.Insets insets, 108 gfx.mojom.Insets insets,
109 array<gfx.mojom.Rect>? additional_client_areas); 109 array<gfx.mojom.Rect>? additional_client_areas);
110 110
111 // Mouse events outside a hit test mask do not hit the window. The |mask| is 111 // Mouse events outside a hit test mask do not hit the window. The |mask| is
112 // in window local coordinates. Pass null to clear the mask. 112 // in window local coordinates. Pass null to clear the mask.
113 // TODO(jamescook): Convert |mask| to a path. http://crbug.com/613210 113 // TODO(jamescook): Convert |mask| to a path. http://crbug.com/613210
114 SetHitTestMask(uint32 window_id, gfx.mojom.Rect? mask); 114 SetHitTestMask(uint32 window_id, gfx.mojom.Rect? mask);
115 115
116 // Called by clients that want to accept drag and drops. Windows default to
117 // this being disabled; a window must actively opt-in to receiving OnDrag*()
118 // calls.
119 SetCanAcceptDrops(uint32 window_id, bool accepts_drops);
120
116 // Sets the visibility of the specified window to |visible|. Connections are 121 // Sets the visibility of the specified window to |visible|. Connections are
117 // allowed to change the visibility of any window they have created, as well 122 // allowed to change the visibility of any window they have created, as well
118 // as any of their roots. 123 // as any of their roots.
119 SetWindowVisibility(uint32 change_id, uint32 window_id, bool visible); 124 SetWindowVisibility(uint32 change_id, uint32 window_id, bool visible);
120 125
121 // Sets an individual named property. Setting an individual property to null 126 // Sets an individual named property. Setting an individual property to null
122 // deletes the property. 127 // deletes the property.
123 SetWindowProperty(uint32 change_id, 128 SetWindowProperty(uint32 change_id,
124 uint32 window_id, 129 uint32 window_id,
125 string name, 130 string name,
(...skipping 137 matching lines...) Expand 10 before | Expand all | Expand 10 after
263 // Tells the window manager to start moving the window. OnChangeCompleted is 268 // Tells the window manager to start moving the window. OnChangeCompleted is
264 // called on whether the move was canceled. Because there's a delay between 269 // called on whether the move was canceled. Because there's a delay between
265 // when a client sends this message and when the window manager starts acting 270 // when a client sends this message and when the window manager starts acting
266 // on it, pass the cursor location at the start of the move. 271 // on it, pass the cursor location at the start of the move.
267 PerformWindowMove(uint32 change_id, uint32 window_id, MoveLoopSource source, 272 PerformWindowMove(uint32 change_id, uint32 window_id, MoveLoopSource source,
268 gfx.mojom.Point cursor); 273 gfx.mojom.Point cursor);
269 274
270 // Tells the window manager to cancel any in progress window move started with 275 // Tells the window manager to cancel any in progress window move started with
271 // StartWindowMove() and to revert the window bounds to how they were. 276 // StartWindowMove() and to revert the window bounds to how they were.
272 CancelWindowMove(uint32 window_id); 277 CancelWindowMove(uint32 window_id);
278
279 // Called by the client to start a drag operation. |source_window_id| is the
280 // source window, |drag_data| is the entire set of mime to raw data
281 // mapping. We send this during the start of the drag because most views
282 // clients will try to read all this data on first entry.
283 PerformDragDrop(uint32 change_id,
284 uint32 source_window_id,
285 int32 drag_pointer,
286 map<string, array<uint8>> drag_data,
287 uint32 drag_operation);
273 }; 288 };
274 289
275 // Changes to windows are not sent to the connection that originated the 290 // Changes to windows are not sent to the connection that originated the
276 // change. For example, if connection 1 changes the bounds of a window by 291 // change. For example, if connection 1 changes the bounds of a window by
277 // calling SetWindowBounds(), connection 1 does not receive 292 // calling SetWindowBounds(), connection 1 does not receive
278 // OnWindowBoundsChanged(). 293 // OnWindowBoundsChanged().
279 interface WindowTreeClient { 294 interface WindowTreeClient {
280 // Invoked when the client application has been embedded at |root|. 295 // Invoked when the client application has been embedded at |root|.
281 // See Embed() on WindowTree for more details. |tree| will be a handle back to 296 // See Embed() on WindowTree for more details. |tree| will be a handle back to
282 // the window manager service, unless the connection is to the root connection 297 // the window manager service, unless the connection is to the root connection
(...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after
393 408
394 // Called in two distinct cases: when a window known to the connection gains 409 // Called in two distinct cases: when a window known to the connection gains
395 // focus, or when focus moves from a window known to the connection to a 410 // focus, or when focus moves from a window known to the connection to a
396 // window not known to the connection. In the later case |focused_window_id| 411 // window not known to the connection. In the later case |focused_window_id|
397 // is 0. As with other functions this is only called if the client did not 412 // is 0. As with other functions this is only called if the client did not
398 // initiate the change. 413 // initiate the change.
399 OnWindowFocused(uint32 focused_window_id); 414 OnWindowFocused(uint32 focused_window_id);
400 415
401 OnWindowPredefinedCursorChanged(uint32 window_id, Cursor cursor_id); 416 OnWindowPredefinedCursorChanged(uint32 window_id, Cursor cursor_id);
402 417
418 // Called when the mouse cursor enters a window that has opted into accepting
419 // drags for the first time, providing a list of available mime types. We
420 // want to send this set of data only one time, so this isn't part of
421 // OnDragEnter(), which occurs every time the mouse enters a window.
422 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
423 map<string, array<uint8>> drag_data);
424
425 // Called when the mouse cursor enters a window that has opted into
426 // accepting drags through SetAcceptsDrags(), providing a list
427 // of available mime types. Returns a bitmask of the supported
428 // operations.
429 OnDragEnter(uint32 window,
430 uint32 key_state,
431 gfx.mojom.Point position,
432 uint32 effect_bitmask) => (uint32 supported_op_bitmask);
433
434 // Called when the pointer moves over the window after the initial
435 // DragEnter. Returns a bitmask of the supported operations at this
436 // location.
437 OnDragOver(uint32 window,
438 uint32 key_state,
439 gfx.mojom.Point position,
440 uint32 effect_bitmask) => (uint32 supported_op_bitmask);
441
442 // Called when the pointer leaves a window or if the drop is
443 // canceled.
444 OnDragLeave(uint32 window);
445
446 // Called when the drop occurs on a window. Returns the action
447 // taken.
448 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
449 uint32 key_state,
450 gfx.mojom.Point position,
451 uint32 effect_bitmask) => (uint32 effect_taken);
452
453 // Called after OnDragDrop completes for every |window| which received an
454 // OnDragStart() message. This signals that a client can forget the
455 // |drag_data| passed in via the first message.
456 OnDragFinish(uint32 window);
457
403 // A change initiated from the client has completed. See description of 458 // A change initiated from the client has completed. See description of
404 // change ids for details. 459 // change ids for details.
405 OnChangeCompleted(uint32 change_id, bool success); 460 OnChangeCompleted(uint32 change_id, bool success);
406 461
407 // The WindowManager is requesting the specified window to close. If the 462 // The WindowManager is requesting the specified window to close. If the
408 // client allows the change it should delete the window. 463 // client allows the change it should delete the window.
409 RequestClose(uint32 window_id); 464 RequestClose(uint32 window_id);
410 465
411 // See description of WindowManager for details. 466 // See description of WindowManager for details.
412 GetWindowManager(associated WindowManager& internal); 467 GetWindowManager(associated WindowManager& internal);
413 }; 468 };
414 469
415 // Mus provides this interface as a way for clients to connect and obtain a 470 // Mus provides this interface as a way for clients to connect and obtain a
416 // WindowTree handle with a supplied WindowTreeClient handle. The 471 // WindowTree handle with a supplied WindowTreeClient handle. The
417 // WindowTreeClient has no roots, use NewTopLevelWindow() to create one. 472 // WindowTreeClient has no roots, use NewTopLevelWindow() to create one.
418 interface WindowTreeFactory { 473 interface WindowTreeFactory {
419 CreateWindowTree(WindowTree& tree_request, WindowTreeClient client); 474 CreateWindowTree(WindowTree& tree_request, WindowTreeClient client);
420 }; 475 };
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698