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

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

Issue 2266603002: mus: Implement interwindow drag and drop (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Uploaded for a few comments. Created 4 years, 4 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 06c632338126f2ff3003a0152083913836d6ee5e..2494d427a110e9e9302aa247528bb3aca68a88c5 100644
--- a/services/ui/ws/event_dispatcher.cc
+++ b/services/ui/ws/event_dispatcher.cc
@@ -8,6 +8,8 @@
#include "base/time/time.h"
#include "services/ui/ws/accelerator.h"
+#include "services/ui/ws/current_drag_operation.h"
+#include "services/ui/ws/current_drag_operation_delegate.h"
#include "services/ui/ws/display.h"
#include "services/ui/ws/event_dispatcher_delegate.h"
#include "services/ui/ws/server_window.h"
@@ -188,6 +190,17 @@ bool EventDispatcher::SetCaptureWindow(ServerWindow* window,
return true;
}
+void EventDispatcher::SetDragDropSourceWindow(
+ uint32_t change_id,
+ WindowTree* window_tree,
+ ServerWindow* capture_window,
+ mojo::Map<mojo::String, mojo::Array<uint8_t>> mime_data,
+ uint32_t drag_operations) {
+ current_drag_drop_operation_.reset(
+ new CurrentDragOperation(this, change_id, window_tree, capture_window,
+ std::move(mime_data), drag_operations));
+}
+
void EventDispatcher::AddSystemModalWindow(ServerWindow* window) {
modal_window_controller_.AddSystemModalWindow(window);
}
@@ -341,6 +354,15 @@ void EventDispatcher::ProcessLocatedEvent(const ui::LocatedEvent& event) {
mouse_button_down_ = false;
}
+ if (current_drag_drop_operation_) {
+ const PointerTarget target = PointerTargetForEvent(event);
+ const ClientSpecificId client_id = delegate_->GetEventTargetClientId(
+ target.window, target.in_nonclient_area);
+ current_drag_drop_operation_->DispatchLocatedEvent(event, target.window,
+ client_id);
+ return;
+ }
+
if (capture_window_) {
mouse_cursor_source_window_ = capture_window_;
DispatchToClient(capture_window_, capture_window_client_id_, event);
@@ -575,5 +597,9 @@ void EventDispatcher::OnWindowDestroyed(ServerWindow* window) {
mouse_cursor_source_window_ = nullptr;
}
+void EventDispatcher::OnDragOver(bool success) {
+ current_drag_drop_operation_.reset();
+}
+
} // namespace ws
} // namespace ui

Powered by Google App Engine
This is Rietveld 408576698