platform_event_observer.h 960 B

1234567891011121314151617181920212223242526272829
  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. #ifndef UI_EVENTS_PLATFORM_PLATFORM_EVENT_OBSERVER_H_
  5. #define UI_EVENTS_PLATFORM_PLATFORM_EVENT_OBSERVER_H_
  6. #include "ui/events/events_export.h"
  7. #include "ui/events/platform_event.h"
  8. namespace ui {
  9. // PlatformEventObserver can be installed on a PlatformEventSource, and it
  10. // receives all events that are dispatched to the dispatchers.
  11. class EVENTS_EXPORT PlatformEventObserver {
  12. public:
  13. // This is called before the dispatcher receives the event.
  14. virtual void WillProcessEvent(const PlatformEvent& event) = 0;
  15. // This is called after the event has been dispatched to the dispatcher(s).
  16. virtual void DidProcessEvent(const PlatformEvent& event) = 0;
  17. protected:
  18. virtual ~PlatformEventObserver() {}
  19. };
  20. } // namespace ui
  21. #endif // UI_EVENTS_PLATFORM_PLATFORM_EVENT_OBSERVER_H_