| Index: components/mus/ws/window_server.cc
|
| diff --git a/components/mus/ws/window_server.cc b/components/mus/ws/window_server.cc
|
| index 77ef0e2595cf0366fadea9606cd8399f148a1b54..ce7f4460970d010d4812b56d463209a9ca0b5af0 100644
|
| --- a/components/mus/ws/window_server.cc
|
| +++ b/components/mus/ws/window_server.cc
|
| @@ -30,6 +30,13 @@
|
| namespace mus {
|
| namespace ws {
|
|
|
| +struct WindowServer::CurrentMoveLoopState {
|
| + uint32_t change_id;
|
| + ServerWindow* window;
|
| + WindowTree* initiator;
|
| + gfx::Rect revert_bounds;
|
| +};
|
| +
|
| WindowServer::WindowServer(
|
| WindowServerDelegate* delegate,
|
| const scoped_refptr<mus::SurfacesState>& surfaces_state)
|
| @@ -324,6 +331,24 @@ void WindowServer::WindowManagerCreatedTopLevelWindow(
|
| change.client_change_id, window);
|
| }
|
|
|
| +void WindowServer::WindowManagerCompletedMoveLoop(
|
| + uint32_t window_manager_change_id,
|
| + const ServerWindow* window,
|
| + bool completed) {
|
| + InFlightWindowManagerChange change;
|
| + if (!GetAndClearInFlightWindowManagerChange(window_manager_change_id,
|
| + &change)) {
|
| + return;
|
| + }
|
| + if (!window) {
|
| + WindowManagerSentBogusMessage();
|
| + return;
|
| + }
|
| +
|
| + WindowTree* tree = GetTreeWithId(change.client_id);
|
| + tree->OnChangeCompleted(change.client_change_id, completed);
|
| +}
|
| +
|
| void WindowServer::ProcessWindowBoundsChanged(const ServerWindow* window,
|
| const gfx::Rect& old_bounds,
|
| const gfx::Rect& new_bounds) {
|
| @@ -415,6 +440,42 @@ void WindowServer::SetPaintCallback(
|
| window_paint_callback_ = callback;
|
| }
|
|
|
| +void WindowServer::StartMoveLoop(uint32_t change_id,
|
| + ServerWindow* window,
|
| + WindowTree* initiator,
|
| + const gfx::Rect& revert_bounds) {
|
| + current_move_loop_.reset(
|
| + new CurrentMoveLoopState{change_id, window, initiator, revert_bounds});
|
| +}
|
| +
|
| +void WindowServer::EndMoveLoop() {
|
| + current_move_loop_.reset();
|
| +}
|
| +
|
| +uint32_t WindowServer::GetCurrentMoveLoopChangeId() {
|
| + if (current_move_loop_)
|
| + return current_move_loop_->change_id;
|
| + return 0;
|
| +}
|
| +
|
| +ServerWindow* WindowServer::GetCurrentMoveLoopWindow() {
|
| + if (current_move_loop_)
|
| + return current_move_loop_->window;
|
| + return nullptr;
|
| +}
|
| +
|
| +WindowTree* WindowServer::GetCurrentMoveLoopInitiator() {
|
| + if (current_move_loop_)
|
| + return current_move_loop_->initiator;
|
| + return nullptr;
|
| +}
|
| +
|
| +gfx::Rect WindowServer::GetCurrentMoveLoopRevertBounds() {
|
| + if (current_move_loop_)
|
| + return current_move_loop_->revert_bounds;
|
| + return gfx::Rect();
|
| +}
|
| +
|
| bool WindowServer::GetAndClearInFlightWindowManagerChange(
|
| uint32_t window_manager_change_id,
|
| InFlightWindowManagerChange* change) {
|
|
|