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

Side by Side Diff: ash/common/system/chromeos/palette/tools/laser_pointer_mode.h

Issue 2239743004: Palette tool laser prototype. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@patch
Patch Set: Fixed patch set 2 errors and removed patch dependency. Created 4 years, 4 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_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_view.h"
10 #include "base/threading/thread_checker.h"
11 #include "ui/views/pointer_watcher.h"
12
13 namespace ash {
14
15 class LaserPointerModeTestApi;
jdufault 2016/08/16 19:33:55 Newline below this. Please also verify this is nee
sammiequon 2016/08/16 23:18:54 Done.
16 // Controller for the laser pointer functionality. Enables/disables laser
17 // pointer as well as receives points and passes them off to be rendered.
18 class LaserPointerMode : public CommonPaletteTool,
19 public views::PointerWatcher {
20 friend class LaserPointerModeTestApi;
jdufault 2016/08/16 19:33:55 Move friend class decl to right below private:
sammiequon 2016/08/16 23:18:54 Done.
21
22 public:
23 explicit LaserPointerMode(Delegate* delegate);
24 ~LaserPointerMode() override;
25
26 private:
27 // PaletteTool:
28 PaletteGroup GetGroup() const override;
29 PaletteToolId GetToolId() const override;
30 void OnEnable() override;
31 void OnDisable() override;
32 gfx::VectorIconId GetActiveTrayIcon() override;
33 views::View* CreateView() override;
34
35 // CommonPaletteTool:
36 gfx::VectorIconId GetPaletteIconId() override;
37
38 // views::PointerWatcher:
39 void OnPointerEventObserved(const ui::PointerEvent& event,
40 const gfx::Point& location_in_screen,
41 views::Widget* target) override;
42
43 void StopTimer();
44
45 // Timer callback which adds a point where the mouse was last seen. This
46 // allows the trail to fade away when the mouse is stationary.
47 void AddStationaryPoint();
48
49 // Timer which will add a new stationary point when the mouse stops moving.
50 // This will remove points past a certain threshold.
51 std::unique_ptr<base::Timer> timer_;
52 base::ThreadChecker thread_checker_;
jdufault 2016/08/16 19:33:55 I'd move the thread_checker_ decl somewhere else s
sammiequon 2016/08/16 23:18:54 Done.
53 mutable int timer_repeat_count_ = 0;
jdufault 2016/08/16 19:33:55 Remove mutable since this should only be accessed
sammiequon 2016/08/16 23:18:54 Done.
54
55 gfx::Point current_mouse_location_;
56 std::unique_ptr<LaserPointerView> laser_pointer_view_;
57
58 DISALLOW_COPY_AND_ASSIGN(LaserPointerMode);
59 };
60
61 } // namespace ash
62
63 #endif // ASH_COMMON_SYSTEM_CHROMEOS_PALETTE_TOOLS_LASER_POINTER_MODE_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698