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

Unified Diff: services/ui/ws/server_window.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/server_window.cc
diff --git a/services/ui/ws/server_window.cc b/services/ui/ws/server_window.cc
index 2f59aac17171702f6ec3711189f827a13eb55524..8570d0241f047ea576308d77d7b35328a2e289f5 100644
--- a/services/ui/ws/server_window.cc
+++ b/services/ui/ws/server_window.cc
@@ -14,6 +14,7 @@
#include "services/ui/ws/server_window_compositor_frame_sink_manager.h"
#include "services/ui/ws/server_window_delegate.h"
#include "services/ui/ws/server_window_observer.h"
+#include "ui/base/cursor/cursor.h"
namespace ui {
namespace ws {
@@ -34,8 +35,8 @@ ServerWindow::ServerWindow(ServerWindowDelegate* delegate,
visible_(false),
// Default to kPointer as kNull doesn't change the cursor, it leaves
// the last non-null cursor.
- cursor_id_(mojom::CursorType::kPointer),
- non_client_cursor_id_(mojom::CursorType::kPointer),
+ cursor_(ui::CursorType::kPointer),
+ non_client_cursor_(ui::CursorType::kPointer),
opacity_(1),
can_focus_(true),
properties_(properties),
@@ -299,18 +300,18 @@ void ServerWindow::SetOpacity(float value) {
observer.OnWindowOpacityChanged(this, old_opacity, opacity_);
}
-void ServerWindow::SetPredefinedCursor(ui::mojom::CursorType value) {
- if (value == cursor_id_)
+void ServerWindow::SetCursor(const ui::CursorData& value) {
+ if (cursor_.IsSameAs(value))
return;
- cursor_id_ = value;
+ cursor_ = value;
for (auto& observer : observers_)
- observer.OnWindowPredefinedCursorChanged(this, value);
+ observer.OnWindowCursorChanged(this, value);
}
-void ServerWindow::SetNonClientCursor(ui::mojom::CursorType value) {
- if (value == non_client_cursor_id_)
+void ServerWindow::SetNonClientCursor(const ui::CursorData& value) {
+ if (non_client_cursor_.IsSameAs(value))
return;
- non_client_cursor_id_ = value;
+ non_client_cursor_ = value;
for (auto& observer : observers_)
observer.OnWindowNonClientCursorChanged(this, value);
}

Powered by Google App Engine
This is Rietveld 408576698