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

Unified Diff: components/mus/ws/window_tree_host_impl.h

Issue 1465803003: mus: Let clients set the cursor of their window. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Do it the other way + explicit checks that it is a mouse pointer. Created 5 years 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
« no previous file with comments | « components/mus/ws/window_tree_apptest.cc ('k') | components/mus/ws/window_tree_host_impl.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/mus/ws/window_tree_host_impl.h
diff --git a/components/mus/ws/window_tree_host_impl.h b/components/mus/ws/window_tree_host_impl.h
index 3ed61fe2e99408a04e8003b67ffcc64c1d7642b0..1d50dc0ea345027bf197d6bf4e45248bfef51f22 100644
--- a/components/mus/ws/window_tree_host_impl.h
+++ b/components/mus/ws/window_tree_host_impl.h
@@ -93,6 +93,10 @@ class WindowTreeHostImpl : public DisplayManagerDelegate,
const ui::TextInputState& state);
void SetImeVisibility(ServerWindow* window, bool visible);
+ // Called when a client updates a cursor. This will update the cursor on the
+ // native display if the cursor is currently under |window|.
+ void OnCursorUpdated(ServerWindow* window);
+
// WindowTreeHost:
void SetSize(mojo::SizePtr size) override;
void SetTitle(const mojo::String& title) override;
@@ -118,6 +122,8 @@ class WindowTreeHostImpl : public DisplayManagerDelegate,
void OnEventAckTimeout();
void DispatchNextEventFromQueue();
+ void UpdateNativeCursor(int32_t cursor_id);
+
// DisplayManagerDelegate:
ServerWindow* GetRootWindow() override;
void OnEvent(mojom::EventPtr event) override;
@@ -159,6 +165,9 @@ class WindowTreeHostImpl : public DisplayManagerDelegate,
mojom::WindowManagerPtr window_manager_;
mojom::WindowTree* tree_awaiting_input_ack_;
+ // The last cursor set. Used to track whether we need to change the cursor.
+ int32_t last_cursor_;
+
std::set<WindowId> activation_parents_;
// Set of windows with surfaces that need to be destroyed once the frame
« no previous file with comments | « components/mus/ws/window_tree_apptest.cc ('k') | components/mus/ws/window_tree_host_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698