Chromium Code Reviews| 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); |