Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 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 "views/events/event.h" | 5 #include "views/events/event.h" |
| 6 | 6 |
| 7 #include "views/view.h" | 7 #include "views/view.h" |
| 8 | 8 |
| 9 namespace views { | 9 namespace views { |
| 10 | 10 |
| 11 Event::Event(ui::EventType type, int flags) | 11 Event::Event(ui::EventType type, int flags) |
| 12 : type_(type), | 12 : type_(type), |
|
sky
2011/02/10 20:59:35
Initialize native_event_ and native_event_2_ here
| |
| 13 time_stamp_(base::Time::NowFromSystemTime()), | 13 time_stamp_(base::Time::NowFromSystemTime()), |
| 14 flags_(flags) { | 14 flags_(flags) { |
| 15 } | 15 } |
| 16 | 16 |
| 17 Event::Event(NativeEvent native_event, ui::EventType type, int flags) | |
| 18 : native_event_(native_event), | |
| 19 type_(type), | |
| 20 time_stamp_(base::Time::NowFromSystemTime()), | |
| 21 flags_(flags) { | |
| 22 } | |
| 23 | |
| 24 Event::Event(NativeEvent2 native_event_2, ui::EventType type, int flags) | |
| 25 : native_event_2_(native_event_2), | |
| 26 type_(type), | |
| 27 time_stamp_(base::Time::NowFromSystemTime()), | |
| 28 flags_(flags) { | |
| 29 } | |
| 30 | |
| 17 LocatedEvent::LocatedEvent(const LocatedEvent& model, View* from, View* to) | 31 LocatedEvent::LocatedEvent(const LocatedEvent& model, View* from, View* to) |
| 18 : Event(model), | 32 : Event(model), |
| 19 location_(model.location_) { | 33 location_(model.location_) { |
| 20 if (to) | 34 if (to) |
| 21 View::ConvertPointToView(from, to, &location_); | 35 View::ConvertPointToView(from, to, &location_); |
| 22 } | 36 } |
| 23 | 37 |
| 24 KeyEvent::KeyEvent(ui::EventType type, ui::KeyboardCode key_code, | 38 KeyEvent::KeyEvent(ui::EventType type, ui::KeyboardCode key_code, |
| 25 int event_flags, int repeat_count, int message_flags) | 39 int event_flags) |
| 26 : Event(type, event_flags), | 40 : Event(type, event_flags), |
| 27 key_code_(key_code), | 41 key_code_(key_code) { |
| 28 repeat_count_(repeat_count), | |
| 29 message_flags_(message_flags) { | |
| 30 } | 42 } |
| 31 | 43 |
| 32 MouseEvent::MouseEvent(ui::EventType type, | 44 MouseEvent::MouseEvent(ui::EventType type, |
| 33 View* from, | 45 View* from, |
| 34 View* to, | 46 View* to, |
| 35 const gfx::Point &l, | 47 const gfx::Point &l, |
| 36 int flags) | 48 int flags) |
| 37 : LocatedEvent(LocatedEvent(type, gfx::Point(l.x(), l.y()), flags), | 49 : LocatedEvent(LocatedEvent(type, gfx::Point(l.x(), l.y()), flags), |
| 38 from, | 50 from, |
| 39 to) { | 51 to) { |
| (...skipping 22 matching lines...) Expand all Loading... | |
| 62 touch_id_(touch_id) { | 74 touch_id_(touch_id) { |
| 63 } | 75 } |
| 64 | 76 |
| 65 TouchEvent::TouchEvent(const TouchEvent& model, View* from, View* to) | 77 TouchEvent::TouchEvent(const TouchEvent& model, View* from, View* to) |
| 66 : LocatedEvent(model, from, to), | 78 : LocatedEvent(model, from, to), |
| 67 touch_id_(model.touch_id_) { | 79 touch_id_(model.touch_id_) { |
| 68 } | 80 } |
| 69 #endif | 81 #endif |
| 70 | 82 |
| 71 } // namespace views | 83 } // namespace views |
| OLD | NEW |