| 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 "components/test_runner/event_sender.h" | 5 #include "components/test_runner/event_sender.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 | 8 |
| 9 #include <memory> | 9 #include <memory> |
| 10 | 10 |
| (...skipping 2789 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2800 last_event_timestamp_ = raw_event.timeStampSeconds; | 2800 last_event_timestamp_ = raw_event.timeStampSeconds; |
| 2801 | 2801 |
| 2802 WebPagePopup* popup = widget()->pagePopup(); | 2802 WebPagePopup* popup = widget()->pagePopup(); |
| 2803 if (popup && !WebInputEvent::isKeyboardEventType(raw_event.type)) { | 2803 if (popup && !WebInputEvent::isKeyboardEventType(raw_event.type)) { |
| 2804 // ui::ScaleWebInputEvent returns nullptr when the scale is 1.0f as the | 2804 // ui::ScaleWebInputEvent returns nullptr when the scale is 1.0f as the |
| 2805 // event does not have to be converted. | 2805 // event does not have to be converted. |
| 2806 std::unique_ptr<WebInputEvent> scaled_event = ui::ScaleWebInputEvent( | 2806 std::unique_ptr<WebInputEvent> scaled_event = ui::ScaleWebInputEvent( |
| 2807 raw_event, delegate()->GetWindowToViewportScale()); | 2807 raw_event, delegate()->GetWindowToViewportScale()); |
| 2808 const WebInputEvent* popup_friendly_event = | 2808 const WebInputEvent* popup_friendly_event = |
| 2809 scaled_event.get() ? scaled_event.get() : &raw_event; | 2809 scaled_event.get() ? scaled_event.get() : &raw_event; |
| 2810 return popup->handleInputEvent(*popup_friendly_event); | 2810 return popup->handleInputEvent(*popup_friendly_event, |
| 2811 std::vector<const WebInputEvent*>()); |
| 2811 } | 2812 } |
| 2812 | 2813 |
| 2813 std::unique_ptr<WebInputEvent> widget_event = | 2814 std::unique_ptr<WebInputEvent> widget_event = |
| 2814 TransformScreenToWidgetCoordinates(raw_event); | 2815 TransformScreenToWidgetCoordinates(raw_event); |
| 2815 const WebInputEvent* event = | 2816 const WebInputEvent* event = |
| 2816 widget_event.get() ? static_cast<WebMouseEvent*>(widget_event.get()) | 2817 widget_event.get() ? static_cast<WebMouseEvent*>(widget_event.get()) |
| 2817 : &raw_event; | 2818 : &raw_event; |
| 2818 return widget()->handleInputEvent(*event); | 2819 return widget()->handleInputEvent(*event, |
| 2820 std::vector<const WebInputEvent*>()); |
| 2819 } | 2821 } |
| 2820 | 2822 |
| 2821 void EventSender::SendGesturesForMouseWheelEvent( | 2823 void EventSender::SendGesturesForMouseWheelEvent( |
| 2822 const WebMouseWheelEvent wheel_event) { | 2824 const WebMouseWheelEvent wheel_event) { |
| 2823 WebGestureEvent begin_event; | 2825 WebGestureEvent begin_event; |
| 2824 InitGestureEventFromMouseWheel(WebInputEvent::GestureScrollBegin, | 2826 InitGestureEventFromMouseWheel(WebInputEvent::GestureScrollBegin, |
| 2825 GetCurrentEventTimeSec(), wheel_event, | 2827 GetCurrentEventTimeSec(), wheel_event, |
| 2826 &begin_event); | 2828 &begin_event); |
| 2827 begin_event.data.scrollBegin.deltaXHint = wheel_event.deltaX; | 2829 begin_event.data.scrollBegin.deltaXHint = wheel_event.deltaX; |
| 2828 begin_event.data.scrollBegin.deltaYHint = wheel_event.deltaY; | 2830 begin_event.data.scrollBegin.deltaYHint = wheel_event.deltaY; |
| (...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2896 return web_widget_test_proxy_base_->web_widget(); | 2898 return web_widget_test_proxy_base_->web_widget(); |
| 2897 } | 2899 } |
| 2898 | 2900 |
| 2899 std::unique_ptr<WebInputEvent> EventSender::TransformScreenToWidgetCoordinates( | 2901 std::unique_ptr<WebInputEvent> EventSender::TransformScreenToWidgetCoordinates( |
| 2900 const WebInputEvent& event) { | 2902 const WebInputEvent& event) { |
| 2901 return delegate()->TransformScreenToWidgetCoordinates( | 2903 return delegate()->TransformScreenToWidgetCoordinates( |
| 2902 web_widget_test_proxy_base_, event); | 2904 web_widget_test_proxy_base_, event); |
| 2903 } | 2905 } |
| 2904 | 2906 |
| 2905 } // namespace test_runner | 2907 } // namespace test_runner |
| OLD | NEW |