OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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/common/input/synthetic_web_input_event_builders.h" | 5 #include "content/common/input/synthetic_web_input_event_builders.h" |
6 | 6 |
7 #include "base/logging.h" | 7 #include "base/logging.h" |
8 #include "content/common/input/web_touch_event_traits.h" | 8 #include "content/common/input/web_touch_event_traits.h" |
9 #include "ui/events/keycodes/keyboard_codes.h" | 9 #include "ui/events/keycodes/keyboard_codes.h" |
10 | 10 |
(...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
116 result.data.scrollUpdate.deltaX = dx; | 116 result.data.scrollUpdate.deltaX = dx; |
117 result.data.scrollUpdate.deltaY = dy; | 117 result.data.scrollUpdate.deltaY = dy; |
118 result.modifiers = modifiers; | 118 result.modifiers = modifiers; |
119 return result; | 119 return result; |
120 } | 120 } |
121 | 121 |
122 WebGestureEvent SyntheticWebGestureEventBuilder::BuildPinchUpdate( | 122 WebGestureEvent SyntheticWebGestureEventBuilder::BuildPinchUpdate( |
123 float scale, | 123 float scale, |
124 float anchor_x, | 124 float anchor_x, |
125 float anchor_y, | 125 float anchor_y, |
126 int modifiers) { | 126 int modifiers, |
127 WebGestureEvent result = Build(WebInputEvent::GesturePinchUpdate, | 127 WebGestureEvent::SourceDevice source_device) { |
128 WebGestureEvent::Touchscreen); | 128 WebGestureEvent result = |
| 129 Build(WebInputEvent::GesturePinchUpdate, source_device); |
129 result.data.pinchUpdate.scale = scale; | 130 result.data.pinchUpdate.scale = scale; |
130 result.x = anchor_x; | 131 result.x = anchor_x; |
131 result.y = anchor_y; | 132 result.y = anchor_y; |
| 133 result.globalX = anchor_x; |
| 134 result.globalY = anchor_y; |
132 result.modifiers = modifiers; | 135 result.modifiers = modifiers; |
133 return result; | 136 return result; |
134 } | 137 } |
135 | 138 |
136 WebGestureEvent SyntheticWebGestureEventBuilder::BuildFling( | 139 WebGestureEvent SyntheticWebGestureEventBuilder::BuildFling( |
137 float velocity_x, | 140 float velocity_x, |
138 float velocity_y, | 141 float velocity_y, |
139 WebGestureEvent::SourceDevice source_device) { | 142 WebGestureEvent::SourceDevice source_device) { |
140 WebGestureEvent result = Build(WebInputEvent::GestureFlingStart, | 143 WebGestureEvent result = Build(WebInputEvent::GestureFlingStart, |
141 source_device); | 144 source_device); |
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
197 touches[index].state = WebTouchPoint::StateCancelled; | 200 touches[index].state = WebTouchPoint::StateCancelled; |
198 WebTouchEventTraits::ResetType( | 201 WebTouchEventTraits::ResetType( |
199 WebInputEvent::TouchCancel, timeStampSeconds, this); | 202 WebInputEvent::TouchCancel, timeStampSeconds, this); |
200 } | 203 } |
201 | 204 |
202 void SyntheticWebTouchEvent::SetTimestamp(base::TimeDelta timestamp) { | 205 void SyntheticWebTouchEvent::SetTimestamp(base::TimeDelta timestamp) { |
203 timeStampSeconds = timestamp.InSecondsF(); | 206 timeStampSeconds = timestamp.InSecondsF(); |
204 } | 207 } |
205 | 208 |
206 } // namespace content | 209 } // namespace content |
OLD | NEW |