summaryrefslogtreecommitdiffstats
path: root/ui/events/platform/platform_event_observer.h
blob: 37aec638ea529b3316f5e529d8bea6ff3c9c1014 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
// Copyright 2014 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#ifndef UI_EVENTS_PLATFORM_PLATFORM_EVENT_OBSERVER_H_
#define UI_EVENTS_PLATFORM_PLATFORM_EVENT_OBSERVER_H_

#include "ui/events/events_export.h"
#include "ui/events/platform/platform_event_types.h"

namespace ui {

// PlatformEventObserver can be installed on a PlatformEventSource, and it
// receives all events that are dispatched to the dispatchers.
class EVENTS_EXPORT PlatformEventObserver {
 public:
  // This is called before the dispatcher receives the event.
  virtual void WillProcessEvent(const PlatformEvent& event) = 0;

  // This is called after the event has been dispatched to the dispatcher(s).
  virtual void DidProcessEvent(const PlatformEvent& event) = 0;

 protected:
  virtual ~PlatformEventObserver() {}
};

}  // namespace ui

#endif  // UI_EVENTS_PLATFORM_PLATFORM_EVENT_OBSERVER_H_