OLD | NEW |
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 SERVICES_UI_WS_WINDOW_MANAGER_DISPLAY_ROOT_H_ | 5 #ifndef SERVICES_UI_WS_WINDOW_MANAGER_DISPLAY_ROOT_H_ |
6 #define SERVICES_UI_WS_WINDOW_MANAGER_DISPLAY_ROOT_H_ | 6 #define SERVICES_UI_WS_WINDOW_MANAGER_DISPLAY_ROOT_H_ |
7 | 7 |
8 #include <stdint.h> | 8 #include <stdint.h> |
9 | 9 |
10 #include <memory> | 10 #include <memory> |
(...skipping 14 matching lines...) Expand all Loading... |
25 // parented to the root of a Display. | 25 // parented to the root of a Display. |
26 class WindowManagerDisplayRoot { | 26 class WindowManagerDisplayRoot { |
27 public: | 27 public: |
28 explicit WindowManagerDisplayRoot(Display* display); | 28 explicit WindowManagerDisplayRoot(Display* display); |
29 ~WindowManagerDisplayRoot(); | 29 ~WindowManagerDisplayRoot(); |
30 | 30 |
31 // NOTE: this window is not necessarily visible to the window manager. When | 31 // NOTE: this window is not necessarily visible to the window manager. When |
32 // the display roots are automatically created this root is visible to the | 32 // the display roots are automatically created this root is visible to the |
33 // window manager. When the display roots are not automatically created this | 33 // window manager. When the display roots are not automatically created this |
34 // root has a single child that is created by the client. Use | 34 // root has a single child that is created by the client. Use |
35 // GetClientVisibileRoot() to get the root that is visible to the client. | 35 // GetClientVisibleRoot() to get the root that is visible to the client. |
36 ServerWindow* root() { return root_.get(); } | 36 ServerWindow* root() { return root_.get(); } |
37 const ServerWindow* root() const { return root_.get(); } | 37 const ServerWindow* root() const { return root_.get(); } |
38 | 38 |
39 // See root() for details of this. This returns null until the client creates | 39 // See root() for details of this. This returns null until the client creates |
40 // the root. | 40 // the root. |
41 ServerWindow* GetClientVisibileRoot() { | 41 ServerWindow* GetClientVisibleRoot() { |
42 return const_cast<ServerWindow*>( | 42 return const_cast<ServerWindow*>( |
43 const_cast<const WindowManagerDisplayRoot*>(this) | 43 const_cast<const WindowManagerDisplayRoot*>(this) |
44 ->GetClientVisibileRoot()); | 44 ->GetClientVisibleRoot()); |
45 } | 45 } |
46 const ServerWindow* GetClientVisibileRoot() const; | 46 const ServerWindow* GetClientVisibleRoot() const; |
47 | 47 |
48 Display* display() { return display_; } | 48 Display* display() { return display_; } |
49 const Display* display() const { return display_; } | 49 const Display* display() const { return display_; } |
50 | 50 |
51 WindowManagerState* window_manager_state() { return window_manager_state_; } | 51 WindowManagerState* window_manager_state() { return window_manager_state_; } |
52 const WindowManagerState* window_manager_state() const { | 52 const WindowManagerState* window_manager_state() const { |
53 return window_manager_state_; | 53 return window_manager_state_; |
54 } | 54 } |
55 | 55 |
56 private: | 56 private: |
57 friend class Display; | 57 friend class Display; |
58 friend class WindowManagerState; | 58 friend class WindowManagerState; |
59 | 59 |
60 WindowServer* window_server(); | 60 WindowServer* window_server(); |
61 | 61 |
62 Display* display_; | 62 Display* display_; |
63 // Root ServerWindow of this WindowManagerDisplayRoot. |root_| has a parent, | 63 // Root ServerWindow of this WindowManagerDisplayRoot. |root_| has a parent, |
64 // the root ServerWindow of the Display. | 64 // the root ServerWindow of the Display. |
65 std::unique_ptr<ServerWindow> root_; | 65 std::unique_ptr<ServerWindow> root_; |
66 WindowManagerState* window_manager_state_ = nullptr; | 66 WindowManagerState* window_manager_state_ = nullptr; |
67 cc::LocalSurfaceIdAllocator allocator_; | 67 cc::LocalSurfaceIdAllocator allocator_; |
68 | 68 |
69 DISALLOW_COPY_AND_ASSIGN(WindowManagerDisplayRoot); | 69 DISALLOW_COPY_AND_ASSIGN(WindowManagerDisplayRoot); |
70 }; | 70 }; |
71 | 71 |
72 } // namespace ws | 72 } // namespace ws |
73 } // namespace ui | 73 } // namespace ui |
74 | 74 |
75 #endif // SERVICES_UI_WS_WINDOW_MANAGER_DISPLAY_ROOT_H_ | 75 #endif // SERVICES_UI_WS_WINDOW_MANAGER_DISPLAY_ROOT_H_ |
OLD | NEW |