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

Side by Side Diff: ash/laser/laser_pointer_view.h

Issue 2311393004: Laser tool blocks events from propagating. (Closed)
Patch Set: Created 4 years, 3 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 unified diff | Download patch
OLDNEW
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_COMMON_SYSTEM_CHROMEOS_PALETTE_TOOLS_LASER_POINTER_VIEW_H_ 5 #ifndef ASH_LASER_LASER_POINTER_VIEW_H_
6 #define ASH_COMMON_SYSTEM_CHROMEOS_PALETTE_TOOLS_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/common/system/chromeos/palette/tools/laser_pointer_points.h" 10 #include "ash/laser/laser_pointer_points.h"
11 #include "base/macros.h" 11 #include "base/macros.h"
12 #include "ui/views/view.h" 12 #include "ui/views/view.h"
13 13
14 namespace aura {
15 class Window;
16 }
17
14 namespace gfx { 18 namespace gfx {
15 class Point; 19 class Point;
16 } 20 }
17 21
18 namespace views { 22 namespace views {
19 class Widget; 23 class Widget;
20 } 24 }
21 25
22 namespace ash { 26 namespace ash {
23 27
24 // LaserPointerView displays the palette tool laser pointer. It draws the laser, 28 // 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 29 // which consists of a point where the mouse cursor should be, as well as a
26 // trail of lines to help users track. 30 // trail of lines to help users track.
27 class LaserPointerView : public views::View { 31 class LaserPointerView : public views::View {
28 public: 32 public:
29 explicit LaserPointerView(base::TimeDelta life_duration); 33 explicit LaserPointerView(base::TimeDelta life_duration,
34 aura::Window* root_window);
30 ~LaserPointerView() override; 35 ~LaserPointerView() override;
31 36
32 void AddNewPoint(const gfx::Point& new_point); 37 void AddNewPoint(const gfx::Point& new_point);
33 void Stop(); 38 void Stop();
39 aura::Window* GetRootWindow();
34 40
35 private: 41 private:
36 friend class LaserPointerModeTestApi; 42 friend class LaserPointerControllerTestApi;
37 43
38 // view::View: 44 // view::View:
39 void OnPaint(gfx::Canvas* canvas) override; 45 void OnPaint(gfx::Canvas* canvas) override;
40 46
41 LaserPointerPoints laser_points_; 47 LaserPointerPoints laser_points_;
42 std::unique_ptr<views::Widget> widget_; 48 std::unique_ptr<views::Widget> widget_;
43 49
44 DISALLOW_COPY_AND_ASSIGN(LaserPointerView); 50 DISALLOW_COPY_AND_ASSIGN(LaserPointerView);
45 }; 51 };
46
47 } // namespace ash 52 } // namespace ash
48 53
49 #endif // ASH_COMMON_SYSTEM_CHROMEOS_PALETTE_TOOLS_LASER_POINTER_VIEW_H_ 54 #endif // ASH_LASER_LASER_POINTER_VIEW_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698