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

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: Renamed LocatedEvent::AsLocatedIfLocatedEvent() as FromIfValid(). 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
« no previous file with comments | « chrome/browser/ui/views/toolbar/toolbar_button.cc ('k') | ui/views/animation/flood_fill_ink_drop_ripple.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/events/event.h
diff --git a/ui/events/event.h b/ui/events/event.h
index a617760b3b4727c0903ed77feef9345ae9284aef..84f11439b64d4fc2681f175351ac1223ae2a0568 100644
--- a/ui/events/event.h
+++ b/ui/events/event.h
@@ -318,6 +318,12 @@ 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* FromIfValid(const ui::Event* event) {
+ return event && event->IsLocatedEvent() ? event->AsLocatedEvent() : nullptr;
+ }
+
~LocatedEvent() override;
float x() const { return location_.x(); }
« no previous file with comments | « chrome/browser/ui/views/toolbar/toolbar_button.cc ('k') | ui/views/animation/flood_fill_ink_drop_ripple.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698