| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 "ui/aura/window_event_dispatcher.h" | 5 #include "ui/aura/window_event_dispatcher.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/debug/trace_event.h" | 8 #include "base/debug/trace_event.h" |
| 9 #include "base/logging.h" | 9 #include "base/logging.h" |
| 10 #include "base/message_loop/message_loop.h" | 10 #include "base/message_loop/message_loop.h" |
| (...skipping 684 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 695 host_mouse_location, | 695 host_mouse_location, |
| 696 host_mouse_location, | 696 host_mouse_location, |
| 697 ui::EF_IS_SYNTHESIZED, | 697 ui::EF_IS_SYNTHESIZED, |
| 698 0); | 698 0); |
| 699 return OnEventFromSource(&event); | 699 return OnEventFromSource(&event); |
| 700 } | 700 } |
| 701 | 701 |
| 702 void WindowEventDispatcher::PreDispatchLocatedEvent(Window* target, | 702 void WindowEventDispatcher::PreDispatchLocatedEvent(Window* target, |
| 703 ui::LocatedEvent* event) { | 703 ui::LocatedEvent* event) { |
| 704 int flags = event->flags(); | 704 int flags = event->flags(); |
| 705 if (IsNonClientLocation(target, event->location())) | 705 if (IsNonClientLocation(target, gfx::ToFlooredPoint(event->location()))) |
| 706 flags |= ui::EF_IS_NON_CLIENT; | 706 flags |= ui::EF_IS_NON_CLIENT; |
| 707 event->set_flags(flags); | 707 event->set_flags(flags); |
| 708 | 708 |
| 709 if (!dispatching_held_event_ && | 709 if (!dispatching_held_event_ && |
| 710 (event->IsMouseEvent() || event->IsScrollEvent()) && | 710 (event->IsMouseEvent() || event->IsScrollEvent()) && |
| 711 !(event->flags() & ui::EF_IS_SYNTHESIZED)) { | 711 !(event->flags() & ui::EF_IS_SYNTHESIZED)) { |
| 712 if (event->type() != ui::ET_MOUSE_CAPTURE_CHANGED) | 712 if (event->type() != ui::ET_MOUSE_CAPTURE_CHANGED) |
| 713 SetLastMouseLocation(window(), event->root_location()); | 713 SetLastMouseLocation(window(), event->root_location()); |
| 714 synthesize_mouse_move_ = false; | 714 synthesize_mouse_move_ = false; |
| 715 } | 715 } |
| (...skipping 130 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 846 break; | 846 break; |
| 847 | 847 |
| 848 default: | 848 default: |
| 849 NOTREACHED(); | 849 NOTREACHED(); |
| 850 break; | 850 break; |
| 851 } | 851 } |
| 852 PreDispatchLocatedEvent(target, event); | 852 PreDispatchLocatedEvent(target, event); |
| 853 } | 853 } |
| 854 | 854 |
| 855 } // namespace aura | 855 } // namespace aura |
| OLD | NEW |