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 |
| 156 void SetInExternalWindowMode() { in_external_window_mode = true; } |
| 157 bool IsInExternalWindowMode() const { return in_external_window_mode; } |
| 158 |
145 bool IsActiveUserInHighContrastMode() const; | 159 bool IsActiveUserInHighContrastMode() const; |
146 void SetHighContrastMode(const UserId& user, bool enabled); | 160 void SetHighContrastMode(const UserId& user, bool enabled); |
147 | 161 |
148 // Returns a change id for the window manager that is associated with | 162 // Returns a change id for the window manager that is associated with |
149 // |source| and |client_change_id|. When the window manager replies | 163 // |source| and |client_change_id|. When the window manager replies |
150 // WindowManagerChangeCompleted() is called to obtain the original source | 164 // WindowManagerChangeCompleted() is called to obtain the original source |
151 // and client supplied change_id that initiated the called. | 165 // and client supplied change_id that initiated the called. |
152 uint32_t GenerateWindowManagerChangeId(WindowTree* source, | 166 uint32_t GenerateWindowManagerChangeId(WindowTree* source, |
153 uint32_t client_change_id); | 167 uint32_t client_change_id); |
154 | 168 |
(...skipping 217 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
372 // Next id supplied to the window manager. | 386 // Next id supplied to the window manager. |
373 uint32_t next_wm_change_id_; | 387 uint32_t next_wm_change_id_; |
374 | 388 |
375 std::unique_ptr<GpuHost> gpu_host_; | 389 std::unique_ptr<GpuHost> gpu_host_; |
376 base::Callback<void(ServerWindow*)> window_paint_callback_; | 390 base::Callback<void(ServerWindow*)> window_paint_callback_; |
377 | 391 |
378 UserActivityMonitorMap activity_monitor_map_; | 392 UserActivityMonitorMap activity_monitor_map_; |
379 | 393 |
380 WindowManagerWindowTreeFactorySet window_manager_window_tree_factory_set_; | 394 WindowManagerWindowTreeFactorySet window_manager_window_tree_factory_set_; |
381 | 395 |
| 396 std::unique_ptr<WindowTreeHostFactory> window_tree_host_factory_; |
| 397 |
382 cc::SurfaceId root_surface_id_; | 398 cc::SurfaceId root_surface_id_; |
383 | 399 |
384 mojo::Binding<cc::mojom::DisplayCompositorClient> | 400 mojo::Binding<cc::mojom::DisplayCompositorClient> |
385 display_compositor_client_binding_; | 401 display_compositor_client_binding_; |
386 // State for rendering into a Surface. | 402 // State for rendering into a Surface. |
387 cc::mojom::DisplayCompositorPtr display_compositor_; | 403 cc::mojom::DisplayCompositorPtr display_compositor_; |
388 | 404 |
| 405 bool in_external_window_mode = false; |
| 406 |
389 DISALLOW_COPY_AND_ASSIGN(WindowServer); | 407 DISALLOW_COPY_AND_ASSIGN(WindowServer); |
390 }; | 408 }; |
391 | 409 |
392 } // namespace ws | 410 } // namespace ws |
393 } // namespace ui | 411 } // namespace ui |
394 | 412 |
395 #endif // SERVICES_UI_WS_WINDOW_SERVER_H_ | 413 #endif // SERVICES_UI_WS_WINDOW_SERVER_H_ |
OLD | NEW |