| OLD | NEW |
| (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_ | |
| OLD | NEW |