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 |
| 33 class ImageCursors; |
| 34 |
32 namespace ws { | 35 namespace ws { |
33 | 36 |
34 class AccessPolicy; | 37 class AccessPolicy; |
35 class Display; | 38 class Display; |
36 class DisplayManager; | 39 class DisplayManager; |
37 class GpuHost; | 40 class GpuHost; |
38 class ServerWindow; | 41 class ServerWindow; |
39 class UserActivityMonitor; | 42 class UserActivityMonitor; |
40 class WindowManagerState; | 43 class WindowManagerState; |
41 class WindowServerDelegate; | 44 class WindowServerDelegate; |
42 class WindowTree; | 45 class WindowTree; |
43 class WindowTreeBinding; | 46 class WindowTreeBinding; |
44 | 47 |
45 enum class DisplayCreationConfig; | 48 enum class DisplayCreationConfig; |
46 | 49 |
47 // WindowServer manages the set of clients of the window server (all the | 50 // WindowServer manages the set of clients of the window server (all the |
48 // WindowTrees) as well as providing the root of the hierarchy. | 51 // WindowTrees) as well as providing the root of the hierarchy. |
49 class WindowServer : public ServerWindowDelegate, | 52 class WindowServer : public ServerWindowDelegate, |
50 public ServerWindowObserver, | 53 public ServerWindowObserver, |
51 public GpuHostDelegate, | 54 public GpuHostDelegate, |
52 public UserDisplayManagerDelegate, | 55 public UserDisplayManagerDelegate, |
53 public UserIdTrackerObserver, | 56 public UserIdTrackerObserver, |
54 public cc::mojom::FrameSinkManagerClient { | 57 public cc::mojom::FrameSinkManagerClient { |
55 public: | 58 public: |
56 explicit WindowServer(WindowServerDelegate* delegate); | 59 WindowServer(WindowServerDelegate* delegate); |
57 ~WindowServer() override; | 60 ~WindowServer() override; |
58 | 61 |
59 WindowServerDelegate* delegate() { return delegate_; } | 62 WindowServerDelegate* delegate() { return delegate_; } |
60 | 63 |
61 UserIdTracker* user_id_tracker() { return &user_id_tracker_; } | 64 UserIdTracker* user_id_tracker() { return &user_id_tracker_; } |
62 const UserIdTracker* user_id_tracker() const { return &user_id_tracker_; } | 65 const UserIdTracker* user_id_tracker() const { return &user_id_tracker_; } |
63 | 66 |
64 DisplayManager* display_manager() { return display_manager_.get(); } | 67 DisplayManager* display_manager() { return display_manager_.get(); } |
65 const DisplayManager* display_manager() const { | 68 const DisplayManager* display_manager() const { |
66 return display_manager_.get(); | 69 return display_manager_.get(); |
67 } | 70 } |
68 | 71 |
69 GpuHost* gpu_host() { return gpu_host_.get(); } | 72 GpuHost* gpu_host() { return gpu_host_.get(); } |
70 | 73 |
71 void SetDisplayCreationConfig(DisplayCreationConfig config); | 74 void SetDisplayCreationConfig(DisplayCreationConfig config); |
72 DisplayCreationConfig display_creation_config() const { | 75 DisplayCreationConfig display_creation_config() const { |
73 return display_creation_config_; | 76 return display_creation_config_; |
74 } | 77 } |
75 | 78 |
76 // Pass the FrameSinkManager to WindowServer. This is needed because | 79 // Pass the FrameSinkManager to WindowServer. This is needed because |
77 // FrameSinkManagerClientBinding (the FrameSinkManager implementation being | 80 // FrameSinkManagerClientBinding (the FrameSinkManager implementation being |
78 // used) requires WindowServer's GpuHost to create. | 81 // used) requires WindowServer's GpuHost to create. |
79 void SetFrameSinkManager( | 82 void SetFrameSinkManager( |
80 std::unique_ptr<cc::mojom::FrameSinkManager> frame_sink_manager); | 83 std::unique_ptr<cc::mojom::FrameSinkManager> frame_sink_manager); |
81 | 84 |
82 void SetGpuHost(std::unique_ptr<GpuHost> gpu_host); | 85 void SetGpuHost(std::unique_ptr<GpuHost> gpu_host); |
83 | 86 |
| 87 // Returns a valid task runner which can be used to load resources. |
| 88 scoped_refptr<base::SingleThreadTaskRunner>& GetResourceRunner(); |
| 89 |
| 90 // The returned weak pointer can be used to manipulate the cursor, and should |
| 91 // only be dereferenced on the task runner returned by GetResourceRunner(). |
| 92 base::WeakPtr<ui::ImageCursors> GetImageCursorsWeakPtr(); |
| 93 |
84 // Creates a new ServerWindow. The return value is owned by the caller, but | 94 // Creates a new ServerWindow. The return value is owned by the caller, but |
85 // must be destroyed before WindowServer. | 95 // must be destroyed before WindowServer. |
86 ServerWindow* CreateServerWindow( | 96 ServerWindow* CreateServerWindow( |
87 const WindowId& id, | 97 const WindowId& id, |
88 const std::map<std::string, std::vector<uint8_t>>& properties); | 98 const std::map<std::string, std::vector<uint8_t>>& properties); |
89 | 99 |
90 // Returns the id for the next WindowTree. | 100 // Returns the id for the next WindowTree. |
91 ClientSpecificId GetAndAdvanceNextClientId(); | 101 ClientSpecificId GetAndAdvanceNextClientId(); |
92 | 102 |
93 // See description of WindowTree::Embed() for details. This assumes | 103 // See description of WindowTree::Embed() for details. This assumes |
(...skipping 315 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
409 | 419 |
410 DisplayCreationConfig display_creation_config_; | 420 DisplayCreationConfig display_creation_config_; |
411 | 421 |
412 DISALLOW_COPY_AND_ASSIGN(WindowServer); | 422 DISALLOW_COPY_AND_ASSIGN(WindowServer); |
413 }; | 423 }; |
414 | 424 |
415 } // namespace ws | 425 } // namespace ws |
416 } // namespace ui | 426 } // namespace ui |
417 | 427 |
418 #endif // SERVICES_UI_WS_WINDOW_SERVER_H_ | 428 #endif // SERVICES_UI_WS_WINDOW_SERVER_H_ |
OLD | NEW |