OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/views/events/event.h" | 5 #include "ui/views/events/event.h" |
6 | 6 |
7 #include "ui/views/view.h" | 7 #include "ui/views/view.h" |
8 | 8 |
9 namespace ui { | 9 namespace ui { |
10 | 10 |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
43 View* source, | 43 View* source, |
44 View* target) | 44 View* target) |
45 : Event(other.type(), other.flags()) { | 45 : Event(other.type(), other.flags()) { |
46 location_ = other.location(); | 46 location_ = other.location(); |
47 View::ConvertPointToView(*source, *target, &location_); | 47 View::ConvertPointToView(*source, *target, &location_); |
48 } | 48 } |
49 | 49 |
50 //////////////////////////////////////////////////////////////////////////////// | 50 //////////////////////////////////////////////////////////////////////////////// |
51 // MouseEvent, public: | 51 // MouseEvent, public: |
52 | 52 |
| 53 MouseEvent::MouseEvent(const ui::NativeEvent& native_event) |
| 54 : LocatedEvent(ui::EventTypeFromNative(native_event), |
| 55 ui::EventLocationFromNative(native_event), |
| 56 ui::EventFlagsFromNative(native_event)) { |
| 57 } |
| 58 |
53 MouseEvent::MouseEvent(const MouseEvent& other, View* source, View* target) | 59 MouseEvent::MouseEvent(const MouseEvent& other, View* source, View* target) |
54 : LocatedEvent(other, source, target) { | 60 : LocatedEvent(other, source, target) { |
55 } | 61 } |
56 | 62 |
| 63 KeyEvent::KeyEvent(const ui::NativeEvent& native_event) |
| 64 : Event(ui::EventTypeFromNative(native_event), |
| 65 ui::EventFlagsFromNative(native_event)), |
| 66 key_code_(ui::KeyboardCodeFromNative(native_event)) { |
| 67 } |
| 68 |
| 69 MouseWheelEvent::MouseWheelEvent(const ui::NativeEvent& native_event) |
| 70 : LocatedEvent(ui::EventTypeFromNative(native_event), |
| 71 ui::EventLocationFromNative(native_event), |
| 72 ui::EventFlagsFromNative(native_event)), |
| 73 offset_(ui::GetMouseWheelOffset(native_event)) { |
| 74 } |
| 75 |
57 } // namespace ui | 76 } // namespace ui |
OLD | NEW |