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

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 352 matching lines...) Expand 10 before | Expand all | Expand 10 after
363 if (drag_controller_->DispatchPointerEvent(event, target.window)) 363 if (drag_controller_->DispatchPointerEvent(event, target.window))
364 return; 364 return;
365 } 365 }
366 366
367 if (capture_window_) { 367 if (capture_window_) {
368 mouse_cursor_source_window_ = capture_window_; 368 mouse_cursor_source_window_ = capture_window_;
369 DispatchToClient(capture_window_, capture_window_client_id_, event); 369 DispatchToClient(capture_window_, capture_window_client_id_, event);
370 return; 370 return;
371 } 371 }
372 372
373 const int32_t pointer_id = event.pointer_id(); 373 const int32_t pointer_id = event.pointer_details().id;
374 if (!IsTrackingPointer(pointer_id) || 374 if (!IsTrackingPointer(pointer_id) ||
375 !pointer_targets_[pointer_id].is_pointer_down) { 375 !pointer_targets_[pointer_id].is_pointer_down) {
376 const bool any_pointers_down = AreAnyPointersDown(); 376 const bool any_pointers_down = AreAnyPointersDown();
377 UpdateTargetForPointer(pointer_id, event); 377 UpdateTargetForPointer(pointer_id, event);
378 if (is_mouse_event) 378 if (is_mouse_event)
379 mouse_cursor_source_window_ = pointer_targets_[pointer_id].window; 379 mouse_cursor_source_window_ = pointer_targets_[pointer_id].window;
380 380
381 PointerTarget& pointer_target = pointer_targets_[pointer_id]; 381 PointerTarget& pointer_target = pointer_targets_[pointer_id];
382 if (pointer_target.is_pointer_down) { 382 if (pointer_target.is_pointer_down) {
383 if (is_mouse_event) 383 if (is_mouse_event)
(...skipping 258 matching lines...) Expand 10 before | Expand all | Expand 10 after
642 if (mouse_cursor_source_window_ == window) 642 if (mouse_cursor_source_window_ == window)
643 mouse_cursor_source_window_ = nullptr; 643 mouse_cursor_source_window_ = nullptr;
644 } 644 }
645 645
646 void EventDispatcher::OnDragCursorUpdated() { 646 void EventDispatcher::OnDragCursorUpdated() {
647 delegate_->UpdateNativeCursorFromDispatcher(); 647 delegate_->UpdateNativeCursorFromDispatcher();
648 } 648 }
649 649
650 } // namespace ws 650 } // namespace ws
651 } // namespace ui 651 } // namespace ui
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698