Index: components/mus/public/cpp/window_tree_client.h |
diff --git a/components/mus/public/cpp/window_tree_client.h b/components/mus/public/cpp/window_tree_client.h |
index f22e3840632a793f7da52bac3f3456784cf59587..ca0555eb51dc9368331d4bee5c44e1f2861f3e58 100644 |
--- a/components/mus/public/cpp/window_tree_client.h |
+++ b/components/mus/public/cpp/window_tree_client.h |
@@ -180,6 +180,14 @@ class WindowTreeClient : public mojom::WindowTreeClient, |
// will be ignored. |
void SetEventObserver(mojom::EventMatcherPtr matcher); |
+ // Performs a window move. This call blocks but spins up a nested message |
+ // loop to handle incoming move messages. |
+ bool PerformWindowMove(Window* window, const gfx::Point& cursor_location); |
+ |
+ // Cancels a in progress window move. (If no window is currently being moved, |
+ // does nothing.) |
+ void CancelWindowMove(Window* window); |
+ |
// Creates and returns a new Window (which is owned by the window server). |
// Windows are initially hidden, use SetVisible(true) to show. |
Window* NewWindow() { return NewWindow(nullptr); } |
@@ -299,6 +307,7 @@ class WindowTreeClient : public mojom::WindowTreeClient, |
void OnWindowPredefinedCursorChanged(Id window_id, |
mojom::Cursor cursor) override; |
void OnChangeCompleted(uint32_t change_id, bool success) override; |
+ void OnMoveLoopCompleted(uint32_t change_id, bool success) override; |
void RequestClose(uint32_t window_id) override; |
void GetWindowManager( |
mojo::AssociatedInterfaceRequest<WindowManager> internal) override; |
@@ -321,6 +330,10 @@ class WindowTreeClient : public mojom::WindowTreeClient, |
transport_properties) override; |
void WmClientJankinessChanged(ClientSpecificId client_id, |
bool janky) override; |
+ void WmPerformMoveLoop(uint32_t change_id, |
+ Id window_id, |
+ const gfx::Point& cursor_location) override; |
+ void WmCancelMoveLoop(uint32_t window_id) override; |
void OnAccelerator(uint32_t id, std::unique_ptr<ui::Event> event) override; |
// Overridden from WindowManagerClient: |
@@ -339,6 +352,9 @@ class WindowTreeClient : public mojom::WindowTreeClient, |
Window* window, |
const gfx::Vector2d& offset, |
const gfx::Insets& hit_area) override; |
+ void OnWmMoveLoopCompleted(uint32_t change_id, |
+ uint32_t window_id, |
+ bool completed) override; |
// The one int in |cursor_location_mapping_|. When we read from this |
// location, we must always read from it atomically. |
@@ -396,6 +412,11 @@ class WindowTreeClient : public mojom::WindowTreeClient, |
// Monotonically increasing ID for event observers. |
uint32_t event_observer_id_ = 0u; |
+ // We spin up a nested message loop to handle interactive window moves; this |
+ // is the return value and the Closure to call to complete the loop. |
+ bool current_move_succeeded_ = false; |
+ base::Closure on_current_move_finished_; |
+ |
base::WeakPtrFactory<WindowTreeClient> weak_factory_; |
DISALLOW_COPY_AND_ASSIGN(WindowTreeClient); |