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/ui_events_helper.h" | 5 #include "content/browser/renderer_host/ui_events_helper.h" |
6 | 6 |
7 #include "content/browser/renderer_host/input/web_input_event_util.h" | 7 #include "content/browser/renderer_host/input/web_input_event_util.h" |
8 #include "content/common/input/web_touch_event_traits.h" | 8 #include "content/common/input/web_touch_event_traits.h" |
9 #include "third_party/WebKit/public/web/WebInputEvent.h" | 9 #include "third_party/WebKit/public/web/WebInputEvent.h" |
10 #include "ui/events/blink/blink_event_util.h" | 10 #include "ui/events/blink/blink_event_util.h" |
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
70 continue; | 70 continue; |
71 // ui events start in the co-ordinate space of the EventDispatcher. | 71 // ui events start in the co-ordinate space of the EventDispatcher. |
72 gfx::PointF location; | 72 gfx::PointF location; |
73 if (coordinate_system == LOCAL_COORDINATES) | 73 if (coordinate_system == LOCAL_COORDINATES) |
74 location = point.position; | 74 location = point.position; |
75 else | 75 else |
76 location = point.screenPosition; | 76 location = point.screenPosition; |
77 ui::TouchEvent* uievent = new ui::TouchEvent(type, | 77 ui::TouchEvent* uievent = new ui::TouchEvent(type, |
78 location, | 78 location, |
79 flags, | 79 flags, |
80 point.id, | 80 point.pointerId, |
81 timestamp, | 81 timestamp, |
82 point.radiusX, | 82 point.width, |
83 point.radiusY, | 83 point.height, |
84 point.rotationAngle, | 84 point.rotationAngle, |
85 point.force); | 85 point.pressure); |
86 uievent->set_latency(touch_with_latency.latency); | 86 uievent->set_latency(touch_with_latency.latency); |
87 list->push_back(uievent); | 87 list->push_back(uievent); |
88 } | 88 } |
89 return true; | 89 return true; |
90 } | 90 } |
91 | 91 |
92 blink::WebGestureEvent MakeWebGestureEventFromUIEvent( | 92 blink::WebGestureEvent MakeWebGestureEventFromUIEvent( |
93 const ui::GestureEvent& event) { | 93 const ui::GestureEvent& event) { |
94 return ui::CreateWebGestureEvent(event.details(), event.time_stamp(), | 94 return ui::CreateWebGestureEvent(event.details(), event.time_stamp(), |
95 event.location_f(), event.root_location_f(), | 95 event.location_f(), event.root_location_f(), |
96 event.flags()); | 96 event.flags()); |
97 } | 97 } |
98 | 98 |
99 } // namespace content | 99 } // namespace content |
OLD | NEW |