Chromium Code Reviews| Index: ash/touch_hud/touch_hud_renderer.h |
| diff --git a/ash/touch_hud/touch_hud_renderer.h b/ash/touch_hud/touch_hud_renderer.h |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..5f177a6ea6a9c77166869ff33e02c81f9fbcf88e |
| --- /dev/null |
| +++ b/ash/touch_hud/touch_hud_renderer.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 ASH_TOUCH_HUD_TOUCH_HUD_RENDERER_H_ |
| +#define ASH_TOUCH_HUD_TOUCH_HUD_RENDERER_H_ |
| + |
| +#include <map> |
| +#include <memory> |
|
James Cook
2016/07/12 17:22:07
Is this used?
riajiang
2016/07/12 20:08:26
Deleted.
|
| + |
| +#include "base/macros.h" |
| + |
| +namespace ui { |
| +class LocatedEvent; |
| +} |
| + |
| +namespace views { |
| +class Widget; |
| +} |
| + |
| +namespace ash { |
| +class TouchHudProjectionTest; |
| +class TouchPointView; |
| + |
| +// Handles touch events to draw out touch points accordingly. |
| +class TouchHudRenderer { |
| + public: |
| + TouchHudRenderer(views::Widget* parent_widget); |
|
James Cook
2016/07/12 17:22:07
explicit
riajiang
2016/07/12 20:08:26
Done.
|
| + ~TouchHudRenderer(); |
| + |
| + // Called to clear touch points and traces from the screen. |
| + void Clear(); |
| + |
| + // Receives a touch event and draws its touch point. |
| + void HandleTouchEvent(const ui::LocatedEvent* event); |
| + |
| + private: |
| + friend class TouchHudProjectionTest; |
| + |
| + // The parent widget that all touch points would be drawn in. |
| + views::Widget* parent_widget_; |
| + |
| + // a map of touch ids to TouchPointView |
|
James Cook
2016/07/12 17:22:07
nit: "A map" and end with period. Also, the int ca
sadrul
2016/07/12 17:48:10
Pretty much guaranteed to not overlap, yeah.
riajiang
2016/07/12 20:08:26
Done.
|
| + std::map<int, TouchPointView*> points_; |
| + |
| + DISALLOW_COPY_AND_ASSIGN(TouchHudRenderer); |
| +}; |
|
James Cook
2016/07/12 17:22:07
Thanks for documenting the class and all the funct
|
| + |
| +} // namespace ash |
| + |
| +#endif // ASH_TOUCH_HUD_TOUCH_HUD_RENDERER_H_ |