| OLD | NEW |
| (Empty) |
| 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 | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 #include "content/browser/renderer_host/web_input_event_aura.h" | |
| 6 | |
| 7 #include "base/event_types.h" | |
| 8 #include "base/logging.h" | |
| 9 #include "base/time/time.h" | |
| 10 #include "content/browser/renderer_host/input/web_input_event_builders_win.h" | |
| 11 #include "ui/events/base_event_utils.h" | |
| 12 | |
| 13 namespace content { | |
| 14 | |
| 15 // On Windows, we can just use the builtin WebKit factory methods to fully | |
| 16 // construct our pre-translated events. | |
| 17 | |
| 18 blink::WebMouseEvent MakeUntranslatedWebMouseEventFromNativeEvent( | |
| 19 const base::NativeEvent& native_event, | |
| 20 const base::TimeTicks& time_stamp, | |
| 21 blink::WebPointerProperties::PointerType pointer_type) { | |
| 22 return WebMouseEventBuilder::Build(native_event.hwnd, native_event.message, | |
| 23 native_event.wParam, native_event.lParam, | |
| 24 ui::EventTimeStampToSeconds(time_stamp), | |
| 25 pointer_type); | |
| 26 } | |
| 27 | |
| 28 blink::WebMouseWheelEvent MakeUntranslatedWebMouseWheelEventFromNativeEvent( | |
| 29 const base::NativeEvent& native_event, | |
| 30 const base::TimeTicks& time_stamp, | |
| 31 blink::WebPointerProperties::PointerType pointer_type) { | |
| 32 return WebMouseWheelEventBuilder::Build( | |
| 33 native_event.hwnd, native_event.message, native_event.wParam, | |
| 34 native_event.lParam, ui::EventTimeStampToSeconds(time_stamp), | |
| 35 pointer_type); | |
| 36 } | |
| 37 | |
| 38 blink::WebKeyboardEvent MakeWebKeyboardEventFromNativeEvent( | |
| 39 const base::NativeEvent& native_event, | |
| 40 const base::TimeTicks& time_stamp) { | |
| 41 return WebKeyboardEventBuilder::Build( | |
| 42 native_event.hwnd, native_event.message, native_event.wParam, | |
| 43 native_event.lParam, ui::EventTimeStampToSeconds(time_stamp)); | |
| 44 } | |
| 45 | |
| 46 blink::WebGestureEvent MakeWebGestureEventFromNativeEvent( | |
| 47 const base::NativeEvent& native_event, | |
| 48 const base::TimeTicks& time_stamp) { | |
| 49 // TODO: Create gestures from native event. | |
| 50 NOTIMPLEMENTED(); | |
| 51 return blink::WebGestureEvent(); | |
| 52 } | |
| 53 | |
| 54 } // namespace content | |
| OLD | NEW |