| 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 10 matching lines...) Expand all Loading... |
| 21 class WindowServer; | 21 class WindowServer; |
| 22 | 22 |
| 23 // Owns the root window of a window manager for one display. Each window manager | 23 // Owns the root window of a window manager for one display. Each window manager |
| 24 // has one WindowManagerDisplayRoot for each Display. The root window is | 24 // has one WindowManagerDisplayRoot for each Display. The root window is |
| 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 |
| 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 |
| 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. |
| 31 ServerWindow* root() { return root_.get(); } | 36 ServerWindow* root() { return root_.get(); } |
| 32 const ServerWindow* root() const { return root_.get(); } | 37 const ServerWindow* root() const { return root_.get(); } |
| 33 | 38 |
| 39 // See root() for details of this. This returns null until the client creates |
| 40 // the root. |
| 41 ServerWindow* GetClientVisibileRoot() { |
| 42 return const_cast<ServerWindow*>( |
| 43 const_cast<const WindowManagerDisplayRoot*>(this) |
| 44 ->GetClientVisibileRoot()); |
| 45 } |
| 46 const ServerWindow* GetClientVisibileRoot() const; |
| 47 |
| 34 Display* display() { return display_; } | 48 Display* display() { return display_; } |
| 35 const Display* display() const { return display_; } | 49 const Display* display() const { return display_; } |
| 36 | 50 |
| 37 WindowManagerState* window_manager_state() { return window_manager_state_; } | 51 WindowManagerState* window_manager_state() { return window_manager_state_; } |
| 38 const WindowManagerState* window_manager_state() const { | 52 const WindowManagerState* window_manager_state() const { |
| 39 return window_manager_state_; | 53 return window_manager_state_; |
| 40 } | 54 } |
| 41 | 55 |
| 42 private: | 56 private: |
| 43 friend class Display; | 57 friend class Display; |
| 44 friend class WindowManagerState; | 58 friend class WindowManagerState; |
| 45 | 59 |
| 46 WindowServer* window_server(); | 60 WindowServer* window_server(); |
| 47 | 61 |
| 48 Display* display_; | 62 Display* display_; |
| 49 // Root ServerWindow of this WindowManagerDisplayRoot. |root_| has a parent, | 63 // Root ServerWindow of this WindowManagerDisplayRoot. |root_| has a parent, |
| 50 // the root ServerWindow of the Display. | 64 // the root ServerWindow of the Display. |
| 51 std::unique_ptr<ServerWindow> root_; | 65 std::unique_ptr<ServerWindow> root_; |
| 52 WindowManagerState* window_manager_state_ = nullptr; | 66 WindowManagerState* window_manager_state_ = nullptr; |
| 53 cc::LocalSurfaceIdAllocator allocator_; | 67 cc::LocalSurfaceIdAllocator allocator_; |
| 54 | 68 |
| 55 DISALLOW_COPY_AND_ASSIGN(WindowManagerDisplayRoot); | 69 DISALLOW_COPY_AND_ASSIGN(WindowManagerDisplayRoot); |
| 56 }; | 70 }; |
| 57 | 71 |
| 58 } // namespace ws | 72 } // namespace ws |
| 59 } // namespace ui | 73 } // namespace ui |
| 60 | 74 |
| 61 #endif // SERVICES_UI_WS_WINDOW_MANAGER_DISPLAY_ROOT_H_ | 75 #endif // SERVICES_UI_WS_WINDOW_MANAGER_DISPLAY_ROOT_H_ |
| OLD | NEW |