| 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 729 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 740 kMaxAutoRepeatTimeMs) { | 740 kMaxAutoRepeatTimeMs) { |
| 741 last_key_event_->set_time_stamp(event.time_stamp()); | 741 last_key_event_->set_time_stamp(event.time_stamp()); |
| 742 last_key_event_->set_flags(last_key_event_->flags() | ui::EF_IS_REPEAT); | 742 last_key_event_->set_flags(last_key_event_->flags() | ui::EF_IS_REPEAT); |
| 743 return true; | 743 return true; |
| 744 } | 744 } |
| 745 delete last_key_event_; | 745 delete last_key_event_; |
| 746 last_key_event_ = new KeyEvent(event); | 746 last_key_event_ = new KeyEvent(event); |
| 747 return false; | 747 return false; |
| 748 } | 748 } |
| 749 | 749 |
| 750 KeyEvent::KeyEvent(EventType type, base::TimeDelta time_stamp, int flags) |
| 751 : Event(type, time_stamp, flags) {} |
| 752 |
| 750 KeyEvent::KeyEvent(const base::NativeEvent& native_event) | 753 KeyEvent::KeyEvent(const base::NativeEvent& native_event) |
| 751 : Event(native_event, | 754 : Event(native_event, |
| 752 EventTypeFromNative(native_event), | 755 EventTypeFromNative(native_event), |
| 753 EventFlagsFromNative(native_event)), | 756 EventFlagsFromNative(native_event)), |
| 754 key_code_(KeyboardCodeFromNative(native_event)), | 757 key_code_(KeyboardCodeFromNative(native_event)), |
| 755 code_(CodeFromNative(native_event)), | 758 code_(CodeFromNative(native_event)), |
| 756 is_char_(IsCharFromNative(native_event)) { | 759 is_char_(IsCharFromNative(native_event)) { |
| 757 if (IsRepeated(*this)) | 760 if (IsRepeated(*this)) |
| 758 set_flags(flags() | ui::EF_IS_REPEAT); | 761 set_flags(flags() | ui::EF_IS_REPEAT); |
| 759 | 762 |
| (...skipping 287 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1047 gfx::PointF(x, y), | 1050 gfx::PointF(x, y), |
| 1048 time_stamp, | 1051 time_stamp, |
| 1049 flags | EF_FROM_TOUCH), | 1052 flags | EF_FROM_TOUCH), |
| 1050 details_(details) { | 1053 details_(details) { |
| 1051 } | 1054 } |
| 1052 | 1055 |
| 1053 GestureEvent::~GestureEvent() { | 1056 GestureEvent::~GestureEvent() { |
| 1054 } | 1057 } |
| 1055 | 1058 |
| 1056 } // namespace ui | 1059 } // namespace ui |
| OLD | NEW |