Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(362)

Unified Diff: services/ui/public/cpp/window_tree_client.h

Issue 2060513002: Tab dragging as implemented as a mus API. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: dcheng nits Created 4 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: services/ui/public/cpp/window_tree_client.h
diff --git a/services/ui/public/cpp/window_tree_client.h b/services/ui/public/cpp/window_tree_client.h
index d58eba8f1443775faa17e8982186611078e16596..07b6635c5f0a2d65b7d0b31ad193d341250120a3 100644
--- a/services/ui/public/cpp/window_tree_client.h
+++ b/services/ui/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. |callback| will be asynchronously called with the
+ // whether the move loop completed successfully.
+ void PerformWindowMove(Window* window,
+ ui::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,
+ 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:
@@ -396,6 +415,17 @@ class WindowTreeClient : public mojom::WindowTreeClient,
// Monotonically increasing ID for event observers.
uint32_t event_observer_id_ = 0u;
+ // The current change id for the client.
+ uint32_t current_move_loop_change_ = 0u;
+
+ // The current change id for the window manager.
+ uint32_t current_wm_move_loop_change_ = 0u;
+ Id current_wm_move_loop_window_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);
« no previous file with comments | « services/ui/public/cpp/window_manager_delegate.h ('k') | services/ui/public/interfaces/window_manager.mojom » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698