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 213 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
224 // report elliptical touches). | 224 // report elliptical touches). |
225 touch.radiusX = minor_radius; | 225 touch.radiusX = minor_radius; |
226 touch.radiusY = major_radius; | 226 touch.radiusY = major_radius; |
227 touch.rotationAngle = orientation_deg; | 227 touch.rotationAngle = orientation_deg; |
228 } else { | 228 } else { |
229 touch.radiusX = major_radius; | 229 touch.radiusX = major_radius; |
230 touch.radiusY = minor_radius; | 230 touch.radiusY = minor_radius; |
231 touch.rotationAngle = orientation_deg + 90; | 231 touch.rotationAngle = orientation_deg + 90; |
232 } | 232 } |
233 | 233 |
| 234 touch.tilt = event.GetTilt(pointer_index) * 180.f / M_PI; |
234 touch.force = event.GetPressure(pointer_index); | 235 touch.force = event.GetPressure(pointer_index); |
235 | 236 |
236 return touch; | 237 return touch; |
237 } | 238 } |
238 | 239 |
239 } // namespace | 240 } // namespace |
240 | 241 |
241 namespace content { | 242 namespace content { |
242 | 243 |
243 void UpdateWindowsKeyCodeAndKeyIdentifier(blink::WebKeyboardEvent* event, | 244 void UpdateWindowsKeyCodeAndKeyIdentifier(blink::WebKeyboardEvent* event, |
(...skipping 207 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
451 flags |= ui::EF_CAPS_LOCK_DOWN; | 452 flags |= ui::EF_CAPS_LOCK_DOWN; |
452 if (modifiers & blink::WebInputEvent::IsAutoRepeat) | 453 if (modifiers & blink::WebInputEvent::IsAutoRepeat) |
453 flags |= ui::EF_IS_REPEAT; | 454 flags |= ui::EF_IS_REPEAT; |
454 if (modifiers & blink::WebInputEvent::IsKeyPad) | 455 if (modifiers & blink::WebInputEvent::IsKeyPad) |
455 flags |= ui::EF_NUMPAD_KEY; | 456 flags |= ui::EF_NUMPAD_KEY; |
456 | 457 |
457 return flags; | 458 return flags; |
458 } | 459 } |
459 | 460 |
460 } // namespace content | 461 } // namespace content |
OLD | NEW |