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/base/events/event_constants.h" | 5 #include "ui/base/events/event_constants.h" |
6 | 6 |
7 #include <string.h> | 7 #include <string.h> |
8 #include <X11/extensions/XInput.h> | 8 #include <X11/extensions/XInput.h> |
9 #include <X11/extensions/XInput2.h> | 9 #include <X11/extensions/XInput2.h> |
10 #include <X11/Xlib.h> | 10 #include <X11/Xlib.h> |
(...skipping 757 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
768 case KeyPress: | 768 case KeyPress: |
769 case KeyRelease: | 769 case KeyRelease: |
770 return base::TimeDelta::FromMilliseconds(native_event->xkey.time); | 770 return base::TimeDelta::FromMilliseconds(native_event->xkey.time); |
771 case ButtonPress: | 771 case ButtonPress: |
772 case ButtonRelease: | 772 case ButtonRelease: |
773 return base::TimeDelta::FromMilliseconds(native_event->xbutton.time); | 773 return base::TimeDelta::FromMilliseconds(native_event->xbutton.time); |
774 break; | 774 break; |
775 case MotionNotify: | 775 case MotionNotify: |
776 return base::TimeDelta::FromMilliseconds(native_event->xmotion.time); | 776 return base::TimeDelta::FromMilliseconds(native_event->xmotion.time); |
777 break; | 777 break; |
| 778 case EnterNotify: |
| 779 case LeaveNotify: |
| 780 return base::TimeDelta::FromMilliseconds(native_event->xcrossing.time); |
| 781 break; |
778 case GenericEvent: { | 782 case GenericEvent: { |
779 double start, end; | 783 double start, end; |
780 if (GetGestureTimes(native_event, &start, &end)) { | 784 if (GetGestureTimes(native_event, &start, &end)) { |
781 // If the driver supports gesture times, use them. | 785 // If the driver supports gesture times, use them. |
782 return base::TimeDelta::FromMicroseconds(end * 1000000); | 786 return base::TimeDelta::FromMicroseconds(end * 1000000); |
783 } else { | 787 } else { |
784 XIDeviceEvent* xide = | 788 XIDeviceEvent* xide = |
785 static_cast<XIDeviceEvent*>(native_event->xcookie.data); | 789 static_cast<XIDeviceEvent*>(native_event->xcookie.data); |
786 return base::TimeDelta::FromMilliseconds(xide->time); | 790 return base::TimeDelta::FromMilliseconds(xide->time); |
787 } | 791 } |
(...skipping 247 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1035 noop->xclient.format = 8; | 1039 noop->xclient.format = 8; |
1036 DCHECK(!noop->xclient.display); | 1040 DCHECK(!noop->xclient.display); |
1037 } | 1041 } |
1038 // Make sure we use atom from current xdisplay, which may | 1042 // Make sure we use atom from current xdisplay, which may |
1039 // change during the test. | 1043 // change during the test. |
1040 noop->xclient.message_type = GetNoopEventAtom(); | 1044 noop->xclient.message_type = GetNoopEventAtom(); |
1041 return noop; | 1045 return noop; |
1042 } | 1046 } |
1043 | 1047 |
1044 } // namespace ui | 1048 } // namespace ui |
OLD | NEW |