Chromium Code Reviews| 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 #if defined(USE_X11) | 7 #if defined(USE_X11) |
| 8 #include <X11/extensions/XInput2.h> | 8 #include <X11/extensions/XInput2.h> |
| 9 #include <X11/keysym.h> | 9 #include <X11/keysym.h> |
| 10 #include <X11/Xlib.h> | 10 #include <X11/Xlib.h> |
| (...skipping 227 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 238 100, | 238 100, |
| 239 base::HistogramBase::kUmaTargetedHistogramFlag); | 239 base::HistogramBase::kUmaTargetedHistogramFlag); |
| 240 counter_for_type->Add(delta_sample); | 240 counter_for_type->Add(delta_sample); |
| 241 | 241 |
| 242 #if defined(USE_X11) | 242 #if defined(USE_X11) |
| 243 if (native_event->type == GenericEvent) { | 243 if (native_event->type == GenericEvent) { |
| 244 XIDeviceEvent* xiev = | 244 XIDeviceEvent* xiev = |
| 245 static_cast<XIDeviceEvent*>(native_event->xcookie.data); | 245 static_cast<XIDeviceEvent*>(native_event->xcookie.data); |
| 246 source_device_id_ = xiev->sourceid; | 246 source_device_id_ = xiev->sourceid; |
| 247 } | 247 } |
| 248 #endif | 248 #endif |
|
sadrul
2015/04/09 01:07:43
Should the source-device-id be set here for OZONE
kpschoedel
2015/04/09 18:51:41
Done.
| |
| 249 } | 249 } |
| 250 | 250 |
| 251 Event::Event(const Event& copy) | 251 Event::Event(const Event& copy) |
| 252 : type_(copy.type_), | 252 : type_(copy.type_), |
| 253 time_stamp_(copy.time_stamp_), | 253 time_stamp_(copy.time_stamp_), |
| 254 latency_(copy.latency_), | 254 latency_(copy.latency_), |
| 255 flags_(copy.flags_), | 255 flags_(copy.flags_), |
| 256 native_event_(CopyNativeEvent(copy.native_event_)), | 256 native_event_(CopyNativeEvent(copy.native_event_)), |
| 257 delete_native_event_(true), | 257 delete_native_event_(true), |
| 258 cancelable_(true), | 258 cancelable_(true), |
| (...skipping 416 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 675 set_flags(flags() | ui::EF_IS_REPEAT); | 675 set_flags(flags() | ui::EF_IS_REPEAT); |
| 676 | 676 |
| 677 #if defined(USE_X11) | 677 #if defined(USE_X11) |
| 678 NormalizeFlags(); | 678 NormalizeFlags(); |
| 679 #endif | 679 #endif |
| 680 #if defined(OS_WIN) | 680 #if defined(OS_WIN) |
| 681 // Only Windows has native character events. | 681 // Only Windows has native character events. |
| 682 if (is_char_) | 682 if (is_char_) |
| 683 character_ = native_event.wParam; | 683 character_ = native_event.wParam; |
| 684 #endif | 684 #endif |
| 685 #if defined(USE_OZONE) | |
| 686 set_source_device_id( | |
| 687 static_cast<const Event*>(native_event)->source_device_id()); | |
| 688 #endif | |
| 685 } | 689 } |
| 686 | 690 |
| 687 KeyEvent::KeyEvent(EventType type, | 691 KeyEvent::KeyEvent(EventType type, |
| 688 KeyboardCode key_code, | 692 KeyboardCode key_code, |
| 689 int flags) | 693 int flags) |
| 690 : Event(type, EventTimeForNow(), flags), | 694 : Event(type, EventTimeForNow(), flags), |
| 691 key_code_(key_code), | 695 key_code_(key_code), |
| 692 code_(DomCode::NONE), | 696 code_(DomCode::NONE), |
| 693 is_char_(false), | 697 is_char_(false), |
| 694 platform_keycode_(0), | 698 platform_keycode_(0), |
| (...skipping 289 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 984 gfx::PointF(x, y), | 988 gfx::PointF(x, y), |
| 985 time_stamp, | 989 time_stamp, |
| 986 flags | EF_FROM_TOUCH), | 990 flags | EF_FROM_TOUCH), |
| 987 details_(details) { | 991 details_(details) { |
| 988 } | 992 } |
| 989 | 993 |
| 990 GestureEvent::~GestureEvent() { | 994 GestureEvent::~GestureEvent() { |
| 991 } | 995 } |
| 992 | 996 |
| 993 } // namespace ui | 997 } // namespace ui |
| OLD | NEW |