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> |
11 #include <memory> | 11 #include <memory> |
12 #include <string> | 12 #include <string> |
13 #include <vector> | 13 #include <vector> |
14 | 14 |
15 #include "base/macros.h" | 15 #include "base/macros.h" |
16 #include "mojo/public/cpp/bindings/array.h" | 16 #include "mojo/public/cpp/bindings/array.h" |
17 #include "mojo/public/cpp/bindings/binding.h" | 17 #include "mojo/public/cpp/bindings/binding.h" |
18 #include "services/ui/clipboard/clipboard_impl.h" | 18 #include "services/ui/clipboard/clipboard_impl.h" |
19 #include "services/ui/public/interfaces/window_manager_window_tree_factory.mojom
.h" | 19 #include "services/ui/public/interfaces/window_manager_window_tree_factory.mojom
.h" |
20 #include "services/ui/public/interfaces/window_tree.mojom.h" | 20 #include "services/ui/public/interfaces/window_tree.mojom.h" |
21 #include "services/ui/public/interfaces/window_tree_host.mojom.h" | 21 #include "services/ui/public/interfaces/window_tree_host.mojom.h" |
22 #include "services/ui/surfaces/surfaces_state.h" | 22 #include "services/ui/surfaces/surfaces_state.h" |
23 #include "services/ui/ws/display.h" | 23 #include "services/ui/ws/display.h" |
| 24 #include "services/ui/ws/gpu_service_proxy_delegate.h" |
24 #include "services/ui/ws/ids.h" | 25 #include "services/ui/ws/ids.h" |
25 #include "services/ui/ws/operation.h" | 26 #include "services/ui/ws/operation.h" |
26 #include "services/ui/ws/server_window_delegate.h" | 27 #include "services/ui/ws/server_window_delegate.h" |
27 #include "services/ui/ws/server_window_observer.h" | 28 #include "services/ui/ws/server_window_observer.h" |
28 #include "services/ui/ws/user_display_manager_delegate.h" | 29 #include "services/ui/ws/user_display_manager_delegate.h" |
29 #include "services/ui/ws/user_id_tracker.h" | 30 #include "services/ui/ws/user_id_tracker.h" |
30 #include "services/ui/ws/user_id_tracker_observer.h" | 31 #include "services/ui/ws/user_id_tracker_observer.h" |
31 #include "services/ui/ws/window_manager_window_tree_factory_set.h" | 32 #include "services/ui/ws/window_manager_window_tree_factory_set.h" |
32 | 33 |
33 namespace ui { | 34 namespace ui { |
34 namespace ws { | 35 namespace ws { |
35 | 36 |
36 class AccessPolicy; | 37 class AccessPolicy; |
37 class DisplayManager; | 38 class DisplayManager; |
| 39 class GpuServiceProxy; |
38 class ServerWindow; | 40 class ServerWindow; |
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 // WindowServer manages the set of clients of the window server (all the | 47 // WindowServer manages the set of clients of the window server (all the |
46 // WindowTrees) as well as providing the root of the hierarchy. | 48 // WindowTrees) as well as providing the root of the hierarchy. |
47 class WindowServer : public ServerWindowDelegate, | 49 class WindowServer : public ServerWindowDelegate, |
48 public ServerWindowObserver, | 50 public ServerWindowObserver, |
| 51 public GpuServiceProxyDelegate, |
49 public UserDisplayManagerDelegate, | 52 public UserDisplayManagerDelegate, |
50 public UserIdTrackerObserver { | 53 public UserIdTrackerObserver { |
51 public: | 54 public: |
52 explicit WindowServer(WindowServerDelegate* delegate); | 55 explicit WindowServer(WindowServerDelegate* delegate); |
53 ~WindowServer() override; | 56 ~WindowServer() override; |
54 | 57 |
55 WindowServerDelegate* delegate() { return delegate_; } | 58 WindowServerDelegate* delegate() { return delegate_; } |
56 | 59 |
57 UserIdTracker* user_id_tracker() { return &user_id_tracker_; } | 60 UserIdTracker* user_id_tracker() { return &user_id_tracker_; } |
58 const UserIdTracker* user_id_tracker() const { return &user_id_tracker_; } | 61 const UserIdTracker* user_id_tracker() const { return &user_id_tracker_; } |
59 | 62 |
60 DisplayManager* display_manager() { return display_manager_.get(); } | 63 DisplayManager* display_manager() { return display_manager_.get(); } |
61 const DisplayManager* display_manager() const { | 64 const DisplayManager* display_manager() const { |
62 return display_manager_.get(); | 65 return display_manager_.get(); |
63 } | 66 } |
64 | 67 |
| 68 GpuServiceProxy* gpu_proxy() { return gpu_proxy_.get(); } |
| 69 |
65 // Creates a new ServerWindow. The return value is owned by the caller, but | 70 // Creates a new ServerWindow. The return value is owned by the caller, but |
66 // must be destroyed before WindowServer. | 71 // must be destroyed before WindowServer. |
67 ServerWindow* CreateServerWindow( | 72 ServerWindow* CreateServerWindow( |
68 const WindowId& id, | 73 const WindowId& id, |
69 const std::map<std::string, std::vector<uint8_t>>& properties); | 74 const std::map<std::string, std::vector<uint8_t>>& properties); |
70 | 75 |
71 // Returns the id for the next WindowTree. | 76 // Returns the id for the next WindowTree. |
72 ClientSpecificId GetAndAdvanceNextClientId(); | 77 ClientSpecificId GetAndAdvanceNextClientId(); |
73 | 78 |
74 // See description of WindowTree::Embed() for details. This assumes | 79 // See description of WindowTree::Embed() for details. This assumes |
(...skipping 237 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
312 int32_t cursor_id) override; | 317 int32_t cursor_id) override; |
313 void OnWindowNonClientCursorChanged(ServerWindow* window, | 318 void OnWindowNonClientCursorChanged(ServerWindow* window, |
314 int32_t cursor_id) override; | 319 int32_t cursor_id) override; |
315 void OnWindowTextInputStateChanged(ServerWindow* window, | 320 void OnWindowTextInputStateChanged(ServerWindow* window, |
316 const ui::TextInputState& state) override; | 321 const ui::TextInputState& state) override; |
317 void OnTransientWindowAdded(ServerWindow* window, | 322 void OnTransientWindowAdded(ServerWindow* window, |
318 ServerWindow* transient_child) override; | 323 ServerWindow* transient_child) override; |
319 void OnTransientWindowRemoved(ServerWindow* window, | 324 void OnTransientWindowRemoved(ServerWindow* window, |
320 ServerWindow* transient_child) override; | 325 ServerWindow* transient_child) override; |
321 | 326 |
| 327 // GpuServiceProxyDelegate: |
| 328 void OnGpuChannelEstablished( |
| 329 scoped_refptr<gpu::GpuChannelHost> gpu_channel) override; |
| 330 |
322 // UserIdTrackerObserver: | 331 // UserIdTrackerObserver: |
323 void OnActiveUserIdChanged(const UserId& previously_active_id, | 332 void OnActiveUserIdChanged(const UserId& previously_active_id, |
324 const UserId& active_id) override; | 333 const UserId& active_id) override; |
325 void OnUserIdAdded(const UserId& id) override; | 334 void OnUserIdAdded(const UserId& id) override; |
326 void OnUserIdRemoved(const UserId& id) override; | 335 void OnUserIdRemoved(const UserId& id) override; |
327 | 336 |
328 UserIdTracker user_id_tracker_; | 337 UserIdTracker user_id_tracker_; |
329 | 338 |
330 WindowServerDelegate* delegate_; | 339 WindowServerDelegate* delegate_; |
331 | 340 |
(...skipping 17 matching lines...) Expand all Loading... |
349 bool in_destructor_; | 358 bool in_destructor_; |
350 std::map<UserId, bool> high_contrast_mode_; | 359 std::map<UserId, bool> high_contrast_mode_; |
351 | 360 |
352 // Maps from window manager change id to the client that initiated the | 361 // Maps from window manager change id to the client that initiated the |
353 // request. | 362 // request. |
354 InFlightWindowManagerChangeMap in_flight_wm_change_map_; | 363 InFlightWindowManagerChangeMap in_flight_wm_change_map_; |
355 | 364 |
356 // Next id supplied to the window manager. | 365 // Next id supplied to the window manager. |
357 uint32_t next_wm_change_id_; | 366 uint32_t next_wm_change_id_; |
358 | 367 |
| 368 std::unique_ptr<GpuServiceProxy> gpu_proxy_; |
359 base::Callback<void(ServerWindow*)> window_paint_callback_; | 369 base::Callback<void(ServerWindow*)> window_paint_callback_; |
360 | 370 |
361 UserActivityMonitorMap activity_monitor_map_; | 371 UserActivityMonitorMap activity_monitor_map_; |
362 UserClipboardMap clipboard_map_; | 372 UserClipboardMap clipboard_map_; |
363 | 373 |
364 WindowManagerWindowTreeFactorySet window_manager_window_tree_factory_set_; | 374 WindowManagerWindowTreeFactorySet window_manager_window_tree_factory_set_; |
365 | 375 |
366 DISALLOW_COPY_AND_ASSIGN(WindowServer); | 376 DISALLOW_COPY_AND_ASSIGN(WindowServer); |
367 }; | 377 }; |
368 | 378 |
369 } // namespace ws | 379 } // namespace ws |
370 } // namespace ui | 380 } // namespace ui |
371 | 381 |
372 #endif // SERVICES_UI_WS_WINDOW_SERVER_H_ | 382 #endif // SERVICES_UI_WS_WINDOW_SERVER_H_ |
OLD | NEW |