Index: services/ui/ws/window_server.cc |
diff --git a/services/ui/ws/window_server.cc b/services/ui/ws/window_server.cc |
index dd5e3cae6261063b7fe094896a1deb36b3d9f6c9..f4d9a4ec082a6ee855a047df80d7a017b7b147d6 100644 |
--- a/services/ui/ws/window_server.cc |
+++ b/services/ui/ws/window_server.cc |
@@ -38,6 +38,12 @@ struct WindowServer::CurrentMoveLoopState { |
gfx::Rect revert_bounds; |
}; |
+struct WindowServer::CurrentDragLoopState { |
+ uint32_t change_id; |
+ ServerWindow* window; |
+ WindowTree* initiator; |
+}; |
+ |
WindowServer::WindowServer(WindowServerDelegate* delegate) |
: delegate_(delegate), |
surfaces_state_(new SurfacesState()), |
@@ -484,6 +490,35 @@ gfx::Rect WindowServer::GetCurrentMoveLoopRevertBounds() { |
return gfx::Rect(); |
} |
+void WindowServer::StartDragLoop(uint32_t change_id, |
+ ServerWindow* window, |
+ WindowTree* initiator) { |
+ current_drag_loop_.reset( |
+ new CurrentDragLoopState{change_id, window, initiator}); |
+} |
+ |
+void WindowServer::EndDragLoop() { |
+ current_drag_loop_.reset(); |
+} |
+ |
+uint32_t WindowServer::GetCurrentDragLoopChangeId() { |
+ if (current_drag_loop_) |
+ return current_drag_loop_->change_id; |
+ return 0u; |
+} |
+ |
+ServerWindow* WindowServer::GetCurrentDragLoopWindow() { |
+ if (current_drag_loop_) |
+ return current_drag_loop_->window; |
+ return nullptr; |
+} |
+ |
+WindowTree* WindowServer::GetCurrentDragLoopInitiator() { |
+ if (current_drag_loop_) |
+ return current_drag_loop_->initiator; |
+ return nullptr; |
+} |
+ |
void WindowServer::OnDisplayReady(Display* display, bool is_first) { |
if (gpu_channel_) |
display->platform_display()->OnGpuChannelEstablished(gpu_channel_); |