relative_pointer_delegate.h 1.1 KB

12345678910111213141516171819202122232425262728293031323334
  1. // Copyright 2019 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 COMPONENTS_EXO_RELATIVE_POINTER_DELEGATE_H_
  5. #define COMPONENTS_EXO_RELATIVE_POINTER_DELEGATE_H_
  6. #include "base/time/time.h"
  7. #include "ui/gfx/geometry/vector2d_f.h"
  8. namespace exo {
  9. class Pointer;
  10. // Handles sending relative mouse movements.
  11. class RelativePointerDelegate {
  12. public:
  13. // Called at the top of the pointer's destructor, to give observers a
  14. // chance to remove themselves.
  15. virtual void OnPointerDestroying(Pointer* pointer) = 0;
  16. // Called to indicate motion. |relative_motion| is given in screen-terms,
  17. // whereas |ordinal_motion| comes from hardware and e.g. is not accelerated.
  18. virtual void OnPointerRelativeMotion(
  19. base::TimeTicks time_stamp,
  20. const gfx::Vector2dF& relative_motion,
  21. const gfx::Vector2dF& ordinal_motion) = 0;
  22. protected:
  23. virtual ~RelativePointerDelegate() {}
  24. };
  25. } // namespace exo
  26. #endif // COMPONENTS_EXO_RELATIVE_POINTER_DELEGATE_H_