OLD | NEW |
---|---|
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 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_DISPLAY_MIRROR_WINDOW_CONTROLLER_H_ | 5 #ifndef ASH_DISPLAY_MIRROR_WINDOW_CONTROLLER_H_ |
6 #define ASH_DISPLAY_MIRROR_WINDOW_CONTROLLER_H_ | 6 #define ASH_DISPLAY_MIRROR_WINDOW_CONTROLLER_H_ |
7 | 7 |
8 #include "ash/ash_export.h" | 8 #include "ash/ash_export.h" |
9 #include "base/compiler_specific.h" | 9 #include "base/compiler_specific.h" |
10 #include "base/memory/scoped_ptr.h" | 10 #include "base/memory/scoped_ptr.h" |
11 #include "ui/aura/window_observer.h" | |
James Cook
2013/05/29 12:22:43
Do you need this here?
oshima
2013/05/29 15:39:49
Done.
| |
11 #include "ui/gfx/native_widget_types.h" | 12 #include "ui/gfx/native_widget_types.h" |
12 #include "ui/gfx/point.h" | 13 #include "ui/gfx/point.h" |
13 | 14 |
14 namespace aura { | 15 namespace aura { |
15 class RootWindow; | 16 class RootWindow; |
16 class Window; | 17 class Window; |
17 } | 18 } |
18 | 19 |
19 namespace ash { | 20 namespace ash { |
20 namespace test{ | 21 namespace test{ |
21 class MirrorWindowTestApi; | 22 class MirrorWindowTestApi; |
22 } | 23 } |
23 | 24 |
24 namespace internal { | 25 namespace internal { |
25 class DisplayInfo; | 26 class DisplayInfo; |
26 class CursorWindowDelegate; | 27 class CursorWindowDelegate; |
27 | 28 |
28 // An object that copies the content of the primary root window to a | 29 // An object that copies the content of the primary root window to a |
29 // mirror window. This also draws a mouse cursor as the mouse cursor | 30 // mirror window. This also draws a mouse cursor as the mouse cursor |
30 // is typically drawn by the window system. | 31 // is typically drawn by the window system. |
31 class MirrorWindowController { | 32 class MirrorWindowController { |
32 public: | 33 public: |
33 MirrorWindowController(); | 34 MirrorWindowController(); |
34 ~MirrorWindowController(); | 35 ~MirrorWindowController(); |
35 | 36 |
36 // Updates the root window's bounds using |display_info|. | 37 // Updates the root window's bounds using |display_info|. |
37 // Creates the new root window if one doesn't exist. | 38 // Creates the new root window if one doesn't exist. |
38 void UpdateWindow(const DisplayInfo& display_info); | 39 void UpdateWindow(const DisplayInfo& display_info); |
39 | 40 |
41 // Same as above, but using existing display info | |
42 // for the mirrored display. | |
43 void UpdateWindow(); | |
44 | |
45 // Close the mirror window. | |
40 void Close(); | 46 void Close(); |
41 | 47 |
42 // Updates the mirrored cursor location,shape and | 48 // Updates the mirrored cursor location,shape and |
43 // visibility. | 49 // visibility. |
44 void UpdateCursorLocation(); | 50 void UpdateCursorLocation(); |
45 void SetMirroredCursor(gfx::NativeCursor cursor); | 51 void SetMirroredCursor(gfx::NativeCursor cursor); |
46 void SetMirroredCursorVisibility(bool visible); | 52 void SetMirroredCursorVisibility(bool visible); |
47 | 53 |
48 private: | 54 private: |
49 friend class test::MirrorWindowTestApi; | 55 friend class test::MirrorWindowTestApi; |
50 | 56 |
51 int current_cursor_type_; | 57 int current_cursor_type_; |
52 aura::Window* cursor_window_; // owned by root window. | 58 aura::Window* cursor_window_; // owned by root window. |
53 scoped_ptr<aura::RootWindow> root_window_; | 59 scoped_ptr<aura::RootWindow> root_window_; |
54 scoped_ptr<CursorWindowDelegate> cursor_window_delegate_; | 60 scoped_ptr<CursorWindowDelegate> cursor_window_delegate_; |
55 gfx::Point hot_point_; | 61 gfx::Point hot_point_; |
56 | 62 |
57 DISALLOW_COPY_AND_ASSIGN(MirrorWindowController); | 63 DISALLOW_COPY_AND_ASSIGN(MirrorWindowController); |
58 }; | 64 }; |
59 | 65 |
60 } // namespace internal | 66 } // namespace internal |
61 } // namespace ash | 67 } // namespace ash |
62 | 68 |
63 #endif // ASH_DISPLAY_MIRROR_WINDOW_CONTROLLER_H_ | 69 #endif // ASH_DISPLAY_MIRROR_WINDOW_CONTROLLER_H_ |
OLD | NEW |