touch_hud_projection.h 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. // Copyright 2013 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 ASH_TOUCH_TOUCH_HUD_PROJECTION_H_
  5. #define ASH_TOUCH_TOUCH_HUD_PROJECTION_H_
  6. #include "ash/touch/touch_observer_hud.h"
  7. namespace ash {
  8. class TouchHudRenderer;
  9. // A heads-up display to show active touch points on the screen. As a derivative
  10. // of TouchObserverHud, objects of this class manage their own lifetime. Used
  11. // for the --show-taps flag.
  12. class TouchHudProjection : public TouchObserverHud {
  13. public:
  14. explicit TouchHudProjection(aura::Window* initial_root);
  15. TouchHudProjection(const TouchHudProjection&) = delete;
  16. TouchHudProjection& operator=(const TouchHudProjection&) = delete;
  17. // TouchObserverHud:
  18. void Clear() override;
  19. private:
  20. friend class TouchHudProjectionTest;
  21. ~TouchHudProjection() override;
  22. // TouchObserverHud:
  23. void OnTouchEvent(ui::TouchEvent* event) override;
  24. void SetHudForRootWindowController(RootWindowController* controller) override;
  25. void UnsetHudForRootWindowController(
  26. RootWindowController* controller) override;
  27. // TouchHudRenderer draws out the touch points.
  28. std::unique_ptr<TouchHudRenderer> touch_hud_renderer_;
  29. };
  30. } // namespace ash
  31. #endif // ASH_TOUCH_TOUCH_HUD_PROJECTION_H_