OLD | NEW |
---|---|
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef ASH_LASER_LASER_POINTER_VIEW_H_ | 5 #ifndef ASH_LASER_LASER_POINTER_VIEW_H_ |
6 #define ASH_LASER_LASER_POINTER_VIEW_H_ | 6 #define ASH_LASER_LASER_POINTER_VIEW_H_ |
7 | 7 |
8 #include <memory> | 8 #include <memory> |
9 | 9 |
10 #include "ash/laser/laser_pointer_points.h" | 10 #include "ash/laser/laser_pointer_points.h" |
(...skipping 17 matching lines...) Expand all Loading... | |
28 // LaserPointerView displays the palette tool laser pointer. It draws the laser, | 28 // LaserPointerView displays the palette tool laser pointer. It draws the laser, |
29 // which consists of a point where the mouse cursor should be, as well as a | 29 // which consists of a point where the mouse cursor should be, as well as a |
30 // trail of lines to help users track. | 30 // trail of lines to help users track. |
31 class LaserPointerView : public views::View { | 31 class LaserPointerView : public views::View { |
32 public: | 32 public: |
33 LaserPointerView(base::TimeDelta life_duration, aura::Window* root_window); | 33 LaserPointerView(base::TimeDelta life_duration, aura::Window* root_window); |
34 ~LaserPointerView() override; | 34 ~LaserPointerView() override; |
35 | 35 |
36 void AddNewPoint(const gfx::Point& new_point); | 36 void AddNewPoint(const gfx::Point& new_point); |
37 void Stop(); | 37 void Stop(); |
38 void SetIsFadingAway(bool is_fading); | |
jdufault
2016/09/23 23:59:20
Rename to set_is_fading_away. Trival methods (like
sammiequon
2016/09/26 19:30:38
Done.
| |
39 bool GetIsFadingAway() const; | |
jdufault
2016/09/23 23:59:20
Rename to is_fading_away() and inline the definiti
sammiequon
2016/09/26 19:30:38
Done.
| |
40 | |
38 aura::Window* GetRootWindow(); | 41 aura::Window* GetRootWindow(); |
39 | 42 |
40 // Reparents the widget if needed. | 43 // Reparents the widget if needed. |
41 void ReparentWidget(aura::Window* new_root_window); | 44 void ReparentWidget(aura::Window* new_root_window); |
42 | 45 |
43 private: | 46 private: |
44 friend class LaserPointerControllerTestApi; | 47 friend class LaserPointerControllerTestApi; |
45 | 48 |
46 // view::View: | 49 // view::View: |
47 void OnPaint(gfx::Canvas* canvas) override; | 50 void OnPaint(gfx::Canvas* canvas) override; |
48 | 51 |
49 LaserPointerPoints laser_points_; | 52 LaserPointerPoints laser_points_; |
50 std::unique_ptr<views::Widget> widget_; | 53 std::unique_ptr<views::Widget> widget_; |
54 // |is_fading_away_| determines whether the laser pointer view should accept | |
55 // points normally, or just advance the |laser_points_| time so that current | |
56 // points start fading away. This should be set to true when the view is about | |
57 // to be destroyed, such as when the stylus is released. | |
58 bool is_fading_away_ = false; | |
51 | 59 |
52 DISALLOW_COPY_AND_ASSIGN(LaserPointerView); | 60 DISALLOW_COPY_AND_ASSIGN(LaserPointerView); |
53 }; | 61 }; |
54 | 62 |
55 } // namespace ash | 63 } // namespace ash |
56 | 64 |
57 #endif // ASH_LASER_LASER_POINTER_VIEW_H_ | 65 #endif // ASH_LASER_LASER_POINTER_VIEW_H_ |
OLD | NEW |