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

Side by Side Diff: ash/touch_hud/touch_hud_renderer.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: Pass parent_widget in ctor; dependency 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
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 ASH_TOUCH_HUD_TOUCH_HUD_RENDERER_H_
6 #define ASH_TOUCH_HUD_TOUCH_HUD_RENDERER_H_
7
8 #include <map>
9 #include <memory>
James Cook 2016/07/12 17:22:07 Is this used?
riajiang 2016/07/12 20:08:26 Deleted.
10
11 #include "base/macros.h"
12
13 namespace ui {
14 class LocatedEvent;
15 }
16
17 namespace views {
18 class Widget;
19 }
20
21 namespace ash {
22 class TouchHudProjectionTest;
23 class TouchPointView;
24
25 // Handles touch events to draw out touch points accordingly.
26 class TouchHudRenderer {
27 public:
28 TouchHudRenderer(views::Widget* parent_widget);
James Cook 2016/07/12 17:22:07 explicit
riajiang 2016/07/12 20:08:26 Done.
29 ~TouchHudRenderer();
30
31 // Called to clear touch points and traces from the screen.
32 void Clear();
33
34 // Receives a touch event and draws its touch point.
35 void HandleTouchEvent(const ui::LocatedEvent* event);
36
37 private:
38 friend class TouchHudProjectionTest;
39
40 // The parent widget that all touch points would be drawn in.
41 views::Widget* parent_widget_;
42
43 // 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.
44 std::map<int, TouchPointView*> points_;
45
46 DISALLOW_COPY_AND_ASSIGN(TouchHudRenderer);
47 };
James Cook 2016/07/12 17:22:07 Thanks for documenting the class and all the funct
48
49 } // namespace ash
50
51 #endif // ASH_TOUCH_HUD_TOUCH_HUD_RENDERER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698