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

Side by Side Diff: ui/events/platform/platform_event_dispatcher.h

Issue 203483004: events: Introduce PlatformEventDispatcher and PlatformEventSource. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: tot-merge Created 6 years, 9 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « ui/events/events.gyp ('k') | ui/events/platform/platform_event_observer.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #ifndef UI_EVENTS_PLATFORM_PLATFORM_EVENT_DISPATCHER_H_
6 #define UI_EVENTS_PLATFORM_PLATFORM_EVENT_DISPATCHER_H_
7
8 #include "base/basictypes.h"
9 #include "ui/events/events_export.h"
10 #include "ui/events/platform/platform_event_types.h"
11
12 namespace ui {
13
14 // See documentation for |PlatformEventDispatcher::DispatchEvent()| for
15 // explanation of the meaning of the flags.
16 enum PostDispatchAction {
17 POST_DISPATCH_NONE = 0x0,
18 POST_DISPATCH_QUIT_LOOP = 0x1,
19 POST_DISPATCH_PERFORM_DEFAULT = 0x2,
20 POST_DISPATCH_STOP_PROPAGATION = 0x4,
21 };
22
23 // PlatformEventDispatcher receives events from a PlatformEventSource and
24 // dispatches them.
25 class EVENTS_EXPORT PlatformEventDispatcher {
26 public:
27 // Returns whether this dispatcher wants to dispatch |event|.
28 virtual bool CanDispatchEvent(const PlatformEvent& event) = 0;
29
30 // Dispatches |event|. If this is not the default dispatcher, then the
31 // dispatcher can request that the default dispatcher gets a chance to
32 // dispatch the event by setting POST_DISPATCH_PERFORM_DEFAULT to the return
33 // value. If a nested message-loop is active, then the dispatcher can signal
34 // that the nested message-loop should be terminated by setting
35 // POST_DISPATCH_QUIT_LOOP flag on the return value. If the dispatcher has
36 // processed the event, and no other dispatcher should be allowed to dispatch
37 // the event, then the dispatcher should set POST_DISPATCH_STOP_PROPAGATION
38 // flag on the return value.
39 virtual uint32_t DispatchEvent(const PlatformEvent& event) = 0;
40
41 protected:
42 virtual ~PlatformEventDispatcher() {}
43 };
44
45 } // namespace ui
46
47 #endif // UI_EVENTS_PLATFORM_PLATFORM_EVENT_DISPATCHER_H_
OLDNEW
« no previous file with comments | « ui/events/events.gyp ('k') | ui/events/platform/platform_event_observer.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698