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

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

Issue 2830703003: [views-mus] Support custom cursors. (Closed)
Patch Set: fix cast_shell_linux 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
« no previous file with comments | « services/ui/ws/server_window.h ('k') | services/ui/ws/server_window_observer.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..c3760afdc3a06b18a2234ec3b6e5bd481584ffa5 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,20 +300,20 @@ 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(ui::CursorData value) {
+ if (cursor_.IsSameAs(value))
return;
- cursor_id_ = value;
+ cursor_ = std::move(value);
for (auto& observer : observers_)
- observer.OnWindowPredefinedCursorChanged(this, value);
+ observer.OnWindowCursorChanged(this, cursor_);
}
-void ServerWindow::SetNonClientCursor(ui::mojom::CursorType value) {
- if (value == non_client_cursor_id_)
+void ServerWindow::SetNonClientCursor(ui::CursorData value) {
+ if (non_client_cursor_.IsSameAs(value))
return;
- non_client_cursor_id_ = value;
+ non_client_cursor_ = std::move(value);
for (auto& observer : observers_)
- observer.OnWindowNonClientCursorChanged(this, value);
+ observer.OnWindowNonClientCursorChanged(this, non_client_cursor_);
}
void ServerWindow::SetTransform(const gfx::Transform& transform) {
« no previous file with comments | « services/ui/ws/server_window.h ('k') | services/ui/ws/server_window_observer.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698