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() { |
sky
2016/09/13 18:15:32
Why does this information need to be held by the W
Elliot Glaysher
2016/09/14 22:19:16
Parallelism with storing the move loop for the saf
sky
2016/09/14 22:52:02
Isn't this information seldomly used? If so, can y
Elliot Glaysher
2016/09/15 17:12:40
WindowServer doesn't publicly expose the WindowTre
sky
2016/09/15 18:10:46
Fair enough.
|
+ 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_); |