Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 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 | |
| 5 #ifndef UI_VIEWS_CONTROLS_TOUCH_TOUCH_HUD_DRAWER_H_ | |
| 6 #define UI_VIEWS_CONTROLS_TOUCH_TOUCH_HUD_DRAWER_H_ | |
| 7 | |
| 8 #include <map> | |
| 9 #include <memory> | |
| 10 | |
| 11 #include "base/macros.h" | |
| 12 #include "ui/views/views_export.h" | |
| 13 | |
| 14 namespace ash { | |
| 15 class TouchHudProjectionTest; | |
| 16 } | |
| 17 | |
| 18 namespace ui { | |
| 19 class LocatedEvent; | |
| 20 } | |
| 21 | |
| 22 namespace views { | |
| 23 class TouchPointView; | |
| 24 class Widget; | |
| 25 | |
| 26 // Handles touch events to draw out touch points accordingly. | |
| 27 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 :)
| |
| 28 public: | |
| 29 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
| |
| 30 | |
| 31 TouchHudDrawer(); | |
| 32 ~TouchHudDrawer(); | |
| 33 | |
| 34 // Called to clear touch points and traces from the screen. | |
| 35 void Clear(); | |
| 36 | |
| 37 // Receives a touch event and draws its touch point under parent_widget. | |
| 38 void HandleTouchEvent(const ui::LocatedEvent* event, Widget* parent_widget); | |
| 39 | |
| 40 private: | |
| 41 friend class ash::TouchHudProjectionTest; | |
| 42 | |
| 43 // a map of touch ids to TouchPointView | |
| 44 std::map<int, TouchPointView*> points_; | |
| 45 | |
| 46 DISALLOW_COPY_AND_ASSIGN(TouchHudDrawer); | |
| 47 }; | |
| 48 | |
| 49 } // namespace views | |
| 50 | |
| 51 #endif // UI_VIEWS_CONTROLS_TOUCH_TOUCH_HUD_DRAWER_H_ | |
| OLD | NEW |