| 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 16 matching lines...) Expand all Loading... |
| 27 | 27 |
| 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 UpdateTime(); |
| 37 void Stop(); | 38 void Stop(); |
| 39 |
| 38 aura::Window* GetRootWindow(); | 40 aura::Window* GetRootWindow(); |
| 39 | 41 |
| 40 // Reparents the widget if needed. | 42 // Reparents the widget if needed. |
| 41 void ReparentWidget(aura::Window* new_root_window); | 43 void ReparentWidget(aura::Window* new_root_window); |
| 42 | 44 |
| 43 private: | 45 private: |
| 44 friend class LaserPointerControllerTestApi; | 46 friend class LaserPointerControllerTestApi; |
| 45 | 47 |
| 46 // view::View: | 48 // view::View: |
| 47 void OnPaint(gfx::Canvas* canvas) override; | 49 void OnPaint(gfx::Canvas* canvas) override; |
| 48 | 50 |
| 51 void OnPointsUpdated(); |
| 52 |
| 49 LaserPointerPoints laser_points_; | 53 LaserPointerPoints laser_points_; |
| 50 std::unique_ptr<views::Widget> widget_; | 54 std::unique_ptr<views::Widget> widget_; |
| 51 | 55 |
| 52 DISALLOW_COPY_AND_ASSIGN(LaserPointerView); | 56 DISALLOW_COPY_AND_ASSIGN(LaserPointerView); |
| 53 }; | 57 }; |
| 54 | 58 |
| 55 } // namespace ash | 59 } // namespace ash |
| 56 | 60 |
| 57 #endif // ASH_LASER_LASER_POINTER_VIEW_H_ | 61 #endif // ASH_LASER_LASER_POINTER_VIEW_H_ |
| OLD | NEW |