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

Unified Diff: ui/events/event_handler.cc

Issue 2374213003: Refactored static_cast'ing of events to use the AsXXXEvent() methods. (Closed)
Patch Set: Created 4 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | ui/events/ozone/evdev/input_injector_evdev_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/events/event_handler.cc
diff --git a/ui/events/event_handler.cc b/ui/events/event_handler.cc
index 0f79c3556fb477e3cffda4d75920fe9cc767101b..66f1edd48aa0759467cd191ad8573b780e9b008a 100644
--- a/ui/events/event_handler.cc
+++ b/ui/events/event_handler.cc
@@ -21,16 +21,14 @@ EventHandler::~EventHandler() {
}
void EventHandler::OnEvent(Event* event) {
- // TODO(tdanderson): Encapsulate static_casts in ui::Event for all
- // event types.
kylix_rd 2016/09/29 18:12:19 I noticed this comment and had a couple of cycles
if (event->IsKeyEvent())
- OnKeyEvent(static_cast<KeyEvent*>(event));
+ OnKeyEvent(event->AsKeyEvent());
else if (event->IsMouseEvent())
- OnMouseEvent(static_cast<MouseEvent*>(event));
+ OnMouseEvent(event->AsMouseEvent());
else if (event->IsScrollEvent())
- OnScrollEvent(static_cast<ScrollEvent*>(event));
+ OnScrollEvent(event->AsScrollEvent());
else if (event->IsTouchEvent())
- OnTouchEvent(static_cast<TouchEvent*>(event));
+ OnTouchEvent(event->AsTouchEvent());
else if (event->IsGestureEvent())
OnGestureEvent(event->AsGestureEvent());
else if (event->type() == ET_CANCEL_MODE)
« no previous file with comments | « no previous file | ui/events/ozone/evdev/input_injector_evdev_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698