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

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
« no previous file with comments | « ui/aura/root_window.cc ('k') | ui/base/events/event.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/base/events/event.h
diff --git a/ui/base/events/event.h b/ui/base/events/event.h
index 06687beb2cf7dfa4e7fc452e80f78fb33cf763ae..2ca865bc0a17e019fbf78419414c14a61d3eb9ab 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.
+ void StopPropagation();
+ bool stopped_propagation() const { return !!(result_ & ui::ER_CONSUMED); }
+
+ void SetHandled();
+ bool handled() const { return result_ != ui::ER_UNHANDLED; }
+
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') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698