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_event.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   // This is called before the dispatcher receives the event.
18   virtual void WillProcessEvent(const PlatformEvent& event) = 0;
19 
20   // This is called after the event has been dispatched to the dispatcher(s).
21   virtual void DidProcessEvent(const PlatformEvent& event) = 0;
22 
23  protected:
~PlatformEventObserver()24   virtual ~PlatformEventObserver() {}
25 };
26 
27 }  // namespace ui
28 
29 #endif  // UI_EVENTS_PLATFORM_PLATFORM_EVENT_OBSERVER_H_
30