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

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

Issue 2863693003: Unify TouchAction classes (Closed)
Patch Set: add cstdlib Created 3 years, 7 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
« no previous file with comments | « content/common/BUILD.gn ('k') | content/common/input_messages.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
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
3 // found in the LICENSE file.
4
5 #ifndef CONTENT_COMMON_INPUT_TOUCH_ACTION_H_
6 #define CONTENT_COMMON_INPUT_TOUCH_ACTION_H_
7
8 namespace content {
9
10 // The current touch action specifies what accelerated browser operations
11 // (panning and zooming) are currently permitted via touch input.
12 // See http://www.w3.org/TR/pointerevents/#the-touch-action-css-property.
13 enum TouchAction {
14 // No scrolling or zooming allowed.
15 TOUCH_ACTION_NONE = 0,
16
17 TOUCH_ACTION_PAN_LEFT = 1 << 0,
18
19 TOUCH_ACTION_PAN_RIGHT = 1 << 1,
20
21 TOUCH_ACTION_PAN_X = TOUCH_ACTION_PAN_LEFT | TOUCH_ACTION_PAN_RIGHT,
22
23 TOUCH_ACTION_PAN_UP = 1 << 2,
24
25 TOUCH_ACTION_PAN_DOWN = 1 << 3,
26
27 TOUCH_ACTION_PAN_Y = TOUCH_ACTION_PAN_UP | TOUCH_ACTION_PAN_DOWN,
28
29 TOUCH_ACTION_PAN = TOUCH_ACTION_PAN_X | TOUCH_ACTION_PAN_Y,
30
31 TOUCH_ACTION_PINCH_ZOOM = 1 << 4,
32
33 TOUCH_ACTION_MANIPULATION = TOUCH_ACTION_PAN | TOUCH_ACTION_PINCH_ZOOM,
34
35 TOUCH_ACTION_DOUBLE_TAP_ZOOM = 1 << 5,
36
37 // All actions are permitted (the default).
38 TOUCH_ACTION_AUTO = TOUCH_ACTION_MANIPULATION | TOUCH_ACTION_DOUBLE_TAP_ZOOM,
39
40 TOUCH_ACTION_MAX = (1 << 6) - 1
41 };
42
43 inline TouchAction operator| (TouchAction a, TouchAction b)
44 {
45 return static_cast<TouchAction>(int(a) | int(b));
46 }
47 inline TouchAction& operator|= (TouchAction& a, TouchAction b)
48 {
49 return a = a | b;
50 }
51 inline TouchAction operator& (TouchAction a, TouchAction b)
52 {
53 return static_cast<TouchAction>(int(a) & int(b));
54 }
55 inline TouchAction& operator&= (TouchAction& a, TouchAction b)
56 {
57 return a = a & b;
58 }
59
60 } // namespace content
61
62 #endif // CONTENT_COMMON_INPUT_TOUCH_ACTION_H_
OLDNEW
« no previous file with comments | « content/common/BUILD.gn ('k') | content/common/input_messages.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698