Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(82)

Side by Side Diff: ui/events/ozone/events_ozone.cc

Issue 1312833006: Remove ui::KeyEvent::platform_keycode_ (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase Created 5 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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/ozone/events_ozone.h" 5 #include "ui/events/ozone/events_ozone.h"
6 6
7 #include "ui/events/event.h" 7 #include "ui/events/event.h"
8 #include "ui/events/event_constants.h" 8 #include "ui/events/event_constants.h"
9 #include "ui/events/event_utils.h" 9 #include "ui/events/event_utils.h"
10 10
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after
53 DCHECK(event->IsKeyEvent()); 53 DCHECK(event->IsKeyEvent());
54 return event->key_code(); 54 return event->key_code();
55 } 55 }
56 56
57 DomCode CodeFromNative(const base::NativeEvent& native_event) { 57 DomCode CodeFromNative(const base::NativeEvent& native_event) {
58 const ui::KeyEvent* event = static_cast<const ui::KeyEvent*>(native_event); 58 const ui::KeyEvent* event = static_cast<const ui::KeyEvent*>(native_event);
59 DCHECK(event->IsKeyEvent()); 59 DCHECK(event->IsKeyEvent());
60 return event->code(); 60 return event->code();
61 } 61 }
62 62
63 uint32 PlatformKeycodeFromNative(const base::NativeEvent& native_event) {
64 const ui::KeyEvent* event = static_cast<const ui::KeyEvent*>(native_event);
65 DCHECK(event->IsKeyEvent());
66 return event->platform_keycode();
67 }
68
69 bool IsCharFromNative(const base::NativeEvent& native_event) { 63 bool IsCharFromNative(const base::NativeEvent& native_event) {
70 const ui::KeyEvent* event = static_cast<const ui::KeyEvent*>(native_event); 64 const ui::KeyEvent* event = static_cast<const ui::KeyEvent*>(native_event);
71 DCHECK(event->IsKeyEvent()); 65 DCHECK(event->IsKeyEvent());
72 return event->is_char(); 66 return event->is_char();
73 } 67 }
74 68
75 gfx::Vector2d GetMouseWheelOffset(const base::NativeEvent& native_event) { 69 gfx::Vector2d GetMouseWheelOffset(const base::NativeEvent& native_event) {
76 const ui::MouseWheelEvent* event = 70 const ui::MouseWheelEvent* event =
77 static_cast<const ui::MouseWheelEvent*>(native_event); 71 static_cast<const ui::MouseWheelEvent*>(native_event);
78 DCHECK(event->type() == ET_MOUSEWHEEL); 72 DCHECK(event->type() == ET_MOUSEWHEEL);
(...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after
192 callback.Run(&touch_event); 186 callback.Run(&touch_event);
193 } else if (native_ui_event->IsScrollEvent()) { 187 } else if (native_ui_event->IsScrollEvent()) {
194 ui::ScrollEvent scroll_event(native_event); 188 ui::ScrollEvent scroll_event(native_event);
195 callback.Run(&scroll_event); 189 callback.Run(&scroll_event);
196 } else { 190 } else {
197 NOTREACHED(); 191 NOTREACHED();
198 } 192 }
199 } 193 }
200 194
201 } // namespace ui 195 } // namespace ui
OLDNEW
« no previous file with comments | « ui/events/ozone/evdev/keyboard_evdev.cc ('k') | ui/events/ozone/layout/keyboard_layout_engine.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698