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 826 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
837 kMaxAutoRepeatTimeMs) { | 837 kMaxAutoRepeatTimeMs) { |
838 last_key_event_->set_time_stamp(event.time_stamp()); | 838 last_key_event_->set_time_stamp(event.time_stamp()); |
839 last_key_event_->set_flags(last_key_event_->flags() | ui::EF_IS_REPEAT); | 839 last_key_event_->set_flags(last_key_event_->flags() | ui::EF_IS_REPEAT); |
840 return true; | 840 return true; |
841 } | 841 } |
842 delete last_key_event_; | 842 delete last_key_event_; |
843 last_key_event_ = new KeyEvent(event); | 843 last_key_event_ = new KeyEvent(event); |
844 return false; | 844 return false; |
845 } | 845 } |
846 | 846 |
847 KeyEvent::KeyEvent(EventType type, base::TimeDelta time_stamp, int flags) | |
848 : Event(type, time_stamp, flags) {} | |
849 | |
850 KeyEvent::KeyEvent(const base::NativeEvent& native_event) | 847 KeyEvent::KeyEvent(const base::NativeEvent& native_event) |
851 : Event(native_event, | 848 : Event(native_event, |
852 EventTypeFromNative(native_event), | 849 EventTypeFromNative(native_event), |
853 EventFlagsFromNative(native_event)), | 850 EventFlagsFromNative(native_event)), |
854 key_code_(KeyboardCodeFromNative(native_event)), | 851 key_code_(KeyboardCodeFromNative(native_event)), |
855 code_(CodeFromNative(native_event)), | 852 code_(CodeFromNative(native_event)), |
856 is_char_(IsCharFromNative(native_event)) { | 853 is_char_(IsCharFromNative(native_event)) { |
857 if (IsRepeated(*this)) | 854 if (IsRepeated(*this)) |
858 set_flags(flags() | ui::EF_IS_REPEAT); | 855 set_flags(flags() | ui::EF_IS_REPEAT); |
859 | 856 |
(...skipping 287 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1147 gfx::PointF(x, y), | 1144 gfx::PointF(x, y), |
1148 time_stamp, | 1145 time_stamp, |
1149 flags | EF_FROM_TOUCH), | 1146 flags | EF_FROM_TOUCH), |
1150 details_(details) { | 1147 details_(details) { |
1151 } | 1148 } |
1152 | 1149 |
1153 GestureEvent::~GestureEvent() { | 1150 GestureEvent::~GestureEvent() { |
1154 } | 1151 } |
1155 | 1152 |
1156 } // namespace ui | 1153 } // namespace ui |
OLD | NEW |