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 24ef564f3f580368956a21ac3c6bca19b0b36671..900e809c1a6575cccf3e839932fdb0d8a476770b 100644 |
| --- a/components/mus/public/cpp/window_tree_client.h |
| +++ b/components/mus/public/cpp/window_tree_client.h |
| @@ -181,6 +181,17 @@ 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 |
|
sky
2016/06/29 00:04:08
Update comment (no longer blocks).
|
| + // loop to handle incoming move messages. |
| + void PerformWindowMove(Window* window, |
| + ::mus::mojom::MoveLoopSource source, |
| + const gfx::Point& cursor_location, |
| + 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); } |
| @@ -248,6 +259,9 @@ class WindowTreeClient : public mojom::WindowTreeClient, |
| void OnReceivedCursorLocationMemory(mojo::ScopedSharedBufferHandle handle); |
| + // Callback passed from WmPerformMoveLoop(). |
| + void OnWmMoveLoopCompleted(uint32_t change_id, bool completed); |
| + |
| // Overridden from WindowTreeClient: |
| void OnEmbed(ClientSpecificId client_id, |
| mojom::WindowDataPtr root, |
| @@ -322,6 +336,11 @@ 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, |
| + ::mus::mojom::MoveLoopSource source, |
| + 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: |
| @@ -397,6 +416,12 @@ class WindowTreeClient : public mojom::WindowTreeClient, |
| // Monotonically increasing ID for event observers. |
| uint32_t event_observer_id_ = 0u; |
| + uint32_t current_move_loop_change_ = 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); |