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

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

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/base/events/event.h ('k') | ui/base/events/event_dispatcher.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/base/events/event.cc
diff --git a/ui/base/events/event.cc b/ui/base/events/event.cc
index 4658e46cb92caf76929c672c916b91d5a2dc4996..a489eae32754506fbf731a10c0b3775d76a7ddb2 100644
--- a/ui/base/events/event.cc
+++ b/ui/base/events/event.cc
@@ -71,6 +71,17 @@ bool Event::HasNativeEvent() const {
return !!std::memcmp(&native_event_, &null_event, sizeof(null_event));
}
+void Event::StopPropagation() {
+ CHECK(phase_ != EP_PREDISPATCH && phase_ != EP_POSTDISPATCH);
+ result_ = static_cast<ui::EventResult>(result_ | ER_CONSUMED);
+ CHECK(stopped_propagation());
+}
+
+void Event::SetHandled() {
+ CHECK(phase_ != EP_PREDISPATCH && phase_ != EP_POSTDISPATCH);
+ result_ = static_cast<ui::EventResult>(result_ | ER_HANDLED);
+}
+
Event::Event(EventType type, base::TimeDelta time_stamp, int flags)
: type_(type),
time_stamp_(time_stamp),
« no previous file with comments | « ui/base/events/event.h ('k') | ui/base/events/event_dispatcher.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698