OLD | NEW |
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 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 #include "ui/events/event_constants.h" | 6 #include "ui/events/event_constants.h" |
7 #include "ui/events/event_utils.h" | 7 #include "ui/events/event_utils.h" |
8 | 8 |
9 namespace ui { | 9 namespace ui { |
10 | 10 |
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
57 DCHECK(event->IsKeyEvent()); | 57 DCHECK(event->IsKeyEvent()); |
58 return event->code().c_str(); | 58 return event->code().c_str(); |
59 } | 59 } |
60 | 60 |
61 uint32 PlatformKeycodeFromNative(const base::NativeEvent& native_event) { | 61 uint32 PlatformKeycodeFromNative(const base::NativeEvent& native_event) { |
62 const ui::KeyEvent* event = static_cast<const ui::KeyEvent*>(native_event); | 62 const ui::KeyEvent* event = static_cast<const ui::KeyEvent*>(native_event); |
63 DCHECK(event->IsKeyEvent()); | 63 DCHECK(event->IsKeyEvent()); |
64 return event->platform_keycode(); | 64 return event->platform_keycode(); |
65 } | 65 } |
66 | 66 |
| 67 bool IsCharFromNative(const base::NativeEvent& native_event) { |
| 68 const ui::KeyEvent* event = static_cast<const ui::KeyEvent*>(native_event); |
| 69 DCHECK(event->IsKeyEvent()); |
| 70 return event->is_char(); |
| 71 } |
| 72 |
67 gfx::Vector2d GetMouseWheelOffset(const base::NativeEvent& native_event) { | 73 gfx::Vector2d GetMouseWheelOffset(const base::NativeEvent& native_event) { |
68 const ui::MouseWheelEvent* event = | 74 const ui::MouseWheelEvent* event = |
69 static_cast<const ui::MouseWheelEvent*>(native_event); | 75 static_cast<const ui::MouseWheelEvent*>(native_event); |
70 DCHECK(event->type() == ET_MOUSEWHEEL); | 76 DCHECK(event->type() == ET_MOUSEWHEEL); |
71 return event->offset(); | 77 return event->offset(); |
72 } | 78 } |
73 | 79 |
74 base::NativeEvent CopyNativeEvent(const base::NativeEvent& event) { | 80 base::NativeEvent CopyNativeEvent(const base::NativeEvent& event) { |
75 return NULL; | 81 return NULL; |
76 } | 82 } |
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
143 *end_time = 0; | 149 *end_time = 0; |
144 return false; | 150 return false; |
145 } | 151 } |
146 | 152 |
147 int GetModifiersFromKeyState() { | 153 int GetModifiersFromKeyState() { |
148 NOTIMPLEMENTED(); | 154 NOTIMPLEMENTED(); |
149 return 0; | 155 return 0; |
150 } | 156 } |
151 | 157 |
152 } // namespace ui | 158 } // namespace ui |
OLD | NEW |