| 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 "mojo/public/cpp/bindings/array.h" | 17 #include "mojo/public/cpp/bindings/array.h" |
| 18 #include "mojo/public/cpp/bindings/binding.h" | 18 #include "mojo/public/cpp/bindings/binding.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/display_compositor.h" | 22 #include "services/ui/surfaces/display_compositor.h" |
| 23 #include "services/ui/surfaces/display_compositor_client.h" |
| 23 #include "services/ui/ws/display.h" | 24 #include "services/ui/ws/display.h" |
| 24 #include "services/ui/ws/gpu_service_proxy_delegate.h" | 25 #include "services/ui/ws/gpu_service_proxy_delegate.h" |
| 25 #include "services/ui/ws/ids.h" | 26 #include "services/ui/ws/ids.h" |
| 26 #include "services/ui/ws/operation.h" | 27 #include "services/ui/ws/operation.h" |
| 27 #include "services/ui/ws/server_window_delegate.h" | 28 #include "services/ui/ws/server_window_delegate.h" |
| 28 #include "services/ui/ws/server_window_observer.h" | 29 #include "services/ui/ws/server_window_observer.h" |
| 29 #include "services/ui/ws/user_display_manager_delegate.h" | 30 #include "services/ui/ws/user_display_manager_delegate.h" |
| 30 #include "services/ui/ws/user_id_tracker.h" | 31 #include "services/ui/ws/user_id_tracker.h" |
| 31 #include "services/ui/ws/user_id_tracker_observer.h" | 32 #include "services/ui/ws/user_id_tracker_observer.h" |
| 32 #include "services/ui/ws/window_manager_window_tree_factory_set.h" | 33 #include "services/ui/ws/window_manager_window_tree_factory_set.h" |
| (...skipping 10 matching lines...) Expand all Loading... |
| 43 class WindowServerDelegate; | 44 class WindowServerDelegate; |
| 44 class WindowTree; | 45 class WindowTree; |
| 45 class WindowTreeBinding; | 46 class WindowTreeBinding; |
| 46 | 47 |
| 47 // WindowServer manages the set of clients of the window server (all the | 48 // WindowServer manages the set of clients of the window server (all the |
| 48 // WindowTrees) as well as providing the root of the hierarchy. | 49 // WindowTrees) as well as providing the root of the hierarchy. |
| 49 class WindowServer : public ServerWindowDelegate, | 50 class WindowServer : public ServerWindowDelegate, |
| 50 public ServerWindowObserver, | 51 public ServerWindowObserver, |
| 51 public GpuServiceProxyDelegate, | 52 public GpuServiceProxyDelegate, |
| 52 public UserDisplayManagerDelegate, | 53 public UserDisplayManagerDelegate, |
| 53 public UserIdTrackerObserver { | 54 public UserIdTrackerObserver, |
| 55 public DisplayCompositorClient { |
| 54 public: | 56 public: |
| 55 explicit WindowServer(WindowServerDelegate* delegate); | 57 explicit WindowServer(WindowServerDelegate* delegate); |
| 56 ~WindowServer() override; | 58 ~WindowServer() override; |
| 57 | 59 |
| 58 WindowServerDelegate* delegate() { return delegate_; } | 60 WindowServerDelegate* delegate() { return delegate_; } |
| 59 | 61 |
| 60 UserIdTracker* user_id_tracker() { return &user_id_tracker_; } | 62 UserIdTracker* user_id_tracker() { return &user_id_tracker_; } |
| 61 const UserIdTracker* user_id_tracker() const { return &user_id_tracker_; } | 63 const UserIdTracker* user_id_tracker() const { return &user_id_tracker_; } |
| 62 | 64 |
| 63 DisplayManager* display_manager() { return display_manager_.get(); } | 65 DisplayManager* display_manager() { return display_manager_.get(); } |
| (...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 187 const ServerWindow* old_parent); | 189 const ServerWindow* old_parent); |
| 188 void ProcessWindowHierarchyChanged(const ServerWindow* window, | 190 void ProcessWindowHierarchyChanged(const ServerWindow* window, |
| 189 const ServerWindow* new_parent, | 191 const ServerWindow* new_parent, |
| 190 const ServerWindow* old_parent); | 192 const ServerWindow* old_parent); |
| 191 void ProcessWindowReorder(const ServerWindow* window, | 193 void ProcessWindowReorder(const ServerWindow* window, |
| 192 const ServerWindow* relative_window, | 194 const ServerWindow* relative_window, |
| 193 const mojom::OrderDirection direction); | 195 const mojom::OrderDirection direction); |
| 194 void ProcessWindowDeleted(ServerWindow* window); | 196 void ProcessWindowDeleted(ServerWindow* window); |
| 195 void ProcessWillChangeWindowPredefinedCursor(ServerWindow* window, | 197 void ProcessWillChangeWindowPredefinedCursor(ServerWindow* window, |
| 196 mojom::Cursor cursor_id); | 198 mojom::Cursor cursor_id); |
| 199 void ProcessWindowSurfaceCreated(ServerWindow* window, |
| 200 mojom::SurfaceType surface_type, |
| 201 const cc::SurfaceId& surface_id, |
| 202 const gfx::Size& frame_size, |
| 203 float device_scale_factor); |
| 197 | 204 |
| 198 // Sends an |event| to all WindowTrees belonging to |user_id| that might be | 205 // Sends an |event| to all WindowTrees belonging to |user_id| that might be |
| 199 // observing events. Skips |ignore_tree| if it is non-null. |target_window| is | 206 // observing events. Skips |ignore_tree| if it is non-null. |target_window| is |
| 200 // the target of the event. | 207 // the target of the event. |
| 201 void SendToPointerWatchers(const ui::Event& event, | 208 void SendToPointerWatchers(const ui::Event& event, |
| 202 const UserId& user_id, | 209 const UserId& user_id, |
| 203 ServerWindow* target_window, | 210 ServerWindow* target_window, |
| 204 WindowTree* ignore_tree); | 211 WindowTree* ignore_tree); |
| 205 | 212 |
| 206 // Sets a callback to be called whenever a ServerWindow is scheduled for | 213 // Sets a callback to be called whenever a ServerWindow is scheduled for |
| (...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 326 const ui::TextInputState& state) override; | 333 const ui::TextInputState& state) override; |
| 327 void OnTransientWindowAdded(ServerWindow* window, | 334 void OnTransientWindowAdded(ServerWindow* window, |
| 328 ServerWindow* transient_child) override; | 335 ServerWindow* transient_child) override; |
| 329 void OnTransientWindowRemoved(ServerWindow* window, | 336 void OnTransientWindowRemoved(ServerWindow* window, |
| 330 ServerWindow* transient_child) override; | 337 ServerWindow* transient_child) override; |
| 331 | 338 |
| 332 // GpuServiceProxyDelegate: | 339 // GpuServiceProxyDelegate: |
| 333 void OnGpuChannelEstablished( | 340 void OnGpuChannelEstablished( |
| 334 scoped_refptr<gpu::GpuChannelHost> gpu_channel) override; | 341 scoped_refptr<gpu::GpuChannelHost> gpu_channel) override; |
| 335 | 342 |
| 343 // DisplayCompositorClient: |
| 344 void OnSurfaceCreated(const cc::SurfaceId& surface_id, |
| 345 const gfx::Size& frame_size, |
| 346 float device_scale_factor) override; |
| 347 |
| 336 // UserIdTrackerObserver: | 348 // UserIdTrackerObserver: |
| 337 void OnActiveUserIdChanged(const UserId& previously_active_id, | 349 void OnActiveUserIdChanged(const UserId& previously_active_id, |
| 338 const UserId& active_id) override; | 350 const UserId& active_id) override; |
| 339 void OnUserIdAdded(const UserId& id) override; | 351 void OnUserIdAdded(const UserId& id) override; |
| 340 void OnUserIdRemoved(const UserId& id) override; | 352 void OnUserIdRemoved(const UserId& id) override; |
| 341 | 353 |
| 342 UserIdTracker user_id_tracker_; | 354 UserIdTracker user_id_tracker_; |
| 343 | 355 |
| 344 WindowServerDelegate* delegate_; | 356 WindowServerDelegate* delegate_; |
| 345 | 357 |
| (...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 379 | 391 |
| 380 WindowManagerWindowTreeFactorySet window_manager_window_tree_factory_set_; | 392 WindowManagerWindowTreeFactorySet window_manager_window_tree_factory_set_; |
| 381 | 393 |
| 382 DISALLOW_COPY_AND_ASSIGN(WindowServer); | 394 DISALLOW_COPY_AND_ASSIGN(WindowServer); |
| 383 }; | 395 }; |
| 384 | 396 |
| 385 } // namespace ws | 397 } // namespace ws |
| 386 } // namespace ui | 398 } // namespace ui |
| 387 | 399 |
| 388 #endif // SERVICES_UI_WS_WINDOW_SERVER_H_ | 400 #endif // SERVICES_UI_WS_WINDOW_SERVER_H_ |
| OLD | NEW |