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

Unified Diff: components/mus/ws/window_tree_impl.cc

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_impl.h ('k') | components/mus/ws/window_tree_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/mus/ws/window_tree_impl.cc
diff --git a/components/mus/ws/window_tree_impl.cc b/components/mus/ws/window_tree_impl.cc
index 38c93052512e27f738f688e6de5851819d58a685..5edb5461037cae48f9bdf8a21dbba5f30002692d 100644
--- a/components/mus/ws/window_tree_impl.cc
+++ b/components/mus/ws/window_tree_impl.cc
@@ -364,6 +364,15 @@ void WindowTreeImpl::ProcessWillChangeWindowVisibility(
NotifyDrawnStateChanged(window, window_target_drawn_state);
}
+void WindowTreeImpl::ProcessCursorChanged(const ServerWindow* window,
+ int32_t cursor_id,
+ bool originated_change) {
+ if (originated_change)
+ return;
+ client()->OnWindowPredefinedCursorChanged(WindowIdToTransportId(window->id()),
+ mojom::Cursor(cursor_id));
+}
+
void WindowTreeImpl::ProcessFocusChanged(
const ServerWindow* old_focused_window,
const ServerWindow* new_focused_window) {
@@ -858,6 +867,21 @@ void WindowTreeImpl::SetCanFocus(uint32_t window_id, bool can_focus) {
window->set_can_focus(can_focus);
}
+void WindowTreeImpl::SetPredefinedCursor(uint32_t change_id,
+ uint32_t window_id,
+ mus::mojom::Cursor cursor_id) {
+ ServerWindow* window = GetWindow(WindowIdFromTransportId(window_id));
+
+ // Only the owner of the window can change the bounds.
+ bool success = window && access_policy_->CanSetCursorProperties(window);
+ if (success) {
+ Operation op(this, connection_manager_,
+ OperationType::SET_WINDOW_PREDEFINED_CURSOR);
+ window->SetPredefinedCursor(cursor_id);
+ }
+ client_->OnChangeCompleted(change_id, success);
+}
+
void WindowTreeImpl::WmResponse(uint32 change_id, bool response) {
if (GetHost() && GetHost()->GetWindowTree() == this)
connection_manager_->WindowManagerChangeCompleted(change_id, response);
« no previous file with comments | « components/mus/ws/window_tree_impl.h ('k') | components/mus/ws/window_tree_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698