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