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(const GestureEventDetails
& details
,
13 MotionEvent::ToolType primary_tool_type
,
19 size_t touch_point_count
,
20 const gfx::RectF
& bounding_box
,
23 motion_event_id(motion_event_id
),
24 primary_tool_type(primary_tool_type
),
31 DCHECK_GE(motion_event_id
, 0);
32 DCHECK_NE(0U, touch_point_count
);
33 this->details
.set_touch_points(static_cast<int>(touch_point_count
));
34 this->details
.set_bounding_box(bounding_box
);
37 GestureEventData::GestureEventData(EventType type
,
38 const GestureEventData
& other
)
39 : details(type
, 0, 0),
40 motion_event_id(other
.motion_event_id
),
41 primary_tool_type(other
.primary_tool_type
),
48 details
.set_touch_points(other
.details
.touch_points());
49 details
.set_bounding_box(other
.details
.bounding_box_f());
52 GestureEventData::GestureEventData()
54 primary_tool_type(MotionEvent::TOOL_TYPE_UNKNOWN
),