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

Side by Side Diff: cc/input/touch_action.h

Issue 2863693003: Unify TouchAction classes (Closed)
Patch Set: add cc/input/touch_action.h to BUILD.gn 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 | « cc/BUILD.gn ('k') | content/browser/renderer_host/input/input_router_impl.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 2017 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 CC_INPUT_TOUCH_ACTION_H_
6 #define CC_INPUT_TOUCH_ACTION_H_
7
8 namespace cc {
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 // This is intended to be the single canonical definition of the enum, it's used
14 // elsewhere in both Blink and content since touch action logic spans those
15 // subsystems.
wkorman 2017/05/10 17:56:56 Suggest adding TODO, filing P3 bug and linking bug
16 const size_t kTouchActionBits = 6;
17
18 enum TouchAction {
19 // No scrolling or zooming allowed.
20 kTouchActionNone = 0x0,
21 kTouchActionPanLeft = 0x1,
22 kTouchActionPanRight = 0x2,
23 kTouchActionPanX = kTouchActionPanLeft | kTouchActionPanRight,
24 kTouchActionPanUp = 0x4,
25 kTouchActionPanDown = 0x8,
26 kTouchActionPanY = kTouchActionPanUp | kTouchActionPanDown,
27 kTouchActionPan = kTouchActionPanX | kTouchActionPanY,
28 kTouchActionPinchZoom = 0x10,
29 kTouchActionManipulation = kTouchActionPan | kTouchActionPinchZoom,
30 kTouchActionDoubleTapZoom = 0x20,
31 kTouchActionAuto = kTouchActionManipulation | kTouchActionDoubleTapZoom,
32 kTouchActionMax = (1 << 6) - 1
33 };
34
35 inline TouchAction operator|(TouchAction a, TouchAction b) {
36 return static_cast<TouchAction>(int(a) | int(b));
37 }
38
39 inline TouchAction& operator|=(TouchAction& a, TouchAction b) {
40 return a = a | b;
41 }
42
43 inline TouchAction operator&(TouchAction a, TouchAction b) {
44 return static_cast<TouchAction>(int(a) & int(b));
45 }
46
47 inline TouchAction& operator&=(TouchAction& a, TouchAction b) {
48 return a = a & b;
49 }
50
51 } // namespace cc
52
53 #endif // CC_INPUT_TOUCH_ACTION_H_
OLDNEW
« no previous file with comments | « cc/BUILD.gn ('k') | content/browser/renderer_host/input/input_router_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698