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_VIEW_H_ |
| 6 #define ASH_COMMON_SYSTEM_CHROMEOS_PALETTE_TOOLS_LASER_POINTER_VIEW_H_ |
| 7 |
| 8 #include <memory> |
| 9 |
| 10 #include "ash/common/system/chromeos/palette/tools/laser_pointer_points.h" |
| 11 #include "base/macros.h" |
| 12 #include "ui/views/view.h" |
| 13 |
| 14 namespace gfx { |
| 15 class Point; |
| 16 } |
| 17 |
| 18 namespace views { |
| 19 class Widget; |
| 20 } |
| 21 |
| 22 namespace ash { |
| 23 |
| 24 // LaserPointerView displays the palette tool laser pointer. It draws the laser, |
| 25 // which consists of a point where the mouse cursor should be, as well as a |
| 26 // trail of lines to help users track. |
| 27 class LaserPointerView : public views::View { |
| 28 public: |
| 29 explicit LaserPointerView(base::TimeDelta life_duration); |
| 30 ~LaserPointerView() override; |
| 31 |
| 32 void AddNewPoint(const gfx::Point& new_point); |
| 33 void Stop(); |
| 34 |
| 35 private: |
| 36 friend class LaserPointerModeTestApi; |
| 37 |
| 38 // view::View: |
| 39 void OnPaint(gfx::Canvas* canvas) override; |
| 40 |
| 41 LaserPointerPoints laser_points_; |
| 42 std::unique_ptr<views::Widget> widget_; |
| 43 |
| 44 DISALLOW_COPY_AND_ASSIGN(LaserPointerView); |
| 45 }; |
| 46 |
| 47 } // namespace ash |
| 48 |
| 49 #endif // ASH_COMMON_SYSTEM_CHROMEOS_PALETTE_TOOLS_LASER_POINTER_VIEW_H_ |
OLD | NEW |