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

Unified Diff: ui/events/platform/platform_event_dispatcher.h

Issue 666673005: Explicitly coerce PostDispatchAction to uint32_t in DispatchEvent() (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@ui_enums
Patch Set: sigh. Windows. Created 6 years, 2 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
Index: ui/events/platform/platform_event_dispatcher.h
diff --git a/ui/events/platform/platform_event_dispatcher.h b/ui/events/platform/platform_event_dispatcher.h
index bda035d8f0f64f337d10d3fcf846afb62e0325a7..4a1706f26ed5ca802817ce8685f737e7e04334bf 100644
--- a/ui/events/platform/platform_event_dispatcher.h
+++ b/ui/events/platform/platform_event_dispatcher.h
@@ -13,11 +13,10 @@ namespace ui {
// See documentation for |PlatformEventDispatcher::DispatchEvent()| for
// explanation of the meaning of the flags.
-enum PostDispatchAction {
- POST_DISPATCH_NONE = 0x0,
sky 2014/10/20 20:58:37 I prefer the enum. It's more typical of how we do
- POST_DISPATCH_PERFORM_DEFAULT = 0x1,
- POST_DISPATCH_STOP_PROPAGATION = 0x2,
-};
+typedef uint32_t PostDispatchAction;
+const PostDispatchAction kPostDispatchNone = 0;
+const PostDispatchAction kPostDispatchPerformDefault = 1 << 0;
+const PostDispatchAction kPostDispatchStopPropagation = 1 << 1;
// PlatformEventDispatcher receives events from a PlatformEventSource and
// dispatches them.
@@ -28,11 +27,11 @@ class EVENTS_EXPORT PlatformEventDispatcher {
// Dispatches |event|. If this is not the default dispatcher, then the
// dispatcher can request that the default dispatcher gets a chance to
- // dispatch the event by setting POST_DISPATCH_PERFORM_DEFAULT to the return
+ // dispatch the event by setting kPostDispatchPerformDefault to the return
// value. If the dispatcher has processed the event, and no other dispatcher
// should be allowed to dispatch the event, then the dispatcher should set
- // POST_DISPATCH_STOP_PROPAGATION flag on the return value.
- virtual uint32_t DispatchEvent(const PlatformEvent& event) = 0;
+ // kPostDispatchStopPropagation flag on the return value.
+ virtual PostDispatchAction DispatchEvent(const PlatformEvent& event) = 0;
protected:
virtual ~PlatformEventDispatcher() {}
« no previous file with comments | « ui/display/chromeos/x11/native_display_event_dispatcher_x11.cc ('k') | ui/events/platform/platform_event_source.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698