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

Unified Diff: ui/base/events/event.h

Issue 11308322: events: Start changing EventHandler interface to not return a value. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years 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/base/events/event.h
diff --git a/ui/base/events/event.h b/ui/base/events/event.h
index 06687beb2cf7dfa4e7fc452e80f78fb33cf763ae..ad6b8efde8b3f08b577a29356b108fb58b70ee80 100644
--- a/ui/base/events/event.h
+++ b/ui/base/events/event.h
@@ -161,6 +161,15 @@ class UI_EXPORT Event {
// Returns true if the event has a valid |native_event_|.
bool HasNativeEvent() const;
+ // Immediately stops the propagation of the event. This must be called only
+ // from an EventHandler during an event-dispatch. Any event handler that may
+ // be in the list will not receive the event after this is called.
Ben Goodger (Google) 2012/12/03 17:36:54 One thing to note. Reading the W3C spec for DOMEve
sadrul 2012/12/03 17:45:20 One of the use-cases for StopPropagation is when t
+ void StopPropagation();
+ bool stopped_propagation() const { return result_ & ui::ER_CONSUMED; }
+
+ void PreventDefault();
+ bool default_prevented() const { return result_ != ui::ER_UNHANDLED; }
Ben Goodger (Google) 2012/12/03 17:36:54 This reads a little awkwardly. I'm not sure I have
sadrul 2012/12/03 17:45:20 How about 'handled()' or 'processed()' (and 'MarkH
+
protected:
Event(EventType type, base::TimeDelta time_stamp, int flags);
Event(const base::NativeEvent& native_event, EventType type, int flags);
« no previous file with comments | « ui/aura/root_window.cc ('k') | ui/base/events/event.cc » ('j') | ui/base/events/event.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698