Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(3)

Side by Side Diff: ui/views/controls/touch/touch_hud_drawer.h

Issue 2118223004: ash: Refactor touch hud drawing to ash/touch_hud as a separate component. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Use unique_ptr; add descriptions Created 4 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « ash/touch/touch_observer_hud_unittest.cc ('k') | ui/views/controls/touch/touch_hud_drawer.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(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_
OLDNEW
« no previous file with comments | « ash/touch/touch_observer_hud_unittest.cc ('k') | ui/views/controls/touch/touch_hud_drawer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698