| 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 "base/optional.h" | 16 #include "base/optional.h" |
| 17 #include "cc/ipc/display_compositor.mojom.h" |
| 17 #include "mojo/public/cpp/bindings/array.h" | 18 #include "mojo/public/cpp/bindings/array.h" |
| 18 #include "mojo/public/cpp/bindings/binding.h" | 19 #include "mojo/public/cpp/bindings/binding.h" |
| 19 #include "services/ui/public/interfaces/window_manager_window_tree_factory.mojom
.h" | 20 #include "services/ui/public/interfaces/window_manager_window_tree_factory.mojom
.h" |
| 20 #include "services/ui/public/interfaces/window_tree.mojom.h" | 21 #include "services/ui/public/interfaces/window_tree.mojom.h" |
| 21 #include "services/ui/surfaces/display_compositor.h" | 22 #include "services/ui/surfaces/display_compositor.h" |
| 22 #include "services/ui/surfaces/display_compositor_client.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/gpu_service_proxy_delegate.h" |
| 25 #include "services/ui/ws/ids.h" | 25 #include "services/ui/ws/ids.h" |
| 26 #include "services/ui/ws/operation.h" | 26 #include "services/ui/ws/operation.h" |
| 27 #include "services/ui/ws/server_window_delegate.h" | 27 #include "services/ui/ws/server_window_delegate.h" |
| 28 #include "services/ui/ws/server_window_observer.h" | 28 #include "services/ui/ws/server_window_observer.h" |
| 29 #include "services/ui/ws/user_display_manager_delegate.h" | 29 #include "services/ui/ws/user_display_manager_delegate.h" |
| 30 #include "services/ui/ws/user_id_tracker.h" | 30 #include "services/ui/ws/user_id_tracker.h" |
| 31 #include "services/ui/ws/user_id_tracker_observer.h" | 31 #include "services/ui/ws/user_id_tracker_observer.h" |
| 32 #include "services/ui/ws/window_manager_window_tree_factory_set.h" | 32 #include "services/ui/ws/window_manager_window_tree_factory_set.h" |
| (...skipping 11 matching lines...) Expand all Loading... |
| 44 class WindowTree; | 44 class WindowTree; |
| 45 class WindowTreeBinding; | 45 class WindowTreeBinding; |
| 46 | 46 |
| 47 // 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 |
| 48 // WindowTrees) as well as providing the root of the hierarchy. | 48 // WindowTrees) as well as providing the root of the hierarchy. |
| 49 class WindowServer : public ServerWindowDelegate, | 49 class WindowServer : public ServerWindowDelegate, |
| 50 public ServerWindowObserver, | 50 public ServerWindowObserver, |
| 51 public GpuServiceProxyDelegate, | 51 public GpuServiceProxyDelegate, |
| 52 public UserDisplayManagerDelegate, | 52 public UserDisplayManagerDelegate, |
| 53 public UserIdTrackerObserver, | 53 public UserIdTrackerObserver, |
| 54 public DisplayCompositorClient { | 54 public cc::mojom::DisplayCompositorClient { |
| 55 public: | 55 public: |
| 56 explicit WindowServer(WindowServerDelegate* delegate); | 56 explicit WindowServer(WindowServerDelegate* delegate); |
| 57 ~WindowServer() override; | 57 ~WindowServer() override; |
| 58 | 58 |
| 59 WindowServerDelegate* delegate() { return delegate_; } | 59 WindowServerDelegate* delegate() { return delegate_; } |
| 60 | 60 |
| 61 UserIdTracker* user_id_tracker() { return &user_id_tracker_; } | 61 UserIdTracker* user_id_tracker() { return &user_id_tracker_; } |
| 62 const UserIdTracker* user_id_tracker() const { return &user_id_tracker_; } | 62 const UserIdTracker* user_id_tracker() const { return &user_id_tracker_; } |
| 63 | 63 |
| 64 DisplayManager* display_manager() { return display_manager_.get(); } | 64 DisplayManager* display_manager() { return display_manager_.get(); } |
| (...skipping 267 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 332 const ui::TextInputState& state) override; | 332 const ui::TextInputState& state) override; |
| 333 void OnTransientWindowAdded(ServerWindow* window, | 333 void OnTransientWindowAdded(ServerWindow* window, |
| 334 ServerWindow* transient_child) override; | 334 ServerWindow* transient_child) override; |
| 335 void OnTransientWindowRemoved(ServerWindow* window, | 335 void OnTransientWindowRemoved(ServerWindow* window, |
| 336 ServerWindow* transient_child) override; | 336 ServerWindow* transient_child) override; |
| 337 | 337 |
| 338 // GpuServiceProxyDelegate: | 338 // GpuServiceProxyDelegate: |
| 339 void OnGpuChannelEstablished( | 339 void OnGpuChannelEstablished( |
| 340 scoped_refptr<gpu::GpuChannelHost> gpu_channel) override; | 340 scoped_refptr<gpu::GpuChannelHost> gpu_channel) override; |
| 341 | 341 |
| 342 // DisplayCompositorClient: | 342 // cc::mojom::DisplayCompositorClient: |
| 343 void OnSurfaceCreated(const cc::SurfaceId& surface_id, | 343 void OnSurfaceCreated(const cc::SurfaceId& surface_id, |
| 344 const gfx::Size& frame_size, | 344 const gfx::Size& frame_size, |
| 345 float device_scale_factor) override; | 345 float device_scale_factor) override; |
| 346 | 346 |
| 347 // UserIdTrackerObserver: | 347 // UserIdTrackerObserver: |
| 348 void OnActiveUserIdChanged(const UserId& previously_active_id, | 348 void OnActiveUserIdChanged(const UserId& previously_active_id, |
| 349 const UserId& active_id) override; | 349 const UserId& active_id) override; |
| 350 void OnUserIdAdded(const UserId& id) override; | 350 void OnUserIdAdded(const UserId& id) override; |
| 351 void OnUserIdRemoved(const UserId& id) override; | 351 void OnUserIdRemoved(const UserId& id) override; |
| 352 | 352 |
| 353 UserIdTracker user_id_tracker_; | 353 UserIdTracker user_id_tracker_; |
| 354 | 354 |
| 355 WindowServerDelegate* delegate_; | 355 WindowServerDelegate* delegate_; |
| 356 | 356 |
| 357 // State for rendering into a Surface. | |
| 358 scoped_refptr<ui::DisplayCompositor> display_compositor_; | |
| 359 | |
| 360 // ID to use for next WindowTree. | 357 // ID to use for next WindowTree. |
| 361 ClientSpecificId next_client_id_; | 358 ClientSpecificId next_client_id_; |
| 362 | 359 |
| 363 std::unique_ptr<DisplayManager> display_manager_; | 360 std::unique_ptr<DisplayManager> display_manager_; |
| 364 | 361 |
| 365 std::unique_ptr<CurrentDragLoopState> current_drag_loop_; | 362 std::unique_ptr<CurrentDragLoopState> current_drag_loop_; |
| 366 std::unique_ptr<CurrentMoveLoopState> current_move_loop_; | 363 std::unique_ptr<CurrentMoveLoopState> current_move_loop_; |
| 367 | 364 |
| 368 // Set of WindowTrees. | 365 // Set of WindowTrees. |
| 369 WindowTreeMap tree_map_; | 366 WindowTreeMap tree_map_; |
| (...skipping 13 matching lines...) Expand all Loading... |
| 383 uint32_t next_wm_change_id_; | 380 uint32_t next_wm_change_id_; |
| 384 | 381 |
| 385 std::unique_ptr<GpuServiceProxy> gpu_proxy_; | 382 std::unique_ptr<GpuServiceProxy> gpu_proxy_; |
| 386 scoped_refptr<gpu::GpuChannelHost> gpu_channel_; | 383 scoped_refptr<gpu::GpuChannelHost> gpu_channel_; |
| 387 base::Callback<void(ServerWindow*)> window_paint_callback_; | 384 base::Callback<void(ServerWindow*)> window_paint_callback_; |
| 388 | 385 |
| 389 UserActivityMonitorMap activity_monitor_map_; | 386 UserActivityMonitorMap activity_monitor_map_; |
| 390 | 387 |
| 391 WindowManagerWindowTreeFactorySet window_manager_window_tree_factory_set_; | 388 WindowManagerWindowTreeFactorySet window_manager_window_tree_factory_set_; |
| 392 | 389 |
| 390 mojo::Binding<cc::mojom::DisplayCompositorClient> |
| 391 display_compositor_client_binding_; |
| 392 // State for rendering into a Surface. |
| 393 scoped_refptr<ui::DisplayCompositor> display_compositor_; |
| 394 |
| 393 DISALLOW_COPY_AND_ASSIGN(WindowServer); | 395 DISALLOW_COPY_AND_ASSIGN(WindowServer); |
| 394 }; | 396 }; |
| 395 | 397 |
| 396 } // namespace ws | 398 } // namespace ws |
| 397 } // namespace ui | 399 } // namespace ui |
| 398 | 400 |
| 399 #endif // SERVICES_UI_WS_WINDOW_SERVER_H_ | 401 #endif // SERVICES_UI_WS_WINDOW_SERVER_H_ |
| OLD | NEW |