| 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 "cc/ipc/display_compositor.mojom.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/ws/gpu_host_delegate.h" | 21 #include "services/ui/ws/gpu_host_delegate.h" |
| 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 #include "services/ui/ws/window_tree_host_factory.h" |
| 30 | 31 |
| 31 namespace ui { | 32 namespace ui { |
| 32 namespace ws { | 33 namespace ws { |
| 33 | 34 |
| 34 class AccessPolicy; | 35 class AccessPolicy; |
| 35 class Display; | 36 class Display; |
| 36 class DisplayManager; | 37 class DisplayManager; |
| 37 class GpuHost; | 38 class GpuHost; |
| 38 class ServerWindow; | 39 class ServerWindow; |
| 39 class UserActivityMonitor; | 40 class UserActivityMonitor; |
| (...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 129 const_cast<const WindowServer*>(this)->GetTreeWithRoot(window)); | 130 const_cast<const WindowServer*>(this)->GetTreeWithRoot(window)); |
| 130 } | 131 } |
| 131 const WindowTree* GetTreeWithRoot(const ServerWindow* window) const; | 132 const WindowTree* GetTreeWithRoot(const ServerWindow* window) const; |
| 132 | 133 |
| 133 UserActivityMonitor* GetUserActivityMonitorForUser(const UserId& user_id); | 134 UserActivityMonitor* GetUserActivityMonitorForUser(const UserId& user_id); |
| 134 | 135 |
| 135 WindowManagerWindowTreeFactorySet* window_manager_window_tree_factory_set() { | 136 WindowManagerWindowTreeFactorySet* window_manager_window_tree_factory_set() { |
| 136 return &window_manager_window_tree_factory_set_; | 137 return &window_manager_window_tree_factory_set_; |
| 137 } | 138 } |
| 138 | 139 |
| 140 WindowTreeHostFactory* window_tree_host_factory() { |
| 141 return window_tree_host_factory_.get(); |
| 142 } |
| 143 |
| 144 void set_window_tree_host_factory( |
| 145 std::unique_ptr<WindowTreeHostFactory> factory) { |
| 146 DCHECK(factory); |
| 147 window_tree_host_factory_ = std::move(factory); |
| 148 } |
| 149 |
| 139 // Sets focus to |window|. Returns true if |window| already has focus, or | 150 // Sets focus to |window|. Returns true if |window| already has focus, or |
| 140 // focus was successfully changed. Returns |false| if |window| is not a valid | 151 // focus was successfully changed. Returns |false| if |window| is not a valid |
| 141 // window to receive focus. | 152 // window to receive focus. |
| 142 bool SetFocusedWindow(ServerWindow* window); | 153 bool SetFocusedWindow(ServerWindow* window); |
| 143 ServerWindow* GetFocusedWindow(); | 154 ServerWindow* GetFocusedWindow(); |
| 144 | 155 |
| 145 bool IsActiveUserInHighContrastMode() const; | 156 bool IsActiveUserInHighContrastMode() const; |
| 146 void SetHighContrastMode(const UserId& user, bool enabled); | 157 void SetHighContrastMode(const UserId& user, bool enabled); |
| 147 | 158 |
| 148 // Returns a change id for the window manager that is associated with | 159 // Returns a change id for the window manager that is associated with |
| (...skipping 216 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 365 // Next id supplied to the window manager. | 376 // Next id supplied to the window manager. |
| 366 uint32_t next_wm_change_id_; | 377 uint32_t next_wm_change_id_; |
| 367 | 378 |
| 368 std::unique_ptr<GpuHost> gpu_host_; | 379 std::unique_ptr<GpuHost> gpu_host_; |
| 369 base::Callback<void(ServerWindow*)> window_paint_callback_; | 380 base::Callback<void(ServerWindow*)> window_paint_callback_; |
| 370 | 381 |
| 371 UserActivityMonitorMap activity_monitor_map_; | 382 UserActivityMonitorMap activity_monitor_map_; |
| 372 | 383 |
| 373 WindowManagerWindowTreeFactorySet window_manager_window_tree_factory_set_; | 384 WindowManagerWindowTreeFactorySet window_manager_window_tree_factory_set_; |
| 374 | 385 |
| 386 std::unique_ptr<WindowTreeHostFactory> window_tree_host_factory_; |
| 387 |
| 375 cc::SurfaceId root_surface_id_; | 388 cc::SurfaceId root_surface_id_; |
| 376 | 389 |
| 377 mojo::Binding<cc::mojom::DisplayCompositorClient> | 390 mojo::Binding<cc::mojom::DisplayCompositorClient> |
| 378 display_compositor_client_binding_; | 391 display_compositor_client_binding_; |
| 379 // State for rendering into a Surface. | 392 // State for rendering into a Surface. |
| 380 cc::mojom::DisplayCompositorPtr display_compositor_; | 393 cc::mojom::DisplayCompositorPtr display_compositor_; |
| 381 | 394 |
| 382 DISALLOW_COPY_AND_ASSIGN(WindowServer); | 395 DISALLOW_COPY_AND_ASSIGN(WindowServer); |
| 383 }; | 396 }; |
| 384 | 397 |
| 385 } // namespace ws | 398 } // namespace ws |
| 386 } // namespace ui | 399 } // namespace ui |
| 387 | 400 |
| 388 #endif // SERVICES_UI_WS_WINDOW_SERVER_H_ | 401 #endif // SERVICES_UI_WS_WINDOW_SERVER_H_ |
| OLD | NEW |