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

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

Issue 755883002: Input Injection API on Ozone (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Add unit test Created 6 years 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 166 matching lines...) Expand 10 before | Expand all | Expand 10 after
177 NOTIMPLEMENTED(); 177 NOTIMPLEMENTED();
178 return 0; 178 return 0;
179 } 179 }
180 180
181 void DispatchEventFromNativeUiEvent(const base::NativeEvent& native_event, 181 void DispatchEventFromNativeUiEvent(const base::NativeEvent& native_event,
182 base::Callback<void(ui::Event*)> callback) { 182 base::Callback<void(ui::Event*)> callback) {
183 const ui::Event* native_ui_event = static_cast<ui::Event*>(native_event); 183 const ui::Event* native_ui_event = static_cast<ui::Event*>(native_event);
184 if (native_ui_event->IsKeyEvent()) { 184 if (native_ui_event->IsKeyEvent()) {
185 ui::KeyEvent key_event(native_event); 185 ui::KeyEvent key_event(native_event);
186 callback.Run(&key_event); 186 callback.Run(&key_event);
187 } else if (native_ui_event->IsMouseWheelEvent()) {
188 ui::MouseWheelEvent wheel_event(native_event);
189 callback.Run(&wheel_event);
187 } else if (native_ui_event->IsMouseEvent()) { 190 } else if (native_ui_event->IsMouseEvent()) {
188 ui::MouseEvent mouse_event(native_event); 191 ui::MouseEvent mouse_event(native_event);
189 callback.Run(&mouse_event); 192 callback.Run(&mouse_event);
190 } else if (native_ui_event->IsTouchEvent()) { 193 } else if (native_ui_event->IsTouchEvent()) {
191 ui::TouchEvent touch_event(native_event); 194 ui::TouchEvent touch_event(native_event);
192 callback.Run(&touch_event); 195 callback.Run(&touch_event);
193 } else if (native_ui_event->IsScrollEvent()) { 196 } else if (native_ui_event->IsScrollEvent()) {
194 ui::ScrollEvent scroll_event(native_event); 197 ui::ScrollEvent scroll_event(native_event);
195 callback.Run(&scroll_event); 198 callback.Run(&scroll_event);
196 } else { 199 } else {
197 NOTREACHED(); 200 NOTREACHED();
198 } 201 }
199 } 202 }
200 203
201 } // namespace ui 204 } // namespace ui
OLDNEW
« no previous file with comments | « ui/events/ozone/evdev/input_injector_evdev_unittest.cc ('k') | ui/events/ozone/events_ozone.gyp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698