OLD | NEW |
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 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 #include "ui/events/event_constants.h" | 6 #include "ui/events/event_constants.h" |
7 #include "ui/events/event_utils.h" | 7 #include "ui/events/event_utils.h" |
8 | 8 |
9 namespace ui { | 9 namespace ui { |
10 | 10 |
11 base::TimeDelta EventTimeFromNative(const base::NativeEvent& native_event) { | 11 base::TimeTicks EventTimeFromNative(const base::NativeEvent& native_event) { |
12 const ui::Event* event = static_cast<const ui::Event*>(native_event); | 12 const ui::Event* event = static_cast<const ui::Event*>(native_event); |
13 return event->time_stamp(); | 13 return event->time_stamp(); |
14 } | 14 } |
15 | 15 |
16 int EventFlagsFromNative(const base::NativeEvent& native_event) { | 16 int EventFlagsFromNative(const base::NativeEvent& native_event) { |
17 const ui::Event* event = static_cast<const ui::Event*>(native_event); | 17 const ui::Event* event = static_cast<const ui::Event*>(native_event); |
18 return event->flags(); | 18 return event->flags(); |
19 } | 19 } |
20 | 20 |
21 EventType EventTypeFromNative(const base::NativeEvent& native_event) { | 21 EventType EventTypeFromNative(const base::NativeEvent& native_event) { |
(...skipping 127 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
149 *vx_ordinal = event->x_offset_ordinal(); | 149 *vx_ordinal = event->x_offset_ordinal(); |
150 if (vy_ordinal) | 150 if (vy_ordinal) |
151 *vy_ordinal = event->y_offset_ordinal(); | 151 *vy_ordinal = event->y_offset_ordinal(); |
152 if (is_cancel) | 152 if (is_cancel) |
153 *is_cancel = event->type() == ET_SCROLL_FLING_CANCEL; | 153 *is_cancel = event->type() == ET_SCROLL_FLING_CANCEL; |
154 | 154 |
155 return true; | 155 return true; |
156 } | 156 } |
157 | 157 |
158 } // namespace ui | 158 } // namespace ui |
OLD | NEW |