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