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

Unified Diff: services/ui/ws/window_tree.cc

Issue 2830703003: [views-mus] Support custom cursors. (Closed)
Patch Set: rebase to tot Created 3 years, 8 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/ws/window_tree.cc
diff --git a/services/ui/ws/window_tree.cc b/services/ui/ws/window_tree.cc
index 76cca8652d6419b7dd76004cafdf4c11c62443b7..5912a7267e466473a5665d0719a44325a71d25d5 100644
--- a/services/ui/ws/window_tree.cc
+++ b/services/ui/ws/window_tree.cc
@@ -898,7 +898,7 @@ void WindowTree::ProcessWindowOpacityChanged(const ServerWindow* window,
}
void WindowTree::ProcessCursorChanged(const ServerWindow* window,
- mojom::CursorType cursor_id,
+ const ui::CursorData& cursor,
bool originated_change) {
if (originated_change)
return;
@@ -906,7 +906,7 @@ void WindowTree::ProcessCursorChanged(const ServerWindow* window,
if (!IsWindowKnown(window, &client_window_id))
return;
- client()->OnWindowPredefinedCursorChanged(client_window_id.id, cursor_id);
+ client()->OnWindowCursorChanged(client_window_id.id, cursor);
}
void WindowTree::ProcessFocusChanged(const ServerWindow* old_focused_window,
@@ -1773,9 +1773,9 @@ void WindowTree::SetEventTargetingPolicy(Id transport_window_id,
window->set_event_targeting_policy(policy);
}
-void WindowTree::SetPredefinedCursor(uint32_t change_id,
- Id transport_window_id,
- ui::mojom::CursorType cursor_id) {
+void WindowTree::SetCursor(uint32_t change_id,
+ Id transport_window_id,
+ ui::CursorData cursor) {
ServerWindow* window =
sky 2017/04/26 22:16:16 Should this fail if cursor type is custom and curs
Elliot Glaysher 2017/04/26 23:09:04 Changed this method to do lots of validation with
sky 2017/04/26 23:35:01 I think you meant *love* :) Seriously though, I ha
GetWindowByClientId(ClientWindowId(transport_window_id));
@@ -1784,7 +1784,7 @@ void WindowTree::SetPredefinedCursor(uint32_t change_id,
if (success) {
Operation op(this, window_server_,
OperationType::SET_WINDOW_PREDEFINED_CURSOR);
- window->SetPredefinedCursor(cursor_id);
+ window->SetCursor(cursor);
}
client()->OnChangeCompleted(change_id, success);
}
@@ -2232,11 +2232,11 @@ void WindowTree::WmSetFrameDecorationValues(
}
void WindowTree::WmSetNonClientCursor(uint32_t window_id,
- mojom::CursorType cursor_id) {
+ ui::CursorData cursor) {
DCHECK(window_manager_state_);
ServerWindow* window = GetWindowByClientId(ClientWindowId(window_id));
if (window) {
- window->SetNonClientCursor(cursor_id);
+ window->SetNonClientCursor(cursor);
} else {
DVLOG(1) << "trying to update non-client cursor of invalid window";
}

Powered by Google App Engine
This is Rietveld 408576698