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 256 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
267 WebTouchEventTraits::ResetType( | 267 WebTouchEventTraits::ResetType( |
268 ToWebInputEventType(event.GetAction()), | 268 ToWebInputEventType(event.GetAction()), |
269 (event.GetEventTime() - base::TimeTicks()).InSecondsF(), | 269 (event.GetEventTime() - base::TimeTicks()).InSecondsF(), |
270 &result); | 270 &result); |
271 result.causesScrollingIfUncanceled = may_cause_scrolling; | 271 result.causesScrollingIfUncanceled = may_cause_scrolling; |
272 | 272 |
273 result.modifiers = EventFlagsToWebEventModifiers(event.GetFlags()); | 273 result.modifiers = EventFlagsToWebEventModifiers(event.GetFlags()); |
274 result.touchesLength = | 274 result.touchesLength = |
275 std::min(event.GetPointerCount(), | 275 std::min(event.GetPointerCount(), |
276 static_cast<size_t>(WebTouchEvent::touchesLengthCap)); | 276 static_cast<size_t>(WebTouchEvent::touchesLengthCap)); |
277 DCHECK_GT(result.touchesLength, 0U); | |
jdduke (slow)
2015/01/06 16:49:54
I'm a little nervous about removing this DCHECK.
tdresser
2015/01/07 17:01:15
I've re-added it, at the expense of making the Ren
| |
278 | 277 |
279 for (size_t i = 0; i < result.touchesLength; ++i) | 278 for (size_t i = 0; i < result.touchesLength; ++i) |
280 result.touches[i] = CreateWebTouchPoint(event, i); | 279 result.touches[i] = CreateWebTouchPoint(event, i); |
281 | 280 |
282 return result; | 281 return result; |
283 } | 282 } |
284 | 283 |
285 WebGestureEvent CreateWebGestureEvent(const ui::GestureEventDetails& details, | 284 WebGestureEvent CreateWebGestureEvent(const ui::GestureEventDetails& details, |
286 base::TimeDelta timestamp, | 285 base::TimeDelta timestamp, |
287 const gfx::PointF& location, | 286 const gfx::PointF& location, |
(...skipping 165 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
453 flags |= ui::EF_CAPS_LOCK_DOWN; | 452 flags |= ui::EF_CAPS_LOCK_DOWN; |
454 if (modifiers & blink::WebInputEvent::IsAutoRepeat) | 453 if (modifiers & blink::WebInputEvent::IsAutoRepeat) |
455 flags |= ui::EF_IS_REPEAT; | 454 flags |= ui::EF_IS_REPEAT; |
456 if (modifiers & blink::WebInputEvent::IsKeyPad) | 455 if (modifiers & blink::WebInputEvent::IsKeyPad) |
457 flags |= ui::EF_NUMPAD_KEY; | 456 flags |= ui::EF_NUMPAD_KEY; |
458 | 457 |
459 return flags; | 458 return flags; |
460 } | 459 } |
461 | 460 |
462 } // namespace content | 461 } // namespace content |
OLD | NEW |