Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2346)

Unified Diff: ash/common/system/chromeos/palette/tools/laser_pointer_view.h

Issue 2239743004: Palette tool laser prototype. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@patch
Patch Set: Fixed patch set 4 errors. Created 4 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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..c67392706e7912d80365348eed0c486e79d8fbe0
--- /dev/null
+++ b/ash/common/system/chromeos/palette/tools/laser_pointer_view.h
@@ -0,0 +1,44 @@
+// 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"
jdufault 2016/08/19 01:02:09 needed?
sammiequon 2016/08/19 20:28:47 Done.
+#include "ui/gfx/geometry/point.h"
jdufault 2016/08/19 01:02:09 forward declare
sammiequon 2016/08/19 20:28:47 Done.
+#include "ui/views/view.h"
+#include "ui/views/widget/widget.h"
jdufault 2016/08/19 01:02:09 forward declare
sammiequon 2016/08/19 20:28:47 Done.
+
+namespace ash {
+
+// LaserPointerView displays the palette tool laser pointer. It draws the laser,
+// which consists of a point where the mouse cursor should be, as well as a
+// trail of lines to help users track.
+class LaserPointerView : public views::View {
+ public:
+ LaserPointerView(base::TimeDelta life_duration);
+ ~LaserPointerView() override;
+
+ void AddNewPoint(const gfx::Point& new_point);
+ void Stop();
+
+ private:
+ friend class LaserPointerModeTestApi;
+
+ // view::View:
+ void OnPaint(gfx::Canvas* canvas) override;
+
+ LaserPointerPoints laser_points_;
+ std::unique_ptr<views::Widget> widget_;
+
+ DISALLOW_COPY_AND_ASSIGN(LaserPointerView);
+};
+
+} // namespace ash
+
+#endif // ASH_COMMON_SYSTEM_CHROMEOS_PALETTE_TOOLS_LASER_POINTER_VIEW_H_

Powered by Google App Engine
This is Rietveld 408576698