Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1189)

Side by Side Diff: content/common/input/web_touch_event_traits.h

Issue 1560553002: Framelet Prototype 2016 Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebased + Applied Brett's Windows + Fixed security issue Created 4 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
(Empty)
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
3 // found in the LICENSE file.
4
5 #ifndef CONTENT_COMMON_INPUT_WEB_TOUCH_EVENT_TRAITS_H_
6 #define CONTENT_COMMON_INPUT_WEB_TOUCH_EVENT_TRAITS_H_
7
8 #include "content/common/input/scoped_web_input_event.h"
9 #include "third_party/WebKit/public/web/WebInputEvent.h"
10
11 namespace content {
12
13 // Utility class for performing operations on and with WebTouchEvents.
14 class CONTENT_EXPORT WebTouchEventTraits {
15 public:
16 // Returns whether all touches in the event have the specified state.
17 static bool AllTouchPointsHaveState(const blink::WebTouchEvent& event,
18 blink::WebTouchPoint::State state);
19
20 // Returns whether this event represents a transition from no active
21 // touches to some active touches (the start of a new "touch sequence").
22 static bool IsTouchSequenceStart(const blink::WebTouchEvent& event);
23
24 // Returns whether this event represents a transition from active
25 // touches to no active touches (the end of a "touch sequence").
26 static bool IsTouchSequenceEnd(const blink::WebTouchEvent& event);
27
28 // Sets the type of |event| to |type|, resetting any other type-specific
29 // properties and updating the timestamp.
30 static void ResetType(blink::WebInputEvent::Type type,
31 double timestamp_sec,
32 blink::WebTouchEvent* event);
33
34 // Like ResetType but also resets the state of all active touches
35 // to match the event type. This is particularly useful, for example,
36 // in sending a touchcancel for all active touches.
37 static void ResetTypeAndTouchStates(blink::WebInputEvent::Type type,
38 double timestamp_sec,
39 blink::WebTouchEvent* event);
40 };
41
42 } // namespace content
43
44 #endif // CONTENT_COMMON_INPUT_WEB_TOUCH_EVENT_TRAITS_H_
OLDNEW
« no previous file with comments | « content/common/input/web_input_event_traits_unittest.cc ('k') | content/common/input/web_touch_event_traits.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698