OLD | NEW |
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 449 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
460 pointer_targets_[pointer_id].is_pointer_down = true; | 460 pointer_targets_[pointer_id].is_pointer_down = true; |
461 return; | 461 return; |
462 } | 462 } |
463 | 463 |
464 // The targets are changing. Send an exit if appropriate. | 464 // The targets are changing. Send an exit if appropriate. |
465 if (event.IsMousePointerEvent()) { | 465 if (event.IsMousePointerEvent()) { |
466 ui::PointerEvent exit_event( | 466 ui::PointerEvent exit_event( |
467 ui::ET_POINTER_EXITED, event.location(), event.root_location(), | 467 ui::ET_POINTER_EXITED, event.location(), event.root_location(), |
468 event.flags(), 0 /* changed_button_flags */, | 468 event.flags(), 0 /* changed_button_flags */, |
469 ui::PointerDetails(ui::EventPointerType::POINTER_TYPE_MOUSE, | 469 ui::PointerDetails(ui::EventPointerType::POINTER_TYPE_MOUSE, |
470 ui::MouseEvent::kMousePointerId), | 470 ui::MouseEvent::kDefaultMousePointerId), |
471 event.time_stamp()); | 471 event.time_stamp()); |
472 DispatchToPointerTarget(pointer_targets_[pointer_id], exit_event); | 472 DispatchToPointerTarget(pointer_targets_[pointer_id], exit_event); |
473 } | 473 } |
474 | 474 |
475 // Technically we're updating in place, but calling start then stop makes for | 475 // Technically we're updating in place, but calling start then stop makes for |
476 // simpler code. | 476 // simpler code. |
477 StopTrackingPointer(pointer_id); | 477 StopTrackingPointer(pointer_id); |
478 StartTrackingPointer(pointer_id, pointer_target); | 478 StartTrackingPointer(pointer_id, pointer_target); |
479 } | 479 } |
480 | 480 |
(...skipping 172 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
653 if (mouse_cursor_source_window_ == window) | 653 if (mouse_cursor_source_window_ == window) |
654 SetMouseCursorSourceWindow(nullptr); | 654 SetMouseCursorSourceWindow(nullptr); |
655 } | 655 } |
656 | 656 |
657 void EventDispatcher::OnDragCursorUpdated() { | 657 void EventDispatcher::OnDragCursorUpdated() { |
658 delegate_->UpdateNativeCursorFromDispatcher(); | 658 delegate_->UpdateNativeCursorFromDispatcher(); |
659 } | 659 } |
660 | 660 |
661 } // namespace ws | 661 } // namespace ws |
662 } // namespace ui | 662 } // namespace ui |
OLD | NEW |