gesture_event_data.cc revision 6d86b77056ed63eb6871182f42a9fd5f07550f90
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. 4 5#include "ui/events/gesture_detection/gesture_event_data.h" 6 7#include "base/logging.h" 8 9namespace ui { 10 11GestureEventData::GestureEventData(const GestureEventDetails& details, 12 int motion_event_id, 13 base::TimeTicks time, 14 float x, 15 float y, 16 float raw_x, 17 float raw_y, 18 size_t touch_point_count, 19 const gfx::RectF& bounding_box) 20 : details(details), 21 motion_event_id(motion_event_id), 22 time(time), 23 x(x), 24 y(y), 25 raw_x(raw_x), 26 raw_y(raw_y) { 27 DCHECK_GE(motion_event_id, 0); 28 DCHECK_NE(0U, touch_point_count); 29 this->details.set_touch_points(static_cast<int>(touch_point_count)); 30 this->details.set_bounding_box(bounding_box); 31} 32 33GestureEventData::GestureEventData(EventType type, 34 const GestureEventData& other) 35 : details(type, 0, 0), 36 motion_event_id(other.motion_event_id), 37 time(other.time), 38 x(other.x), 39 y(other.y), 40 raw_x(other.raw_x), 41 raw_y(other.raw_y) { 42 details.set_touch_points(other.details.touch_points()); 43 details.set_bounding_box(other.details.bounding_box_f()); 44} 45 46GestureEventData::GestureEventData() 47 : motion_event_id(0), x(0), y(0), raw_x(0), raw_y(0) { 48} 49 50} // namespace ui 51