| OLD | NEW |
| 1 // Copyright (c) 2015 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2015 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 #ifndef WebPointerProperties_h | 5 #ifndef WebPointerProperties_h |
| 6 #define WebPointerProperties_h | 6 #define WebPointerProperties_h |
| 7 | 7 |
| 8 #include <limits> |
| 9 |
| 8 namespace blink { | 10 namespace blink { |
| 9 | 11 |
| 10 // This class encapsulates the properties that are common between mouse and | 12 // This class encapsulates the properties that are common between mouse and |
| 11 // pointer events and touch points as we transition towards the unified pointer | 13 // pointer events and touch points as we transition towards the unified pointer |
| 12 // event model. | 14 // event model. |
| 13 // TODO(e_hakkinen): Replace WebTouchEvent with WebPointerEvent, remove | 15 // TODO(e_hakkinen): Replace WebTouchEvent with WebPointerEvent, remove |
| 14 // WebTouchEvent and WebTouchPoint and merge this into WebPointerEvent. | 16 // WebTouchEvent and WebTouchPoint and merge this into WebPointerEvent. |
| 15 class WebPointerProperties { | 17 class WebPointerProperties { |
| 16 public: | 18 public: |
| 17 WebPointerProperties() | 19 WebPointerProperties() |
| 18 : button(ButtonNone) | 20 : button(ButtonNone) |
| 19 , id(0) | 21 , id(0) |
| 20 , force(0.f) | 22 , force(std::numeric_limits<float>::quiet_NaN()) |
| 21 , tiltX(0) | 23 , tiltX(0) |
| 22 , tiltY(0) | 24 , tiltY(0) |
| 23 , pointerType(PointerType::Unknown) | 25 , pointerType(PointerType::Unknown) |
| 24 { | 26 { |
| 25 } | 27 } |
| 26 | 28 |
| 27 enum Button { | 29 enum Button { |
| 28 ButtonNone = -1, | 30 ButtonNone = -1, |
| 29 ButtonLeft, | 31 ButtonLeft, |
| 30 ButtonMiddle, | 32 ButtonMiddle, |
| (...skipping 18 matching lines...) Expand all Loading... |
| 49 // tiltY is towards the user. | 51 // tiltY is towards the user. |
| 50 int tiltX; | 52 int tiltX; |
| 51 int tiltY; | 53 int tiltY; |
| 52 | 54 |
| 53 PointerType pointerType; | 55 PointerType pointerType; |
| 54 }; | 56 }; |
| 55 | 57 |
| 56 } // namespace blink | 58 } // namespace blink |
| 57 | 59 |
| 58 #endif | 60 #endif |
| OLD | NEW |