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