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

Side by Side Diff: services/ui/ws/event_dispatcher.cc

Issue 2655303004: Add id properties to PointerEvent (Closed)
Patch Set: pointer id Created 3 years, 10 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 unified diff | Download patch
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "services/ui/ws/event_dispatcher.h" 5 #include "services/ui/ws/event_dispatcher.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 8
9 #include "base/memory/ptr_util.h" 9 #include "base/memory/ptr_util.h"
10 #include "base/time/time.h" 10 #include "base/time/time.h"
(...skipping 329 matching lines...) Expand 10 before | Expand all | Expand 10 after
340 if (drag_controller_->DispatchPointerEvent(event, target.window)) 340 if (drag_controller_->DispatchPointerEvent(event, target.window))
341 return; 341 return;
342 } 342 }
343 343
344 if (capture_window_) { 344 if (capture_window_) {
345 mouse_cursor_source_window_ = capture_window_; 345 mouse_cursor_source_window_ = capture_window_;
346 DispatchToClient(capture_window_, capture_window_client_id_, event); 346 DispatchToClient(capture_window_, capture_window_client_id_, event);
347 return; 347 return;
348 } 348 }
349 349
350 const int32_t pointer_id = event.pointer_id(); 350 const int32_t pointer_id = event.pointer_details().id;
351 if (!IsTrackingPointer(pointer_id) || 351 if (!IsTrackingPointer(pointer_id) ||
352 !pointer_targets_[pointer_id].is_pointer_down) { 352 !pointer_targets_[pointer_id].is_pointer_down) {
353 const bool any_pointers_down = AreAnyPointersDown(); 353 const bool any_pointers_down = AreAnyPointersDown();
354 UpdateTargetForPointer(pointer_id, event); 354 UpdateTargetForPointer(pointer_id, event);
355 if (is_mouse_event) 355 if (is_mouse_event)
356 mouse_cursor_source_window_ = pointer_targets_[pointer_id].window; 356 mouse_cursor_source_window_ = pointer_targets_[pointer_id].window;
357 357
358 PointerTarget& pointer_target = pointer_targets_[pointer_id]; 358 PointerTarget& pointer_target = pointer_targets_[pointer_id];
359 if (pointer_target.is_pointer_down) { 359 if (pointer_target.is_pointer_down) {
360 if (is_mouse_event) 360 if (is_mouse_event)
(...skipping 258 matching lines...) Expand 10 before | Expand all | Expand 10 after
619 if (mouse_cursor_source_window_ == window) 619 if (mouse_cursor_source_window_ == window)
620 mouse_cursor_source_window_ = nullptr; 620 mouse_cursor_source_window_ = nullptr;
621 } 621 }
622 622
623 void EventDispatcher::OnDragCursorUpdated() { 623 void EventDispatcher::OnDragCursorUpdated() {
624 delegate_->UpdateNativeCursorFromDispatcher(); 624 delegate_->UpdateNativeCursorFromDispatcher();
625 } 625 }
626 626
627 } // namespace ws 627 } // namespace ws
628 } // namespace ui 628 } // namespace ui
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698