OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/event.h" | 5 #include "ui/events/event.h" |
6 | 6 |
7 #include <utility> | 7 #include <utility> |
8 | 8 |
9 #include "base/memory/ptr_util.h" | 9 #include "base/memory/ptr_util.h" |
10 | 10 |
(...skipping 1051 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1062 default: | 1062 default: |
1063 NOTREACHED(); | 1063 NOTREACHED(); |
1064 } | 1064 } |
1065 latency()->set_source_event_type(ui::SourceEventType::TOUCH); | 1065 latency()->set_source_event_type(ui::SourceEventType::TOUCH); |
1066 } | 1066 } |
1067 | 1067 |
1068 PointerEvent::PointerEvent(EventType type, | 1068 PointerEvent::PointerEvent(EventType type, |
1069 const gfx::Point& location, | 1069 const gfx::Point& location, |
1070 const gfx::Point& root_location, | 1070 const gfx::Point& root_location, |
1071 int flags, | 1071 int flags, |
1072 int pointer_id, | |
1073 int changed_button_flags, | 1072 int changed_button_flags, |
1074 const PointerDetails& pointer_details, | 1073 const PointerDetails& pointer_details, |
1075 base::TimeTicks time_stamp) | 1074 base::TimeTicks time_stamp) |
1076 : LocatedEvent(type, | 1075 : LocatedEvent(type, |
1077 gfx::PointF(location), | 1076 gfx::PointF(location), |
1078 gfx::PointF(root_location), | 1077 gfx::PointF(root_location), |
1079 time_stamp, | 1078 time_stamp, |
1080 flags), | 1079 flags), |
1081 changed_button_flags_(changed_button_flags), | 1080 changed_button_flags_(changed_button_flags), |
1082 details_(pointer_details) { | 1081 details_(pointer_details) { |
1083 details_.id = pointer_id; | |
1084 if (details_.pointer_type == EventPointerType::POINTER_TYPE_TOUCH) | 1082 if (details_.pointer_type == EventPointerType::POINTER_TYPE_TOUCH) |
1085 latency()->set_source_event_type(ui::SourceEventType::TOUCH); | 1083 latency()->set_source_event_type(ui::SourceEventType::TOUCH); |
1086 else if (type == ET_POINTER_WHEEL_CHANGED) | 1084 else if (type == ET_POINTER_WHEEL_CHANGED) |
1087 latency()->set_source_event_type(ui::SourceEventType::WHEEL); | 1085 latency()->set_source_event_type(ui::SourceEventType::WHEEL); |
1088 else | 1086 else |
1089 latency()->set_source_event_type(ui::SourceEventType::OTHER); | 1087 latency()->set_source_event_type(ui::SourceEventType::OTHER); |
1090 } | 1088 } |
1091 | 1089 |
1092 const int PointerEvent::kMousePointerId = std::numeric_limits<int32_t>::max(); | 1090 const int PointerEvent::kMousePointerId = std::numeric_limits<int32_t>::max(); |
1093 | 1091 |
(...skipping 344 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1438 flags | EF_FROM_TOUCH), | 1436 flags | EF_FROM_TOUCH), |
1439 details_(details), | 1437 details_(details), |
1440 unique_touch_event_id_(unique_touch_event_id) { | 1438 unique_touch_event_id_(unique_touch_event_id) { |
1441 latency()->set_source_event_type(ui::SourceEventType::TOUCH); | 1439 latency()->set_source_event_type(ui::SourceEventType::TOUCH); |
1442 } | 1440 } |
1443 | 1441 |
1444 GestureEvent::~GestureEvent() { | 1442 GestureEvent::~GestureEvent() { |
1445 } | 1443 } |
1446 | 1444 |
1447 } // namespace ui | 1445 } // namespace ui |
OLD | NEW |