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/base_event_utils.h" | 9 #include "ui/events/base_event_utils.h" |
10 #include "ui/events/keycodes/keyboard_codes.h" | 10 #include "ui/events/keycodes/keyboard_codes.h" |
(...skipping 150 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
161 if (touches[i].state == WebTouchPoint::StateReleased) | 161 if (touches[i].state == WebTouchPoint::StateReleased) |
162 continue; | 162 continue; |
163 | 163 |
164 touches[point] = touches[i]; | 164 touches[point] = touches[i]; |
165 touches[point].state = WebTouchPoint::StateStationary; | 165 touches[point].state = WebTouchPoint::StateStationary; |
166 ++point; | 166 ++point; |
167 } | 167 } |
168 touchesLength = point; | 168 touchesLength = point; |
169 type = WebInputEvent::Undefined; | 169 type = WebInputEvent::Undefined; |
170 causesScrollingIfUncanceled = false; | 170 causesScrollingIfUncanceled = false; |
| 171 uniqueTouchEventId = ui::GetNextTouchEventId(); |
171 } | 172 } |
172 | 173 |
173 int SyntheticWebTouchEvent::PressPoint(float x, float y) { | 174 int SyntheticWebTouchEvent::PressPoint(float x, float y) { |
174 if (touchesLength == touchesLengthCap) | 175 if (touchesLength == touchesLengthCap) |
175 return -1; | 176 return -1; |
176 WebTouchPoint& point = touches[touchesLength]; | 177 WebTouchPoint& point = touches[touchesLength]; |
177 point.id = touchesLength; | 178 point.id = touchesLength; |
178 point.position.x = point.screenPosition.x = x; | 179 point.position.x = point.screenPosition.x = x; |
179 point.position.y = point.screenPosition.y = y; | 180 point.position.y = point.screenPosition.y = y; |
180 point.state = WebTouchPoint::StatePressed; | 181 point.state = WebTouchPoint::StatePressed; |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
215 touches[index].state = WebTouchPoint::StateCancelled; | 216 touches[index].state = WebTouchPoint::StateCancelled; |
216 WebTouchEventTraits::ResetType( | 217 WebTouchEventTraits::ResetType( |
217 WebInputEvent::TouchCancel, timeStampSeconds, this); | 218 WebInputEvent::TouchCancel, timeStampSeconds, this); |
218 } | 219 } |
219 | 220 |
220 void SyntheticWebTouchEvent::SetTimestamp(base::TimeDelta timestamp) { | 221 void SyntheticWebTouchEvent::SetTimestamp(base::TimeDelta timestamp) { |
221 timeStampSeconds = timestamp.InSecondsF(); | 222 timeStampSeconds = timestamp.InSecondsF(); |
222 } | 223 } |
223 | 224 |
224 } // namespace content | 225 } // namespace content |
OLD | NEW |