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 657 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
668 kMaxAutoRepeatTimeMs) { | 668 kMaxAutoRepeatTimeMs) { |
669 last_key_event_->set_time_stamp(event.time_stamp()); | 669 last_key_event_->set_time_stamp(event.time_stamp()); |
670 last_key_event_->set_flags(last_key_event_->flags() | ui::EF_IS_REPEAT); | 670 last_key_event_->set_flags(last_key_event_->flags() | ui::EF_IS_REPEAT); |
671 return true; | 671 return true; |
672 } | 672 } |
673 delete last_key_event_; | 673 delete last_key_event_; |
674 last_key_event_ = new KeyEvent(event); | 674 last_key_event_ = new KeyEvent(event); |
675 return false; | 675 return false; |
676 } | 676 } |
677 | 677 |
| 678 KeyEvent::KeyEvent(EventType type, base::TimeDelta time_stamp, int flags) |
| 679 : Event(type, time_stamp, flags) {} |
| 680 |
678 KeyEvent::KeyEvent(const base::NativeEvent& native_event) | 681 KeyEvent::KeyEvent(const base::NativeEvent& native_event) |
679 : Event(native_event, | 682 : Event(native_event, |
680 EventTypeFromNative(native_event), | 683 EventTypeFromNative(native_event), |
681 EventFlagsFromNative(native_event)), | 684 EventFlagsFromNative(native_event)), |
682 key_code_(KeyboardCodeFromNative(native_event)), | 685 key_code_(KeyboardCodeFromNative(native_event)), |
683 code_(CodeFromNative(native_event)), | 686 code_(CodeFromNative(native_event)), |
684 is_char_(IsCharFromNative(native_event)) { | 687 is_char_(IsCharFromNative(native_event)) { |
685 if (IsRepeated(*this)) | 688 if (IsRepeated(*this)) |
686 set_flags(flags() | ui::EF_IS_REPEAT); | 689 set_flags(flags() | ui::EF_IS_REPEAT); |
687 | 690 |
(...skipping 285 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
973 gfx::PointF(x, y), | 976 gfx::PointF(x, y), |
974 time_stamp, | 977 time_stamp, |
975 flags | EF_FROM_TOUCH), | 978 flags | EF_FROM_TOUCH), |
976 details_(details) { | 979 details_(details) { |
977 } | 980 } |
978 | 981 |
979 GestureEvent::~GestureEvent() { | 982 GestureEvent::~GestureEvent() { |
980 } | 983 } |
981 | 984 |
982 } // namespace ui | 985 } // namespace ui |
OLD | NEW |