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

Side by Side Diff: ui/events/platform/platform_event_observer.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
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_OBSERVER_H_
6 #define UI_EVENTS_PLATFORM_PLATFORM_EVENT_OBSERVER_H_
7
8 #include "ui/events/events_export.h"
9 #include "ui/events/platform/platform_event_types.h"
10
11 namespace ui {
12
13 // PlatformEventObserver can be installed on a PlatformEventSource, and it
14 // receives all events that are dispatched to the dispatchers.
15 class EVENTS_EXPORT PlatformEventObserver {
16 public:
17 enum EventStatus {
18 EVENT_STATUS_CONTINUE,
19 EVENT_STATUS_HANDLED
20 };
21
22 // This is called before the dispatcher receives the event. The observer can
23 // consume the event and stop the event from reaching the dispatcher or other
24 // observers by returning EVENT_STATUS_HANDLED from this function. The event
25 // dispatch continues as usual if this returns EVENT_STATUS_CONTINUE.
26 virtual EventStatus WillProcessEvent(const PlatformEvent& event) = 0;
27
28 // This is called after the event has been dispatched to the dispatcher(s).
29 virtual void DidProcessEvent(const PlatformEvent& event) = 0;
30
31 protected:
32 virtual ~PlatformEventObserver() {}
33 };
34
35 } // namespace ui
36
37 #endif // UI_EVENTS_PLATFORM_PLATFORM_EVENT_OBSERVER_H_
OLDNEW
« no previous file with comments | « ui/events/platform/platform_event_dispatcher.h ('k') | ui/events/platform/platform_event_source.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698