| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 CONTENT_COMMON_INPUT_WEB_TOUCH_EVENT_TRAITS_H_ | 5 #ifndef CONTENT_COMMON_INPUT_WEB_TOUCH_EVENT_TRAITS_H_ |
| 6 #define CONTENT_COMMON_INPUT_WEB_TOUCH_EVENT_TRAITS_H_ | 6 #define CONTENT_COMMON_INPUT_WEB_TOUCH_EVENT_TRAITS_H_ |
| 7 | 7 |
| 8 #include "content/common/content_export.h" | 8 #include "content/common/content_export.h" |
| 9 #include "third_party/WebKit/public/platform/WebInputEvent.h" | 9 #include "third_party/WebKit/public/platform/WebInputEvent.h" |
| 10 | 10 |
| 11 namespace blink { |
| 12 class WebTouchEvent; |
| 13 } |
| 14 |
| 11 namespace content { | 15 namespace content { |
| 12 | 16 |
| 13 // Utility class for performing operations on and with WebTouchEvents. | 17 // Utility class for performing operations on and with WebTouchEvents. |
| 14 class CONTENT_EXPORT WebTouchEventTraits { | 18 class CONTENT_EXPORT WebTouchEventTraits { |
| 15 public: | 19 public: |
| 16 // Returns whether all touches in the event have the specified state. | 20 // Returns whether all touches in the event have the specified state. |
| 17 static bool AllTouchPointsHaveState(const blink::WebTouchEvent& event, | 21 static bool AllTouchPointsHaveState(const blink::WebTouchEvent& event, |
| 18 blink::WebTouchPoint::State state); | 22 blink::WebTouchPoint::State state); |
| 19 | 23 |
| 20 // Returns whether this event represents a transition from no active | 24 // Returns whether this event represents a transition from no active |
| (...skipping 14 matching lines...) Expand all Loading... |
| 35 // to match the event type. This is particularly useful, for example, | 39 // to match the event type. This is particularly useful, for example, |
| 36 // in sending a touchcancel for all active touches. | 40 // in sending a touchcancel for all active touches. |
| 37 static void ResetTypeAndTouchStates(blink::WebInputEvent::Type type, | 41 static void ResetTypeAndTouchStates(blink::WebInputEvent::Type type, |
| 38 double timestamp_sec, | 42 double timestamp_sec, |
| 39 blink::WebTouchEvent* event); | 43 blink::WebTouchEvent* event); |
| 40 }; | 44 }; |
| 41 | 45 |
| 42 } // namespace content | 46 } // namespace content |
| 43 | 47 |
| 44 #endif // CONTENT_COMMON_INPUT_WEB_TOUCH_EVENT_TRAITS_H_ | 48 #endif // CONTENT_COMMON_INPUT_WEB_TOUCH_EVENT_TRAITS_H_ |
| OLD | NEW |