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 // MSVC++ requires this to be set before any other includes to get M_PI. | 5 // MSVC++ requires this to be set before any other includes to get M_PI. |
6 #define _USE_MATH_DEFINES | 6 #define _USE_MATH_DEFINES |
7 | 7 |
8 #include "content/browser/renderer_host/input/web_input_event_util.h" | 8 #include "content/browser/renderer_host/input/web_input_event_util.h" |
9 | 9 |
10 #include <cmath> | 10 #include <cmath> |
(...skipping 257 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
268 | 268 |
269 blink::WebTouchEvent result; | 269 blink::WebTouchEvent result; |
270 | 270 |
271 WebTouchEventTraits::ResetType( | 271 WebTouchEventTraits::ResetType( |
272 ToWebInputEventType(event.GetAction()), | 272 ToWebInputEventType(event.GetAction()), |
273 (event.GetEventTime() - base::TimeTicks()).InSecondsF(), | 273 (event.GetEventTime() - base::TimeTicks()).InSecondsF(), |
274 &result); | 274 &result); |
275 result.causesScrollingIfUncanceled = may_cause_scrolling; | 275 result.causesScrollingIfUncanceled = may_cause_scrolling; |
276 | 276 |
277 result.modifiers = EventFlagsToWebEventModifiers(event.GetFlags()); | 277 result.modifiers = EventFlagsToWebEventModifiers(event.GetFlags()); |
| 278 result.uniqueTouchEventId = event.GetUniqueId(); |
278 result.touchesLength = | 279 result.touchesLength = |
279 std::min(event.GetPointerCount(), | 280 std::min(event.GetPointerCount(), |
280 static_cast<size_t>(WebTouchEvent::touchesLengthCap)); | 281 static_cast<size_t>(WebTouchEvent::touchesLengthCap)); |
281 DCHECK_GT(result.touchesLength, 0U); | 282 DCHECK_GT(result.touchesLength, 0U); |
282 | 283 |
283 for (size_t i = 0; i < result.touchesLength; ++i) | 284 for (size_t i = 0; i < result.touchesLength; ++i) |
284 result.touches[i] = CreateWebTouchPoint(event, i); | 285 result.touches[i] = CreateWebTouchPoint(event, i); |
285 | 286 |
286 return result; | 287 return result; |
287 } | 288 } |
(...skipping 169 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
457 flags |= ui::EF_CAPS_LOCK_DOWN; | 458 flags |= ui::EF_CAPS_LOCK_DOWN; |
458 if (modifiers & blink::WebInputEvent::IsAutoRepeat) | 459 if (modifiers & blink::WebInputEvent::IsAutoRepeat) |
459 flags |= ui::EF_IS_REPEAT; | 460 flags |= ui::EF_IS_REPEAT; |
460 if (modifiers & blink::WebInputEvent::IsKeyPad) | 461 if (modifiers & blink::WebInputEvent::IsKeyPad) |
461 flags |= ui::EF_NUMPAD_KEY; | 462 flags |= ui::EF_NUMPAD_KEY; |
462 | 463 |
463 return flags; | 464 return flags; |
464 } | 465 } |
465 | 466 |
466 } // namespace content | 467 } // namespace content |
OLD | NEW |