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_utils.h" | 5 #include "ui/events/event_utils.h" |
6 | 6 |
7 #include <stddef.h> | 7 #include <stddef.h> |
8 #include <string.h> | 8 #include <string.h> |
9 #include <X11/extensions/XInput.h> | 9 #include <X11/extensions/XInput.h> |
10 #include <X11/extensions/XInput2.h> | 10 #include <X11/extensions/XInput2.h> |
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
78 | 78 |
79 EventType EventTypeFromNative(const base::NativeEvent& native_event) { | 79 EventType EventTypeFromNative(const base::NativeEvent& native_event) { |
80 return EventTypeFromXEvent(*native_event); | 80 return EventTypeFromXEvent(*native_event); |
81 } | 81 } |
82 | 82 |
83 int EventFlagsFromNative(const base::NativeEvent& native_event) { | 83 int EventFlagsFromNative(const base::NativeEvent& native_event) { |
84 return EventFlagsFromXEvent(*native_event); | 84 return EventFlagsFromXEvent(*native_event); |
85 } | 85 } |
86 | 86 |
87 base::TimeTicks EventTimeFromNative(const base::NativeEvent& native_event) { | 87 base::TimeTicks EventTimeFromNative(const base::NativeEvent& native_event) { |
88 return EventTimeFromXEvent(*native_event); | 88 base::TimeTicks timestamp = EventTimeFromXEvent(*native_event); |
| 89 ValidateEventTimeClock(×tamp); |
| 90 return timestamp; |
89 } | 91 } |
90 | 92 |
91 gfx::Point EventLocationFromNative(const base::NativeEvent& native_event) { | 93 gfx::Point EventLocationFromNative(const base::NativeEvent& native_event) { |
92 return EventLocationFromXEvent(*native_event); | 94 return EventLocationFromXEvent(*native_event); |
93 } | 95 } |
94 | 96 |
95 gfx::Point EventSystemLocationFromNative( | 97 gfx::Point EventSystemLocationFromNative( |
96 const base::NativeEvent& native_event) { | 98 const base::NativeEvent& native_event) { |
97 return EventSystemLocationFromXEvent(*native_event); | 99 return EventSystemLocationFromXEvent(*native_event); |
98 } | 100 } |
(...skipping 126 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
225 xievent->detail = | 227 xievent->detail = |
226 UpdateX11EventButton(event->changed_button_flags(), xievent->detail); | 228 UpdateX11EventButton(event->changed_button_flags(), xievent->detail); |
227 break; | 229 break; |
228 } | 230 } |
229 default: | 231 default: |
230 break; | 232 break; |
231 } | 233 } |
232 } | 234 } |
233 | 235 |
234 } // namespace ui | 236 } // namespace ui |
OLD | NEW |