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/ref_counted.h" | 10 #include "base/memory/ref_counted.h" |
(...skipping 13 matching lines...) Expand all Loading... | |
24 namespace ui { | 24 namespace ui { |
25 class Reflector; | 25 class Reflector; |
26 } | 26 } |
27 | 27 |
28 namespace ash { | 28 namespace ash { |
29 namespace test{ | 29 namespace test{ |
30 class MirrorWindowTestApi; | 30 class MirrorWindowTestApi; |
31 } | 31 } |
32 | 32 |
33 namespace internal { | 33 namespace internal { |
34 class CursorWindowController; | |
34 class DisplayInfo; | 35 class DisplayInfo; |
35 class CursorWindowDelegate; | |
36 | 36 |
37 // An object that copies the content of the primary root window to a | 37 // An object that copies the content of the primary root window to a |
38 // mirror window. This also draws a mouse cursor as the mouse cursor | 38 // mirror window. This also draws a mouse cursor as the mouse cursor |
39 // is typically drawn by the window system. | 39 // is typically drawn by the window system. |
40 class ASH_EXPORT MirrorWindowController : public aura::RootWindowObserver { | 40 class ASH_EXPORT MirrorWindowController : public aura::RootWindowObserver { |
41 public: | 41 public: |
42 MirrorWindowController(); | 42 MirrorWindowController(CursorWindowController* cursor_window_controller); |
43 virtual ~MirrorWindowController(); | 43 virtual ~MirrorWindowController(); |
44 | 44 |
45 // Updates the root window's bounds using |display_info|. | 45 // Updates the root window's bounds using |display_info|. |
46 // Creates the new root window if one doesn't exist. | 46 // Creates the new root window if one doesn't exist. |
47 void UpdateWindow(const DisplayInfo& display_info); | 47 void UpdateWindow(const DisplayInfo& display_info); |
48 | 48 |
49 // Same as above, but using existing display info | 49 // Same as above, but using existing display info |
50 // for the mirrored display. | 50 // for the mirrored display. |
51 void UpdateWindow(); | 51 void UpdateWindow(); |
52 | 52 |
53 // Close the mirror window. | 53 // Close the mirror window. |
54 void Close(); | 54 void Close(); |
55 | 55 |
56 // Updates the mirrored cursor location,shape and | |
57 // visibility. | |
58 void UpdateCursorLocation(); | |
59 void SetMirroredCursor(gfx::NativeCursor cursor); | |
60 void SetMirroredCursorVisibility(bool visible); | |
61 | |
62 // aura::RootWindowObserver overrides: | 56 // aura::RootWindowObserver overrides: |
63 virtual void OnWindowTreeHostResized(const aura::RootWindow* root) OVERRIDE; | 57 virtual void OnWindowTreeHostResized(const aura::RootWindow* root) OVERRIDE; |
64 | 58 |
59 // Returns the mirror root window. | |
60 aura::RootWindow* root_window() const { return root_window_.get(); } | |
61 | |
65 private: | 62 private: |
66 friend class test::MirrorWindowTestApi; | 63 friend class test::MirrorWindowTestApi; |
67 | 64 |
68 // Creates a RootWindowTransformer for current display | 65 // Creates a RootWindowTransformer for current display |
69 // configuration. | 66 // configuration. |
70 scoped_ptr<aura::RootWindowTransformer> CreateRootWindowTransformer() const; | 67 scoped_ptr<aura::RootWindowTransformer> CreateRootWindowTransformer() const; |
71 | 68 |
72 int current_cursor_type_; | 69 // Owned by display controller and outlives mirror window controller. |
73 gfx::Display::Rotation current_cursor_rotation_; | 70 CursorWindowController* cursor_window_controller_; |
oshima
2014/02/05 21:49:59
Can you simply access through DisplayController in
hshi1
2014/02/05 22:55:58
Done.
| |
74 aura::Window* cursor_window_; // owned by root window. | 71 |
75 scoped_ptr<aura::RootWindow> root_window_; | 72 scoped_ptr<aura::RootWindow> root_window_; |
76 scoped_ptr<CursorWindowDelegate> cursor_window_delegate_; | |
77 gfx::Point hot_point_; | |
78 gfx::Size mirror_window_host_size_; | 73 gfx::Size mirror_window_host_size_; |
79 scoped_refptr<ui::Reflector> reflector_; | 74 scoped_refptr<ui::Reflector> reflector_; |
80 | 75 |
81 DISALLOW_COPY_AND_ASSIGN(MirrorWindowController); | 76 DISALLOW_COPY_AND_ASSIGN(MirrorWindowController); |
82 }; | 77 }; |
83 | 78 |
84 } // namespace internal | 79 } // namespace internal |
85 } // namespace ash | 80 } // namespace ash |
86 | 81 |
87 #endif // ASH_DISPLAY_MIRROR_WINDOW_CONTROLLER_H_ | 82 #endif // ASH_DISPLAY_MIRROR_WINDOW_CONTROLLER_H_ |
OLD | NEW |