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 #if defined(USE_X11) | 9 #if defined(USE_X11) |
10 #include <X11/extensions/XInput2.h> | 10 #include <X11/extensions/XInput2.h> |
(...skipping 806 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
817 kMaxAutoRepeatTimeMs) { | 817 kMaxAutoRepeatTimeMs) { |
818 last_key_event_->set_time_stamp(event.time_stamp()); | 818 last_key_event_->set_time_stamp(event.time_stamp()); |
819 last_key_event_->set_flags(last_key_event_->flags() | ui::EF_IS_REPEAT); | 819 last_key_event_->set_flags(last_key_event_->flags() | ui::EF_IS_REPEAT); |
820 return true; | 820 return true; |
821 } | 821 } |
822 delete last_key_event_; | 822 delete last_key_event_; |
823 last_key_event_ = new KeyEvent(event); | 823 last_key_event_ = new KeyEvent(event); |
824 return false; | 824 return false; |
825 } | 825 } |
826 | 826 |
827 KeyEvent::KeyEvent(EventType type, base::TimeDelta time_stamp, int flags) | |
828 : Event(type, time_stamp, flags) {} | |
829 | |
830 KeyEvent::KeyEvent(const base::NativeEvent& native_event) | 827 KeyEvent::KeyEvent(const base::NativeEvent& native_event) |
831 : Event(native_event, | 828 : Event(native_event, |
832 EventTypeFromNative(native_event), | 829 EventTypeFromNative(native_event), |
833 EventFlagsFromNative(native_event)), | 830 EventFlagsFromNative(native_event)), |
834 key_code_(KeyboardCodeFromNative(native_event)), | 831 key_code_(KeyboardCodeFromNative(native_event)), |
835 code_(CodeFromNative(native_event)), | 832 code_(CodeFromNative(native_event)), |
836 is_char_(IsCharFromNative(native_event)) { | 833 is_char_(IsCharFromNative(native_event)) { |
837 if (IsRepeated(*this)) | 834 if (IsRepeated(*this)) |
838 set_flags(flags() | ui::EF_IS_REPEAT); | 835 set_flags(flags() | ui::EF_IS_REPEAT); |
839 | 836 |
(...skipping 287 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1127 gfx::PointF(x, y), | 1124 gfx::PointF(x, y), |
1128 time_stamp, | 1125 time_stamp, |
1129 flags | EF_FROM_TOUCH), | 1126 flags | EF_FROM_TOUCH), |
1130 details_(details) { | 1127 details_(details) { |
1131 } | 1128 } |
1132 | 1129 |
1133 GestureEvent::~GestureEvent() { | 1130 GestureEvent::~GestureEvent() { |
1134 } | 1131 } |
1135 | 1132 |
1136 } // namespace ui | 1133 } // namespace ui |
OLD | NEW |