| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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_SERVER_H_ | 5 #ifndef SERVICES_UI_WS_WINDOW_SERVER_H_ |
| 6 #define SERVICES_UI_WS_WINDOW_SERVER_H_ | 6 #define SERVICES_UI_WS_WINDOW_SERVER_H_ |
| 7 | 7 |
| 8 #include <stdint.h> | 8 #include <stdint.h> |
| 9 | 9 |
| 10 #include <map> | 10 #include <map> |
| (...skipping 11 matching lines...) Expand all Loading... |
| 22 #include "services/ui/ws/ids.h" | 22 #include "services/ui/ws/ids.h" |
| 23 #include "services/ui/ws/operation.h" | 23 #include "services/ui/ws/operation.h" |
| 24 #include "services/ui/ws/server_window_delegate.h" | 24 #include "services/ui/ws/server_window_delegate.h" |
| 25 #include "services/ui/ws/server_window_observer.h" | 25 #include "services/ui/ws/server_window_observer.h" |
| 26 #include "services/ui/ws/user_display_manager_delegate.h" | 26 #include "services/ui/ws/user_display_manager_delegate.h" |
| 27 #include "services/ui/ws/user_id_tracker.h" | 27 #include "services/ui/ws/user_id_tracker.h" |
| 28 #include "services/ui/ws/user_id_tracker_observer.h" | 28 #include "services/ui/ws/user_id_tracker_observer.h" |
| 29 #include "services/ui/ws/window_manager_window_tree_factory_set.h" | 29 #include "services/ui/ws/window_manager_window_tree_factory_set.h" |
| 30 | 30 |
| 31 namespace ui { | 31 namespace ui { |
| 32 |
| 32 namespace ws { | 33 namespace ws { |
| 33 | 34 |
| 34 class AccessPolicy; | 35 class AccessPolicy; |
| 35 class Display; | 36 class Display; |
| 36 class DisplayManager; | 37 class DisplayManager; |
| 37 class GpuHost; | 38 class GpuHost; |
| 38 class ServerWindow; | 39 class ServerWindow; |
| 40 class ThreadedImageCursorsFactory; |
| 39 class UserActivityMonitor; | 41 class UserActivityMonitor; |
| 40 class WindowManagerState; | 42 class WindowManagerState; |
| 41 class WindowServerDelegate; | 43 class WindowServerDelegate; |
| 42 class WindowTree; | 44 class WindowTree; |
| 43 class WindowTreeBinding; | 45 class WindowTreeBinding; |
| 44 | 46 |
| 45 enum class DisplayCreationConfig; | 47 enum class DisplayCreationConfig; |
| 46 | 48 |
| 47 // WindowServer manages the set of clients of the window server (all the | 49 // WindowServer manages the set of clients of the window server (all the |
| 48 // WindowTrees) as well as providing the root of the hierarchy. | 50 // WindowTrees) as well as providing the root of the hierarchy. |
| 49 class WindowServer : public ServerWindowDelegate, | 51 class WindowServer : public ServerWindowDelegate, |
| 50 public ServerWindowObserver, | 52 public ServerWindowObserver, |
| 51 public GpuHostDelegate, | 53 public GpuHostDelegate, |
| 52 public UserDisplayManagerDelegate, | 54 public UserDisplayManagerDelegate, |
| 53 public UserIdTrackerObserver, | 55 public UserIdTrackerObserver, |
| 54 public cc::mojom::FrameSinkManagerClient { | 56 public cc::mojom::FrameSinkManagerClient { |
| 55 public: | 57 public: |
| 56 explicit WindowServer(WindowServerDelegate* delegate); | 58 WindowServer(WindowServerDelegate* delegate); |
| 57 ~WindowServer() override; | 59 ~WindowServer() override; |
| 58 | 60 |
| 59 WindowServerDelegate* delegate() { return delegate_; } | 61 WindowServerDelegate* delegate() { return delegate_; } |
| 60 | 62 |
| 61 UserIdTracker* user_id_tracker() { return &user_id_tracker_; } | 63 UserIdTracker* user_id_tracker() { return &user_id_tracker_; } |
| 62 const UserIdTracker* user_id_tracker() const { return &user_id_tracker_; } | 64 const UserIdTracker* user_id_tracker() const { return &user_id_tracker_; } |
| 63 | 65 |
| 64 DisplayManager* display_manager() { return display_manager_.get(); } | 66 DisplayManager* display_manager() { return display_manager_.get(); } |
| 65 const DisplayManager* display_manager() const { | 67 const DisplayManager* display_manager() const { |
| 66 return display_manager_.get(); | 68 return display_manager_.get(); |
| 67 } | 69 } |
| 68 | 70 |
| 69 GpuHost* gpu_host() { return gpu_host_.get(); } | 71 GpuHost* gpu_host() { return gpu_host_.get(); } |
| 70 | 72 |
| 71 void SetDisplayCreationConfig(DisplayCreationConfig config); | 73 void SetDisplayCreationConfig(DisplayCreationConfig config); |
| 72 DisplayCreationConfig display_creation_config() const { | 74 DisplayCreationConfig display_creation_config() const { |
| 73 return display_creation_config_; | 75 return display_creation_config_; |
| 74 } | 76 } |
| 75 | 77 |
| 76 // Pass the FrameSinkManager to WindowServer. This is needed because | 78 // Pass the FrameSinkManager to WindowServer. This is needed because |
| 77 // FrameSinkManagerClientBinding (the FrameSinkManager implementation being | 79 // FrameSinkManagerClientBinding (the FrameSinkManager implementation being |
| 78 // used) requires WindowServer's GpuHost to create. | 80 // used) requires WindowServer's GpuHost to create. |
| 79 void SetFrameSinkManager( | 81 void SetFrameSinkManager( |
| 80 std::unique_ptr<cc::mojom::FrameSinkManager> frame_sink_manager); | 82 std::unique_ptr<cc::mojom::FrameSinkManager> frame_sink_manager); |
| 81 | 83 |
| 82 void SetGpuHost(std::unique_ptr<GpuHost> gpu_host); | 84 void SetGpuHost(std::unique_ptr<GpuHost> gpu_host); |
| 83 | 85 |
| 86 ThreadedImageCursorsFactory* GetThreadedImageCursorsFactory(); |
| 87 |
| 84 // Creates a new ServerWindow. The return value is owned by the caller, but | 88 // Creates a new ServerWindow. The return value is owned by the caller, but |
| 85 // must be destroyed before WindowServer. | 89 // must be destroyed before WindowServer. |
| 86 ServerWindow* CreateServerWindow( | 90 ServerWindow* CreateServerWindow( |
| 87 const WindowId& id, | 91 const WindowId& id, |
| 88 const std::map<std::string, std::vector<uint8_t>>& properties); | 92 const std::map<std::string, std::vector<uint8_t>>& properties); |
| 89 | 93 |
| 90 // Returns the id for the next WindowTree. | 94 // Returns the id for the next WindowTree. |
| 91 ClientSpecificId GetAndAdvanceNextClientId(); | 95 ClientSpecificId GetAndAdvanceNextClientId(); |
| 92 | 96 |
| 93 // See description of WindowTree::Embed() for details. This assumes | 97 // See description of WindowTree::Embed() for details. This assumes |
| (...skipping 316 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 410 | 414 |
| 411 DisplayCreationConfig display_creation_config_; | 415 DisplayCreationConfig display_creation_config_; |
| 412 | 416 |
| 413 DISALLOW_COPY_AND_ASSIGN(WindowServer); | 417 DISALLOW_COPY_AND_ASSIGN(WindowServer); |
| 414 }; | 418 }; |
| 415 | 419 |
| 416 } // namespace ws | 420 } // namespace ws |
| 417 } // namespace ui | 421 } // namespace ui |
| 418 | 422 |
| 419 #endif // SERVICES_UI_WS_WINDOW_SERVER_H_ | 423 #endif // SERVICES_UI_WS_WINDOW_SERVER_H_ |
| OLD | NEW |