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

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

Issue 2376583003: mus: Keep track of the drag cursor during DnD operations. (Closed)
Patch Set: style Created 4 years, 3 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/event_dispatcher.cc
diff --git a/services/ui/ws/event_dispatcher.cc b/services/ui/ws/event_dispatcher.cc
index fb554ee13af9bfd85138d69f8f0cd8ed26992040..7a6ec0a226e5786a41202224ed6430186ac89497 100644
--- a/services/ui/ws/event_dispatcher.cc
+++ b/services/ui/ws/event_dispatcher.cc
@@ -104,6 +104,11 @@ void EventDispatcher::SetMousePointerScreenLocation(
}
bool EventDispatcher::GetCurrentMouseCursor(int32_t* cursor_out) {
+ if (drag_controller_) {
+ *cursor_out = drag_controller_->current_cursor();
+ return true;
+ }
+
if (!mouse_cursor_source_window_)
return false;
@@ -172,7 +177,7 @@ void EventDispatcher::SetDragDropSourceWindow(
uint32_t drag_operations) {
CancelImplicitCaptureExcept(nullptr);
drag_controller_ = base::MakeUnique<DragController>(
- drag_source, window, source_connection, drag_pointer,
+ this, drag_source, window, source_connection, drag_pointer,
std::move(mime_data), drag_operations);
}
@@ -612,5 +617,9 @@ void EventDispatcher::OnWindowDestroyed(ServerWindow* window) {
mouse_cursor_source_window_ = nullptr;
}
+void EventDispatcher::OnDragCursorUpdated() {
+ delegate_->UpdateNativeCursorFromDispatcher();
+}
+
} // namespace ws
} // namespace ui

Powered by Google App Engine
This is Rietveld 408576698