Chromium Code Reviews| Index: ui/views/controls/touch/touch_hud_drawer.h |
| diff --git a/ui/views/controls/touch/touch_hud_drawer.h b/ui/views/controls/touch/touch_hud_drawer.h |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..cab04bbfe388c2d7183a0e6f7ab6cf3f66d4ffa0 |
| --- /dev/null |
| +++ b/ui/views/controls/touch/touch_hud_drawer.h |
| @@ -0,0 +1,51 @@ |
| +// Copyright 2016 The Chromium Authors. All rights reserved. |
| +// Use of this source code is governed by a BSD-style license that can be |
| +// found in the LICENSE file. |
| + |
| +#ifndef UI_VIEWS_CONTROLS_TOUCH_TOUCH_HUD_DRAWER_H_ |
| +#define UI_VIEWS_CONTROLS_TOUCH_TOUCH_HUD_DRAWER_H_ |
| + |
| +#include <map> |
| +#include <memory> |
| + |
| +#include "base/macros.h" |
| +#include "ui/views/views_export.h" |
| + |
| +namespace ash { |
| +class TouchHudProjectionTest; |
| +} |
| + |
| +namespace ui { |
| +class LocatedEvent; |
| +} |
| + |
| +namespace views { |
| +class TouchPointView; |
| +class Widget; |
| + |
| +// Handles touch events to draw out touch points accordingly. |
| +class VIEWS_EXPORT TouchHudDrawer { |
|
sky
2016/07/07 00:04:38
Can I also suggest naming this TouchHudRenderer? D
riajiang
2016/07/11 16:26:03
Done :)
|
| + public: |
| + static std::unique_ptr<TouchHudDrawer> Get(); |
|
sky
2016/07/07 00:04:38
Why do you need a Get() that uses the constructor
riajiang
2016/07/11 16:26:03
Changed it back. I was trying to convert it to a u
|
| + |
| + TouchHudDrawer(); |
| + ~TouchHudDrawer(); |
| + |
| + // Called to clear touch points and traces from the screen. |
| + void Clear(); |
| + |
| + // Receives a touch event and draws its touch point under parent_widget. |
| + void HandleTouchEvent(const ui::LocatedEvent* event, Widget* parent_widget); |
| + |
| + private: |
| + friend class ash::TouchHudProjectionTest; |
| + |
| + // a map of touch ids to TouchPointView |
| + std::map<int, TouchPointView*> points_; |
| + |
| + DISALLOW_COPY_AND_ASSIGN(TouchHudDrawer); |
| +}; |
| + |
| +} // namespace views |
| + |
| +#endif // UI_VIEWS_CONTROLS_TOUCH_TOUCH_HUD_DRAWER_H_ |