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

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: tests 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 virtual ~PlatformEventObserver() {}
sky 2014/03/25 15:51:15 protected?
sadrul 2014/03/25 18:33:15 Done.
18
19 // This is called before the dispatcher receives the event. The observer can
20 // consume the event and stop the event from reaching the dispatcher or other
21 // observers by returning true from this function. The event dispatch
sky 2014/03/25 15:51:15 nit: I think an enum would be cleaner here.
sadrul 2014/03/25 18:33:15 Done.
22 // continues as usual if this returns false.
23 virtual bool WillProcessEvent(const PlatformEvent& event) = 0;
24
25 // This is called after the event has been dispatched to the dispatcher(s).
26 virtual void DidProcessEvent(const PlatformEvent& event) = 0;
27 };
28
29 } // namespace ui
30
31 #endif // UI_EVENTS_PLATFORM_PLATFORM_EVENT_OBSERVER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698