OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/root_window.h" | 5 #include "ui/aura/root_window.h" |
6 | 6 |
7 #include <vector> | 7 #include <vector> |
8 | 8 |
9 #include "base/auto_reset.h" | 9 #include "base/auto_reset.h" |
10 #include "base/bind.h" | 10 #include "base/bind.h" |
(...skipping 760 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
771 | 771 |
772 bool RootWindow::OnHostScrollEvent(ui::ScrollEvent* event) { | 772 bool RootWindow::OnHostScrollEvent(ui::ScrollEvent* event) { |
773 DispatchHeldMouseMove(); | 773 DispatchHeldMouseMove(); |
774 | 774 |
775 TransformEventForDeviceScaleFactor(event); | 775 TransformEventForDeviceScaleFactor(event); |
776 SetLastMouseLocation(this, event->location()); | 776 SetLastMouseLocation(this, event->location()); |
777 synthesize_mouse_move_ = false; | 777 synthesize_mouse_move_ = false; |
778 | 778 |
779 Window* target = mouse_pressed_handler_ ? | 779 Window* target = mouse_pressed_handler_ ? |
780 mouse_pressed_handler_ : client::GetCaptureWindow(this); | 780 mouse_pressed_handler_ : client::GetCaptureWindow(this); |
| 781 |
781 if (!target) | 782 if (!target) |
782 target = GetEventHandlerForPoint(event->location()); | 783 target = GetEventHandlerForPoint(event->location()); |
783 | 784 |
784 if (target && target->delegate()) { | 785 if (!target) |
785 int flags = event->flags(); | 786 target = this; |
786 gfx::Point location_in_window = event->location(); | 787 |
787 Window::ConvertPointToTarget(this, target, &location_in_window); | 788 int flags = event->flags(); |
788 if (IsNonClientLocation(target, location_in_window)) | 789 gfx::Point location_in_window = event->location(); |
789 flags |= ui::EF_IS_NON_CLIENT; | 790 Window::ConvertPointToTarget(this, target, &location_in_window); |
790 event->set_flags(flags); | 791 if (IsNonClientLocation(target, location_in_window)) |
791 event->ConvertLocationToTarget(static_cast<Window*>(this), target); | 792 flags |= ui::EF_IS_NON_CLIENT; |
792 ProcessEvent(target, event); | 793 event->set_flags(flags); |
793 return event->handled(); | 794 event->ConvertLocationToTarget(static_cast<Window*>(this), target); |
794 } | 795 ProcessEvent(target, event); |
795 return false; | 796 return event->handled(); |
796 } | 797 } |
797 | 798 |
798 bool RootWindow::OnHostTouchEvent(ui::TouchEvent* event) { | 799 bool RootWindow::OnHostTouchEvent(ui::TouchEvent* event) { |
799 DispatchHeldMouseMove(); | 800 DispatchHeldMouseMove(); |
800 switch (event->type()) { | 801 switch (event->type()) { |
801 case ui::ET_TOUCH_PRESSED: | 802 case ui::ET_TOUCH_PRESSED: |
802 touch_ids_down_ |= (1 << event->touch_id()); | 803 touch_ids_down_ |= (1 << event->touch_id()); |
803 Env::GetInstance()->set_touch_down(touch_ids_down_ != 0); | 804 Env::GetInstance()->set_touch_down(touch_ids_down_ != 0); |
804 break; | 805 break; |
805 | 806 |
(...skipping 200 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1006 ui::MouseEvent event(ui::ET_MOUSE_MOVED, | 1007 ui::MouseEvent event(ui::ET_MOUSE_MOVED, |
1007 orig_mouse_location, | 1008 orig_mouse_location, |
1008 orig_mouse_location, | 1009 orig_mouse_location, |
1009 ui::EF_IS_SYNTHESIZED); | 1010 ui::EF_IS_SYNTHESIZED); |
1010 event.set_system_location(Env::GetInstance()->last_mouse_location()); | 1011 event.set_system_location(Env::GetInstance()->last_mouse_location()); |
1011 OnHostMouseEvent(&event); | 1012 OnHostMouseEvent(&event); |
1012 #endif | 1013 #endif |
1013 } | 1014 } |
1014 | 1015 |
1015 } // namespace aura | 1016 } // namespace aura |
OLD | NEW |