Chromium Code Reviews| Index: ui/events/gesture_detection/motion_event.h |
| diff --git a/ui/events/gesture_detection/motion_event.h b/ui/events/gesture_detection/motion_event.h |
| index 899aeea1c2ae7b8530cfbb1af15e57824bb2b29d..a1ed7ebad6ab47d71e9e567eb3005bcacd75df7f 100644 |
| --- a/ui/events/gesture_detection/motion_event.h |
| +++ b/ui/events/gesture_detection/motion_event.h |
| @@ -16,7 +16,7 @@ namespace ui { |
| class GESTURE_DETECTION_EXPORT MotionEvent { |
| public: |
| enum Action { |
| - ACTION_DOWN, |
| + ACTION_DOWN = 100, |
|
jdduke (slow)
2014/06/20 15:33:25
Any reason for the 100/200?
Changwan Ryu
2014/06/20 21:00:34
No specific reason. I just wanted to assign SOME d
jdduke (slow)
2014/06/20 21:19:41
I see, let's stick with not assigning them specifi
Changwan Ryu
2014/06/20 21:32:01
Done.
|
| ACTION_UP, |
| ACTION_MOVE, |
| ACTION_CANCEL, |
| @@ -24,6 +24,20 @@ class GESTURE_DETECTION_EXPORT MotionEvent { |
| ACTION_POINTER_UP, |
| }; |
| + enum ToolType { |
| + TOOL_TYPE_UNKNOWN = 200, |
| + TOOL_TYPE_FINGER, |
| + TOOL_TYPE_STYLUS, |
| + TOOL_TYPE_MOUSE, |
| + }; |
| + |
| + const static int BUTTON_NONE = 0; |
|
jdduke (slow)
2014/06/20 15:33:25
I would go ahead and use an enum bit mask here, e.
Changwan Ryu
2014/06/20 21:00:34
Done.
|
| + const static int BUTTON_PRIMARY = 1; |
| + const static int BUTTON_SECONDARY = 2; |
| + const static int BUTTON_TERTIARY = 4; |
| + const static int BUTTON_BACK = 8; |
| + const static int BUTTON_FORWARD = 16; |
| + |
| // The implementer promises that |GetPointerId()| will never exceed this. |
| enum { MAX_POINTER_ID = 31 }; |
| @@ -53,6 +67,8 @@ class GESTURE_DETECTION_EXPORT MotionEvent { |
| size_t historical_index) const = 0; |
| virtual float GetHistoricalY(size_t pointer_index, |
| size_t historical_index) const = 0; |
| + virtual ToolType GetToolType(size_t pointer_index) const = 0; |
| + virtual int GetButtonState() const = 0; |
| virtual scoped_ptr<MotionEvent> Clone() const = 0; |
| virtual scoped_ptr<MotionEvent> Cancel() const = 0; |