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/event.h" | 5 #include "views/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(EventType type, int flags) | 11 Event::Event(EventType type, int flags) |
12 : type_(type), | 12 : type_(type), |
13 #if defined(OS_WIN) | 13 #if defined(OS_WIN) |
14 time_stamp_(GetTickCount()), | 14 time_stamp_(GetTickCount()), |
15 #else | 15 #else |
16 time_stamp_(0), | 16 time_stamp_(0), |
17 #endif | 17 #endif |
18 flags_(flags) { | 18 flags_(flags) { |
19 } | 19 } |
20 | 20 |
21 LocatedEvent::LocatedEvent(const LocatedEvent& model, View* from, View* to) | 21 LocatedEvent::LocatedEvent(const LocatedEvent& model, View* from, View* to) |
22 : Event(model), | 22 : Event(model), |
23 location_(model.location_) { | 23 location_(model.location_) { |
24 if (to) | 24 if (to) |
25 View::ConvertPointToView(from, to, &location_); | 25 View::ConvertPointToView(from, to, &location_); |
26 } | 26 } |
27 | 27 |
28 KeyEvent::KeyEvent(EventType type, app::KeyboardCode key_code, | 28 KeyEvent::KeyEvent(EventType type, app::KeyboardCode keyboard_code, |
29 int event_flags, int repeat_count, int message_flags) | 29 int event_flags, int repeat_count, int message_flags) |
30 : Event(type, event_flags), | 30 : Event(type, event_flags), |
31 key_code_(key_code), | 31 keyboard_code_(keyboard_code), |
32 repeat_count_(repeat_count), | 32 repeat_count_(repeat_count), |
33 message_flags_(message_flags) { | 33 message_flags_(message_flags) { |
34 } | 34 } |
35 | 35 |
36 MouseEvent::MouseEvent(EventType type, | 36 MouseEvent::MouseEvent(EventType type, |
37 View* from, | 37 View* from, |
38 View* to, | 38 View* to, |
39 const gfx::Point &l, | 39 const gfx::Point &l, |
40 int flags) | 40 int flags) |
41 : LocatedEvent(LocatedEvent(type, gfx::Point(l.x(), l.y()), flags), | 41 : LocatedEvent(LocatedEvent(type, gfx::Point(l.x(), l.y()), flags), |
(...skipping 24 matching lines...) Expand all Loading... |
66 touch_id_(touch_id) { | 66 touch_id_(touch_id) { |
67 } | 67 } |
68 | 68 |
69 TouchEvent::TouchEvent(const TouchEvent& model, View* from, View* to) | 69 TouchEvent::TouchEvent(const TouchEvent& model, View* from, View* to) |
70 : LocatedEvent(model, from, to), | 70 : LocatedEvent(model, from, to), |
71 touch_id_(model.touch_id_) { | 71 touch_id_(model.touch_id_) { |
72 } | 72 } |
73 #endif | 73 #endif |
74 | 74 |
75 } // namespace views | 75 } // namespace views |
OLD | NEW |