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

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

Issue 2323553002: mash: Use the new mus drag and drop API to get drag working in mash. (Closed)
Patch Set: another make unique 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/window_manager_state.cc
diff --git a/services/ui/ws/window_manager_state.cc b/services/ui/ws/window_manager_state.cc
index 93b3d3cde76d15cbce86a6f860f7faea12770a9f..04756f191bf6da135bd54e08ec2f03c372c99ab4 100644
--- a/services/ui/ws/window_manager_state.cc
+++ b/services/ui/ws/window_manager_state.cc
@@ -162,9 +162,17 @@ void WindowManagerState::SetDragDropSourceWindow(
DragSource* drag_source,
ServerWindow* window,
DragTargetConnection* source_connection,
- int32_t drag_pointer,
mojo::Map<mojo::String, mojo::Array<uint8_t>> drag_data,
uint32_t drag_operation) {
+ int32_t drag_pointer = PointerEvent::kMousePointerId;
+ if (event_awaiting_input_ack_ &&
+ event_awaiting_input_ack_->AsPointerEvent()) {
+ drag_pointer = event_awaiting_input_ack_->AsPointerEvent()->pointer_id();
Elliot Glaysher 2016/09/26 20:57:29 In the server, do I have to handle things other th
sky 2016/09/26 21:44:41 You should at least check that event_awaiting_inpu
Elliot Glaysher 2016/09/26 22:20:02 Misunderstood interface; thought it returned null
+ } else {
+ NOTIMPLEMENTED() << "Set drag drop set up during something other than a "
sky 2016/09/26 21:44:41 Can the NOTIMPLEMENTED case fail? I'm ok if you wa
Elliot Glaysher 2016/09/26 22:20:02 Done.
+ << "pointer event; defaulting to mouse pointer.";
+ }
+
event_dispatcher_.SetDragDropSourceWindow(
drag_source, window, source_connection, drag_pointer,
std::move(drag_data), drag_operation);
@@ -415,10 +423,10 @@ void WindowManagerState::DispatchInputEventToWindowImpl(
DCHECK(tree);
ScheduleInputEventTimeout(tree);
- if (accelerator) {
- event_awaiting_input_ack_ = ui::Event::Clone(event);
sky 2016/09/26 21:44:41 Why do you need to do this change?
Elliot Glaysher 2016/09/26 22:20:02 Because we need to keep track of the event awaitin
sky 2016/09/26 23:06:05 Got it.
+ event_awaiting_input_ack_ = ui::Event::Clone(event);
+
+ if (accelerator)
post_target_accelerator_ = accelerator;
- }
// Ignore |tree| because it will receive the event via normal dispatch.
window_server()->SendToPointerWatchers(event, user_id(), target, tree);

Powered by Google App Engine
This is Rietveld 408576698