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

Unified Diff: ui/ozone/platform/drm/host/drm_window_host.cc

Issue 2374213003: Refactored static_cast'ing of events to use the AsXXXEvent() methods. (Closed)
Patch Set: Added IsCancelModeEvent() & AsCancelModeEvent() methods to Event Created 4 years, 2 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
Index: ui/ozone/platform/drm/host/drm_window_host.cc
diff --git a/ui/ozone/platform/drm/host/drm_window_host.cc b/ui/ozone/platform/drm/host/drm_window_host.cc
index 647756053b1935a2113b54bf036347fc8e34f921..d4501ba374fdfd2cbdcbccf9c24d494435ea8661 100644
--- a/ui/ozone/platform/drm/host/drm_window_host.cc
+++ b/ui/ozone/platform/drm/host/drm_window_host.cc
@@ -160,7 +160,7 @@ bool DrmWindowHost::CanDispatchEvent(const PlatformEvent& ne) {
snapshot->current_mode()->size());
return display_bounds == bounds_;
} else if (event->IsLocatedEvent()) {
- LocatedEvent* located_event = static_cast<LocatedEvent*>(event);
+ LocatedEvent* located_event = event->AsLocatedEvent();
return bounds_.Contains(located_event->location());
}
@@ -174,7 +174,7 @@ uint32_t DrmWindowHost::DispatchEvent(const PlatformEvent& native_event) {
Event* event = static_cast<Event*>(native_event);
if (event->IsLocatedEvent()) {
// Make the event location relative to this window's origin.
- LocatedEvent* located_event = static_cast<LocatedEvent*>(event);
+ LocatedEvent* located_event = event->AsLocatedEvent();
gfx::PointF location = located_event->location_f();
location -= gfx::Vector2dF(bounds_.OffsetFromOrigin());
located_event->set_location_f(location);

Powered by Google App Engine
This is Rietveld 408576698