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