env_input_state_controller.h 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. // Copyright 2016 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_ENV_INPUT_STATE_CONTROLLER_H_
  5. #define UI_AURA_ENV_INPUT_STATE_CONTROLLER_H_
  6. #include <stdint.h>
  7. #include "base/memory/raw_ptr.h"
  8. #include "ui/aura/aura_export.h"
  9. namespace gfx {
  10. class Point;
  11. }
  12. namespace ui {
  13. class MouseEvent;
  14. class TouchEvent;
  15. }
  16. namespace aura {
  17. namespace test {
  18. class EnvTestHelper;
  19. }
  20. class Env;
  21. class Window;
  22. class AURA_EXPORT EnvInputStateController {
  23. public:
  24. explicit EnvInputStateController(Env* env);
  25. EnvInputStateController(const EnvInputStateController&) = delete;
  26. EnvInputStateController& operator=(const EnvInputStateController&) = delete;
  27. ~EnvInputStateController();
  28. void UpdateStateForMouseEvent(const Window* window,
  29. const ui::MouseEvent& event);
  30. void UpdateStateForTouchEvent(const ui::TouchEvent& event);
  31. void SetLastMouseLocation(const Window* root_window,
  32. const gfx::Point& location_in_root) const;
  33. private:
  34. friend class test::EnvTestHelper;
  35. raw_ptr<Env> env_;
  36. // Touch ids that are currently down.
  37. uint32_t touch_ids_down_ = 0;
  38. };
  39. } // namespace aura
  40. #endif // UI_AURA_ENV_INPUT_STATE_CONTROLLER_H_