Chromium Code Reviews| Index: ui/events/event.cc |
| diff --git a/ui/events/event.cc b/ui/events/event.cc |
| index fbf647a05867d3a25eaf8bd61f861a268584e641..f04c842e595b3787a18aed70cb42eab4d04857e3 100644 |
| --- a/ui/events/event.cc |
| +++ b/ui/events/event.cc |
| @@ -288,6 +288,16 @@ bool Event::IsTouchPointerEvent() const { |
| EventPointerType::POINTER_TYPE_TOUCH; |
| } |
| +CancelModeEvent* Event::AsCancelModeEvent() { |
|
rjkroege
2016/10/03 22:58:40
I know that you're (rightly) following the pattern
sadrul
2016/10/04 00:35:04
+1
kylix_rd
2016/10/04 14:12:20
Certainly. I can simply move the method bodies to
|
| + CHECK(IsCancelModeEvent()); |
| + return static_cast<CancelModeEvent*>(this); |
| +} |
| + |
| +const CancelModeEvent* Event::AsCancelModeEvent() const { |
| + CHECK(IsCancelModeEvent()); |
| + return static_cast<const CancelModeEvent*>(this); |
| +} |
| + |
| GestureEvent* Event::AsGestureEvent() { |
| CHECK(IsGestureEvent()); |
| return static_cast<GestureEvent*>(this); |