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 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
51 DCHECK(event->IsKeyEvent()); | 51 DCHECK(event->IsKeyEvent()); |
52 return event->key_code(); | 52 return event->key_code(); |
53 } | 53 } |
54 | 54 |
55 const char* CodeFromNative(const base::NativeEvent& native_event) { | 55 const char* CodeFromNative(const base::NativeEvent& native_event) { |
56 const ui::KeyEvent* event = static_cast<const ui::KeyEvent*>(native_event); | 56 const ui::KeyEvent* event = static_cast<const ui::KeyEvent*>(native_event); |
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 PlatformCodeFromNative(const base::NativeEvent& native_event) { |
| 62 const ui::KeyEvent* event = static_cast<const ui::KeyEvent*>(native_event); |
| 63 DCHECK(event->IsKeyEvent()); |
| 64 return event->platform_keycode(); |
| 65 } |
| 66 |
61 gfx::Vector2d GetMouseWheelOffset(const base::NativeEvent& native_event) { | 67 gfx::Vector2d GetMouseWheelOffset(const base::NativeEvent& native_event) { |
62 const ui::MouseWheelEvent* event = | 68 const ui::MouseWheelEvent* event = |
63 static_cast<const ui::MouseWheelEvent*>(native_event); | 69 static_cast<const ui::MouseWheelEvent*>(native_event); |
64 DCHECK(event->type() == ET_MOUSEWHEEL); | 70 DCHECK(event->type() == ET_MOUSEWHEEL); |
65 return event->offset(); | 71 return event->offset(); |
66 } | 72 } |
67 | 73 |
68 base::NativeEvent CopyNativeEvent(const base::NativeEvent& event) { | 74 base::NativeEvent CopyNativeEvent(const base::NativeEvent& event) { |
69 return NULL; | 75 return NULL; |
70 } | 76 } |
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
146 NOTIMPLEMENTED(); | 152 NOTIMPLEMENTED(); |
147 return false; | 153 return false; |
148 } | 154 } |
149 | 155 |
150 int GetModifiersFromKeyState() { | 156 int GetModifiersFromKeyState() { |
151 NOTIMPLEMENTED(); | 157 NOTIMPLEMENTED(); |
152 return 0; | 158 return 0; |
153 } | 159 } |
154 | 160 |
155 } // namespace ui | 161 } // namespace ui |
OLD | NEW |