Chromium Code Reviews| 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..b588d72158a56a9dd47b4fdb1d266faa04399984 100644 |
| --- a/components/mus/public/cpp/window_tree_client.h |
| +++ b/components/mus/public/cpp/window_tree_client.h |
| @@ -180,6 +180,15 @@ 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. |
| + void PerformWindowMove(Window* window, const gfx::Point& cursor_location, |
|
sky
2016/06/24 19:59:00
nit: run git cl format
|
| + const base::Callback<void(bool)>& callback); |
| + |
| + // 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 +308,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 +331,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 +353,8 @@ class WindowTreeClient : public mojom::WindowTreeClient, |
| Window* window, |
| const gfx::Vector2d& offset, |
| const gfx::Insets& hit_area) override; |
| + void OnWmMoveLoopCompleted(uint32_t change_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,10 @@ class WindowTreeClient : public mojom::WindowTreeClient, |
| // Monotonically increasing ID for event observers. |
| uint32_t event_observer_id_ = 0u; |
| + // Callback executed when a move loop initiated by PerformWindowMove() is |
| + // completed. |
| + base::Callback<void(bool)> on_current_move_finished_; |
| + |
| base::WeakPtrFactory<WindowTreeClient> weak_factory_; |
| DISALLOW_COPY_AND_ASSIGN(WindowTreeClient); |