Chromium Code Reviews| Index: services/ui/ws/window_tree.h |
| diff --git a/services/ui/ws/window_tree.h b/services/ui/ws/window_tree.h |
| index 4a03b181d9bd620f0c1650990eb315e56b9546f2..9bbeaafa5e3698b96b075e4c9b80ca610a4a5be2 100644 |
| --- a/services/ui/ws/window_tree.h |
| +++ b/services/ui/ws/window_tree.h |
| @@ -17,6 +17,7 @@ |
| #include "base/callback.h" |
| #include "base/macros.h" |
| +#include "base/memory/weak_ptr.h" |
| #include "cc/ipc/surface_id.mojom.h" |
| #include "mojo/public/cpp/bindings/associated_binding.h" |
| #include "services/ui/public/interfaces/window_tree.mojom.h" |
| @@ -372,6 +373,11 @@ class WindowTree : public mojom::WindowTree, |
| void NotifyChangeCompleted(uint32_t change_id, |
| mojom::WindowManagerErrorCode error_code); |
| + // Callback for when WmMoveDragImage completes. This sends off the next |
| + // queued move under the image if the mouse had further moves while we were |
| + // waiting for the last move to be acknowledged. |
| + void OnWmMoveDragImageCompleted(); |
| + |
| // WindowTree: |
| void NewWindow(uint32_t change_id, |
| Id transport_window_id, |
| @@ -460,8 +466,12 @@ class WindowTree : public mojom::WindowTree, |
| void PerformDragDrop( |
| uint32_t change_id, |
| Id source_window_id, |
| + const gfx::Point& screen_location, |
| const std::unordered_map<std::string, std::vector<uint8_t>>& drag_data, |
| - uint32_t drag_operation) override; |
| + const SkBitmap& drag_image, |
| + const gfx::Vector2d& drag_image_offset, |
| + uint32_t drag_operation, |
| + ui::mojom::DragEventSource source) override; |
| void CancelDragDrop(Id window_id) override; |
| void PerformWindowMove(uint32_t change_id, |
| Id window_id, |
| @@ -500,6 +510,7 @@ class WindowTree : public mojom::WindowTree, |
| const ServerWindow* window) const override; |
| // DragSource: |
| + void OnDragContinued(const gfx::Point& location) override; |
| void OnDragCompleted(bool success, uint32_t action_taken) override; |
| ServerWindow* GetWindowById(const WindowId& id) override; |
| DragTargetConnection* GetDragTargetForWindow( |
| @@ -586,6 +597,19 @@ class WindowTree : public mojom::WindowTree, |
| waiting_for_top_level_window_info_; |
| bool embedder_intercepts_events_ = false; |
| + // Whether we're waiting for an ack from a WmMoveDragImage message. |
|
sky
2017/03/23 00:05:36
Similar to WindowManager please put the state rela
Elliot Glaysher
2017/03/23 19:58:44
Done. But I left the weak_factory_ in WindowTree (
|
| + bool waiting_for_move_drag_ack_ = false; |
| + |
| + // Whether we've queued a move to |queued_cursor_location_| when we get an |
| + // ack from WmMoveDragImage. |
| + bool has_queued_drag_window_move_ = false; |
| + |
| + // When |has_queued_drag_window_move_| is true, this is a location which |
| + // should be sent to the window manager as soon as it acked the last one. |
| + gfx::Point queued_cursor_location_; |
| + |
| + base::WeakPtrFactory<WindowTree> weak_factory_; |
| + |
| DISALLOW_COPY_AND_ASSIGN(WindowTree); |
| }; |