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 ASH_COMMON_SYSTEM_CHROMEOS_PALETTE_TOOLS_LASER_POINTER_MODE_H_ | |
6 #define ASH_COMMON_SYSTEM_CHROMEOS_PALETTE_TOOLS_LASER_POINTER_MODE_H_ | |
7 | |
8 #include "ash/common/system/chromeos/palette/common_palette_tool.h" | |
9 #include "ash/common/system/chromeos/palette/tools/laser_pointer_points.h" | |
10 #include "ash/common/system/chromeos/palette/tools/laser_pointer_view.h" | |
11 #include "ui/views/pointer_watcher.h" | |
12 | |
13 namespace ash { | |
14 | |
15 // Controller for the laser pointer functionality. Enables/disables laser | |
16 // pointer as well as receives points and passes them off to be rendered. | |
jdufault
2016/08/12 19:57:58
This needs to use actual strings/labels. See https
sammiequon
2016/08/16 17:00:04
Done.
| |
17 class LaserPointerMode : public CommonPaletteTool, | |
18 public views::PointerWatcher { | |
19 public: | |
20 explicit LaserPointerMode(Delegate* delegate); | |
21 ~LaserPointerMode() override; | |
22 | |
23 private: | |
24 // Timer which will add a new stationary point when the mouse stops moving. | |
25 // This will remove points past a certain threshold. | |
26 std::unique_ptr<base::Timer> timer_; | |
27 base::Lock points_lock_; | |
jdufault
2016/08/12 19:57:58
Move all data members to the end of the class decl
sammiequon
2016/08/16 17:00:04
Done.
| |
28 int timer_repeat_count_ = 0; | |
29 | |
30 gfx::Point current_mouse_location_; | |
31 LaserPointerPoints laser_points_; | |
32 std::unique_ptr<LaserPointerView> laser_pointer_view_; | |
33 | |
34 // PaletteTool: | |
35 PaletteGroup GetGroup() const override; | |
36 PaletteToolId GetToolId() const override; | |
37 void OnEnable() override; | |
38 void OnDisable() override; | |
39 gfx::VectorIconId GetActiveTrayIcon() override; | |
40 | |
41 // CommonPaletteTool overrides. | |
jdufault
2016/08/12 19:57:58
CommonPaletteTool:
sammiequon
2016/08/16 17:00:04
Done.
| |
42 gfx::VectorIconId GetPaletteIconId() override; | |
43 // views::PointerWatcher: | |
jdufault
2016/08/12 19:57:58
Newline above
sammiequon
2016/08/16 17:00:04
Done.
| |
44 void OnPointerEventObserved(const ui::PointerEvent& event, | |
45 const gfx::Point& location_in_screen, | |
46 views::Widget* target) override; | |
47 | |
48 void InitializeTimer(); | |
49 void StartTimer(); | |
50 void StopTimer(); | |
51 // Timer callback which adds a point where the mouse was last seen. This takes | |
jdufault
2016/08/12 19:57:58
Newline above comment.
jdufault
2016/08/12 19:57:58
What about for the second sentence,
This allows
sammiequon
2016/08/16 17:00:04
Done.
sammiequon
2016/08/16 17:00:04
Done.
| |
52 // care of fading away the tail of the laser when the mouse is stationary. | |
53 void AddStationaryPoint(); | |
54 | |
55 DISALLOW_COPY_AND_ASSIGN(LaserPointerMode); | |
56 }; | |
57 | |
58 } // namespace ash | |
59 | |
60 #endif // ASH_COMMON_SYSTEM_CHROMEOS_PALETTE_TOOLS_LASER_POINTER_MODE_H_ | |
OLD | NEW |