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

Unified Diff: ui/events/event.h

Issue 2042073002: Centered flood fill style ink drop ripples on mouse/touch points. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Addressed comments from patch set 6. Created 4 years, 6 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/events/event.h
diff --git a/ui/events/event.h b/ui/events/event.h
index b01c12d3e303aacd6bec1c75a5b9e911a0c8a028..e0961d1365f828d7d191c80ce6f89469f6645d0f 100644
--- a/ui/events/event.h
+++ b/ui/events/event.h
@@ -318,6 +318,13 @@ class EVENTS_EXPORT CancelModeEvent : public Event {
class EVENTS_EXPORT LocatedEvent : public Event {
public:
+ // Convenience function that casts |event| to a LocatedEvent if it is one,
+ // otherwise returns null.
+ static const ui::LocatedEvent* AsLocatedEventIfLocatedEvent(
+ const ui::Event* event) {
+ return event && event->IsLocatedEvent() ? event->AsLocatedEvent() : nullptr;
+ }
+
~LocatedEvent() override;
float x() const { return location_.x(); }

Powered by Google App Engine
This is Rietveld 408576698