OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "ui/events/gestures/motion_event_aura.h" | 5 #include "ui/events/gestures/motion_event_aura.h" |
6 | 6 |
7 #include "base/logging.h" | 7 #include "base/logging.h" |
8 #include "ui/events/gesture_detection/gesture_configuration.h" | 8 #include "ui/events/gesture_detection/gesture_configuration.h" |
9 | 9 |
10 namespace ui { | 10 namespace ui { |
11 namespace { | 11 namespace { |
12 | 12 |
13 PointerProperties GetPointerPropertiesFromTouchEvent(const TouchEvent& touch) { | 13 PointerProperties GetPointerPropertiesFromTouchEvent(const TouchEvent& touch) { |
14 PointerProperties pointer_properties; | 14 PointerProperties pointer_properties; |
15 pointer_properties.x = touch.x(); | 15 pointer_properties.x = touch.x(); |
16 pointer_properties.y = touch.y(); | 16 pointer_properties.y = touch.y(); |
17 pointer_properties.raw_x = touch.root_location_f().x(); | 17 pointer_properties.raw_x = touch.root_location_f().x(); |
18 pointer_properties.raw_y = touch.root_location_f().y(); | 18 pointer_properties.raw_y = touch.root_location_f().y(); |
19 pointer_properties.id = touch.touch_id(); | 19 pointer_properties.id = touch.touch_id(); |
20 pointer_properties.pressure = touch.force(); | 20 pointer_properties.pressure = touch.pointer_details().force(); |
21 pointer_properties.source_device_id = touch.source_device_id(); | 21 pointer_properties.source_device_id = touch.source_device_id(); |
22 | 22 |
23 pointer_properties.SetAxesAndOrientation(touch.radius_x(), touch.radius_y(), | 23 pointer_properties.SetAxesAndOrientation(touch.pointer_details().radius_x(), |
| 24 touch.pointer_details().radius_y(), |
24 touch.rotation_angle()); | 25 touch.rotation_angle()); |
25 if (!pointer_properties.touch_major) { | 26 if (!pointer_properties.touch_major) { |
26 pointer_properties.touch_major = | 27 pointer_properties.touch_major = |
27 2.f * GestureConfiguration::GetInstance()->default_radius(); | 28 2.f * GestureConfiguration::GetInstance()->default_radius(); |
28 pointer_properties.touch_minor = | 29 pointer_properties.touch_minor = |
29 2.f * GestureConfiguration::GetInstance()->default_radius(); | 30 2.f * GestureConfiguration::GetInstance()->default_radius(); |
30 pointer_properties.orientation = 0; | 31 pointer_properties.orientation = 0; |
31 } | 32 } |
32 | 33 |
33 // TODO(jdduke): Plumb tool type from the platform, crbug.com/404128. | 34 // TODO(jdduke): Plumb tool type from the platform, crbug.com/404128. |
(...skipping 127 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
161 } | 162 } |
162 | 163 |
163 int MotionEventAura::GetIndexFromId(int id) const { | 164 int MotionEventAura::GetIndexFromId(int id) const { |
164 int index = FindPointerIndexOfId(id); | 165 int index = FindPointerIndexOfId(id); |
165 DCHECK_GE(index, 0); | 166 DCHECK_GE(index, 0); |
166 DCHECK_LT(index, static_cast<int>(GetPointerCount())); | 167 DCHECK_LT(index, static_cast<int>(GetPointerCount())); |
167 return index; | 168 return index; |
168 } | 169 } |
169 | 170 |
170 } // namespace ui | 171 } // namespace ui |
OLD | NEW |