1 // Copyright 2014 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.
5 #include "ui/events/gesture_detection/gesture_event_data.h"
7 #include "base/logging.h"
11 GestureEventData::GestureEventData(EventType type,
16 int touch_point_count,
17 const gfx::RectF& bounding_box,
18 const GestureEventDetails& details)
20 motion_event_id(motion_event_id),
25 DCHECK(motion_event_id >= 0);
26 DCHECK_NE(0, touch_point_count);
27 DCHECK(ET_GESTURE_TYPE_START <= type && type <= ET_GESTURE_TYPE_END);
28 this->details.set_touch_points(touch_point_count);
29 this->details.set_bounding_box(bounding_box);
32 GestureEventData::GestureEventData(EventType type,
37 int touch_point_count,
38 const gfx::RectF& bounding_box)
40 motion_event_id(motion_event_id),
44 details(GestureEventDetails(type, 0, 0)) {
45 DCHECK(motion_event_id >= 0);
46 DCHECK_NE(0, touch_point_count);
47 DCHECK(ET_GESTURE_TYPE_START <= type && type <= ET_GESTURE_TYPE_END);
48 details.set_touch_points(touch_point_count);
49 details.set_bounding_box(bounding_box);
52 GestureEventData::GestureEventData() : type(ET_UNKNOWN), x(0), y(0) {}