window_event_dispatcher_observer.h 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. // Copyright 2018 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_AURA_WINDOW_EVENT_DISPATCHER_OBSERVER_H_
  5. #define UI_AURA_WINDOW_EVENT_DISPATCHER_OBSERVER_H_
  6. #include "ui/aura/aura_export.h"
  7. namespace ui {
  8. class Event;
  9. }
  10. namespace aura {
  11. class WindowEventDispatcher;
  12. // WindowEventDispatcherObservers are added to Env and observe *all*
  13. // WindowEventDispatchers.
  14. class AURA_EXPORT WindowEventDispatcherObserver {
  15. public:
  16. // Called when WindowEventDispatcher starts processing an event.
  17. //
  18. // NOTE: this function is called *after* the location has been transformed
  19. // (assuming the event is a located event). In other words, the coordinates
  20. // are DIPs when this is called.
  21. virtual void OnWindowEventDispatcherStartedProcessing(
  22. WindowEventDispatcher* dispatcher,
  23. const ui::Event& event) {}
  24. // Called when WindowEventDispatcher finishes processing an event.
  25. virtual void OnWindowEventDispatcherFinishedProcessingEvent(
  26. WindowEventDispatcher* dispatcher) {}
  27. // Called when the WindowEventDispatcher dispatches held events. See
  28. // WindowEventDispatcher::HoldMouseMoves() for more details.
  29. virtual void OnWindowEventDispatcherDispatchedHeldEvents(
  30. WindowEventDispatcher* dispatcher) {}
  31. // Called when the WindowEventDispatcher doesn't dispatch the event because
  32. // it's not appropriate at this time. For example a TouchEvent may be ignored
  33. // at certain points in a gesture.
  34. virtual void OnWindowEventDispatcherIgnoredEvent(
  35. WindowEventDispatcher* dispatcher) {}
  36. protected:
  37. virtual ~WindowEventDispatcherObserver() {}
  38. };
  39. } // namespace aura
  40. #endif // UI_AURA_WINDOW_EVENT_DISPATCHER_OBSERVER_H_