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

Unified Diff: ui/base/gestures/gesture_types.h

Issue 10816008: ash: Record some additional information about the gestures. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: tot-merge Created 8 years, 5 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ui/base/gestures/gesture_sequence.cc ('k') | ui/base/gestures/gesture_types.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/base/gestures/gesture_types.h
diff --git a/ui/base/gestures/gesture_types.h b/ui/base/gestures/gesture_types.h
index 09c80b055b1f28a9eb07c5092804a76c2c473a9c..6dd39b6d937b8c65eb55c296fcf796a857b89177 100644
--- a/ui/base/gestures/gesture_types.h
+++ b/ui/base/gestures/gesture_types.h
@@ -15,6 +15,11 @@ struct UI_EXPORT GestureEventDetails {
public:
GestureEventDetails(EventType type, float delta_x, float delta_y);
+ EventType type() const { return type_; }
+
+ int touch_points() const { return touch_points_; }
+ void set_touch_points(int touch_points) { touch_points_ = touch_points; }
+
float scroll_x() const {
CHECK_EQ(ui::ET_GESTURE_SCROLL_UPDATE, type_);
return data.scroll.x;
@@ -47,11 +52,6 @@ struct UI_EXPORT GestureEventDetails {
return data.touch_id;
}
- int touch_points() const {
- DCHECK(type_ == ui::ET_GESTURE_BEGIN || type_ == ui::ET_GESTURE_END);
- return data.touch_points;
- }
-
float scale() const {
CHECK_EQ(ui::ET_GESTURE_PINCH_UPDATE, type_);
return data.scale;
@@ -104,8 +104,6 @@ struct UI_EXPORT GestureEventDetails {
int touch_id; // LONG_PRESS touch-id.
- int touch_points; // Number of active touch points for BEGIN/END.
-
struct { // SWIPE direction.
bool left;
bool right;
@@ -118,6 +116,8 @@ struct UI_EXPORT GestureEventDetails {
float delta_y;
} generic;
} data;
+
+ int touch_points_; // Number of active touch points in the gesture.
};
// An abstract type to represent touch-events. The gesture-recognizer uses this
@@ -187,12 +187,10 @@ class UI_EXPORT GestureEventHelper {
// |flags| is ui::EventFlags. The meaning of |param_first| and |param_second|
// depends on the specific gesture type (|type|).
- virtual GestureEvent* CreateGestureEvent(EventType type,
+ virtual GestureEvent* CreateGestureEvent(const GestureEventDetails& details,
const gfx::Point& location,
int flags,
base::Time time,
- float param_first,
- float param_second,
unsigned int touch_id_bitfield) = 0;
virtual TouchEvent* CreateTouchEvent(EventType type,
« no previous file with comments | « ui/base/gestures/gesture_sequence.cc ('k') | ui/base/gestures/gesture_types.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698