Chromium Code Reviews| Index: ash/common/system/chromeos/palette/tools/laser_pointer_view.h |
| diff --git a/ash/common/system/chromeos/palette/tools/laser_pointer_view.h b/ash/common/system/chromeos/palette/tools/laser_pointer_view.h |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..ab4fe111c82d4001549840142778e5e85d6978fc |
| --- /dev/null |
| +++ b/ash/common/system/chromeos/palette/tools/laser_pointer_view.h |
| @@ -0,0 +1,43 @@ |
| +// Copyright 2016 The Chromium Authors. All rights reserved. |
| +// Use of this source code is governed by a BSD-style license that can be |
| +// found in the LICENSE file. |
| + |
| +#ifndef ASH_COMMON_SYSTEM_CHROMEOS_PALETTE_TOOLS_LASER_POINTER_VIEW_H_ |
| +#define ASH_COMMON_SYSTEM_CHROMEOS_PALETTE_TOOLS_LASER_POINTER_VIEW_H_ |
| + |
| +#include <memory> |
| + |
| +#include "ash/common/system/chromeos/palette/tools/laser_pointer_points.h" |
| +#include "base/macros.h" |
| +#include "ui/events/event.h" |
| +#include "ui/gfx/animation/linear_animation.h" |
|
jdufault
2016/08/12 19:58:00
Cleanup includes
sammiequon
2016/08/16 17:00:06
Done.
|
| +#include "ui/gfx/geometry/point.h" |
| +#include "ui/views/view.h" |
| +#include "ui/views/widget/widget.h" |
| + |
| +namespace ash { |
| + |
| +// LaserPointerView displays the palette tool laser pointer. It draws the laser |
| +// as a point which replaces the mouse cursor, as well as a trail of lines to |
| +// help users with tracking the laser. |
|
jdufault
2016/08/12 19:58:00
What about "... to help users track the laser."?
sammiequon
2016/08/16 17:00:06
Done.
|
| +class LaserPointerView : public views::View { |
| + public: |
| + LaserPointerView(); |
| + ~LaserPointerView() override; |
| + |
| + void SetNewPoints(const LaserPointerPoints& laser_points); |
| + void Stop(); |
| + |
| + private: |
| + // view::View overrides; |
|
jdufault
2016/08/12 19:58:00
// view::View:
sammiequon
2016/08/16 17:00:06
Done.
|
| + void OnPaint(gfx::Canvas* canvas) override; |
| + |
| + LaserPointerPoints laser_points_; |
|
jdufault
2016/08/12 19:58:00
Instead of constantly copying points, what about u
sammiequon
2016/08/16 17:00:06
Done.
|
| + std::unique_ptr<views::Widget> widget_; |
| + |
| + DISALLOW_COPY_AND_ASSIGN(LaserPointerView); |
| +}; |
| + |
| +} // namespace ash |
| + |
| +#endif // ASH_COMMON_SYSTEM_CHROMEOS_PALETTE_TOOLS_LASER_POINTER_VIEW_H_ |