| Index: ui/events/gesture_event_details.cc
|
| diff --git a/ui/events/gesture_event_details.cc b/ui/events/gesture_event_details.cc
|
| index 780713118d348dfdd4e31814ae97b24385f818c6..3f478e5aaabce15848e5b1fe6f733e689ad9e994 100644
|
| --- a/ui/events/gesture_event_details.cc
|
| +++ b/ui/events/gesture_event_details.cc
|
| @@ -10,16 +10,10 @@
|
| : type_(ET_UNKNOWN), touch_points_(0), oldest_touch_id_(-1) {
|
| }
|
|
|
| -GestureEventDetails::GestureEventDetails(ui::EventType type)
|
| - : type_(type), touch_points_(1), oldest_touch_id_(-1) {
|
| - DCHECK_GE(type, ET_GESTURE_TYPE_START);
|
| - DCHECK_LE(type, ET_GESTURE_TYPE_END);
|
| -}
|
| -
|
| GestureEventDetails::GestureEventDetails(ui::EventType type,
|
| float delta_x,
|
| float delta_y)
|
| - : type_(type), touch_points_(1), oldest_touch_id_(-1) {
|
| + : type_(type), touch_points_(1), oldest_touch_id_(0) {
|
| DCHECK_GE(type, ET_GESTURE_TYPE_START);
|
| DCHECK_LE(type, ET_GESTURE_TYPE_END);
|
| switch (type_) {
|
| @@ -43,6 +37,11 @@
|
| data.first_finger_enclosing_rectangle.height = delta_y;
|
| break;
|
|
|
| + case ui::ET_GESTURE_PINCH_UPDATE:
|
| + data.scale = delta_x;
|
| + CHECK_EQ(0.f, delta_y) << "Unknown data in delta_y for pinch";
|
| + break;
|
| +
|
| case ui::ET_GESTURE_SWIPE:
|
| data.swipe.left = delta_x < 0;
|
| data.swipe.right = delta_x > 0;
|
| @@ -50,8 +49,19 @@
|
| data.swipe.down = delta_y > 0;
|
| break;
|
|
|
| + case ui::ET_GESTURE_TAP:
|
| + case ui::ET_GESTURE_DOUBLE_TAP:
|
| + case ui::ET_GESTURE_TAP_UNCONFIRMED:
|
| + data.tap_count = static_cast<int>(delta_x);
|
| + CHECK_EQ(0.f, delta_y) << "Unknown data in delta_y for tap.";
|
| + break;
|
| +
|
| default:
|
| - NOTREACHED() << "Invalid event type for constructor: " << type;
|
| + if (delta_x != 0.f || delta_y != 0.f) {
|
| + DLOG(WARNING) << "A gesture event (" << type << ") had unknown data: ("
|
| + << delta_x << "," << delta_y;
|
| + }
|
| + break;
|
| }
|
| }
|
|
|
|
|