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 #include "base/memory/ptr_util.h" | 9 #include "base/memory/ptr_util.h" |
10 | 10 |
(...skipping 965 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
976 kMaxAutoRepeatTimeMs) { | 976 kMaxAutoRepeatTimeMs) { |
977 last_key_event_->set_time_stamp(event.time_stamp()); | 977 last_key_event_->set_time_stamp(event.time_stamp()); |
978 last_key_event_->set_flags(last_key_event_->flags() | ui::EF_IS_REPEAT); | 978 last_key_event_->set_flags(last_key_event_->flags() | ui::EF_IS_REPEAT); |
979 return true; | 979 return true; |
980 } | 980 } |
981 delete last_key_event_; | 981 delete last_key_event_; |
982 last_key_event_ = new KeyEvent(event); | 982 last_key_event_ = new KeyEvent(event); |
983 return false; | 983 return false; |
984 } | 984 } |
985 | 985 |
986 KeyEvent::KeyEvent(EventType type, base::TimeDelta time_stamp, int flags) | |
987 : Event(type, time_stamp, flags) {} | |
988 | |
989 KeyEvent::KeyEvent(const base::NativeEvent& native_event) | 986 KeyEvent::KeyEvent(const base::NativeEvent& native_event) |
990 : Event(native_event, | 987 : Event(native_event, |
991 EventTypeFromNative(native_event), | 988 EventTypeFromNative(native_event), |
992 EventFlagsFromNative(native_event)), | 989 EventFlagsFromNative(native_event)), |
993 key_code_(KeyboardCodeFromNative(native_event)), | 990 key_code_(KeyboardCodeFromNative(native_event)), |
994 code_(CodeFromNative(native_event)), | 991 code_(CodeFromNative(native_event)), |
995 is_char_(IsCharFromNative(native_event)) { | 992 is_char_(IsCharFromNative(native_event)) { |
996 if (IsRepeated(*this)) | 993 if (IsRepeated(*this)) |
997 set_flags(flags() | ui::EF_IS_REPEAT); | 994 set_flags(flags() | ui::EF_IS_REPEAT); |
998 | 995 |
(...skipping 288 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1287 gfx::PointF(x, y), | 1284 gfx::PointF(x, y), |
1288 time_stamp, | 1285 time_stamp, |
1289 flags | EF_FROM_TOUCH), | 1286 flags | EF_FROM_TOUCH), |
1290 details_(details) { | 1287 details_(details) { |
1291 } | 1288 } |
1292 | 1289 |
1293 GestureEvent::~GestureEvent() { | 1290 GestureEvent::~GestureEvent() { |
1294 } | 1291 } |
1295 | 1292 |
1296 } // namespace ui | 1293 } // namespace ui |
OLD | NEW |