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 UI_AURA_MUS_WINDOW_TREE_CLIENT_H_ | 5 #ifndef UI_AURA_MUS_WINDOW_TREE_CLIENT_H_ |
6 #define UI_AURA_MUS_WINDOW_TREE_CLIENT_H_ | 6 #define UI_AURA_MUS_WINDOW_TREE_CLIENT_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 <set> | 12 #include <set> |
13 #include <string> | 13 #include <string> |
14 #include <vector> | 14 #include <vector> |
15 | 15 |
16 #include "base/atomicops.h" | 16 #include "base/atomicops.h" |
17 #include "base/compiler_specific.h" | 17 #include "base/compiler_specific.h" |
18 #include "base/macros.h" | 18 #include "base/macros.h" |
19 #include "base/memory/weak_ptr.h" | 19 #include "base/memory/weak_ptr.h" |
20 #include "base/observer_list.h" | 20 #include "base/observer_list.h" |
21 #include "mojo/public/cpp/bindings/associated_binding.h" | 21 #include "mojo/public/cpp/bindings/associated_binding.h" |
22 #include "mojo/public/cpp/bindings/strong_binding.h" | 22 #include "mojo/public/cpp/bindings/strong_binding.h" |
23 #include "services/ui/public/interfaces/window_tree.mojom.h" | 23 #include "services/ui/public/interfaces/window_tree.mojom.h" |
| 24 #include "services/ui/public/interfaces/window_tree_host.mojom.h" |
24 #include "ui/aura/aura_export.h" | 25 #include "ui/aura/aura_export.h" |
25 #include "ui/aura/client/transient_window_client_observer.h" | 26 #include "ui/aura/client/transient_window_client_observer.h" |
26 #include "ui/aura/mus/capture_synchronizer_delegate.h" | 27 #include "ui/aura/mus/capture_synchronizer_delegate.h" |
27 #include "ui/aura/mus/drag_drop_controller_host.h" | 28 #include "ui/aura/mus/drag_drop_controller_host.h" |
28 #include "ui/aura/mus/focus_synchronizer_delegate.h" | 29 #include "ui/aura/mus/focus_synchronizer_delegate.h" |
29 #include "ui/aura/mus/mus_types.h" | 30 #include "ui/aura/mus/mus_types.h" |
30 #include "ui/aura/mus/window_manager_delegate.h" | 31 #include "ui/aura/mus/window_manager_delegate.h" |
31 #include "ui/aura/mus/window_tree_host_mus_delegate.h" | 32 #include "ui/aura/mus/window_tree_host_mus_delegate.h" |
32 | 33 |
33 namespace display { | 34 namespace display { |
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
90 service_manager::Connector* connector, | 91 service_manager::Connector* connector, |
91 WindowTreeClientDelegate* delegate, | 92 WindowTreeClientDelegate* delegate, |
92 WindowManagerDelegate* window_manager_delegate = nullptr, | 93 WindowManagerDelegate* window_manager_delegate = nullptr, |
93 ui::mojom::WindowTreeClientRequest request = nullptr, | 94 ui::mojom::WindowTreeClientRequest request = nullptr, |
94 scoped_refptr<base::SingleThreadTaskRunner> io_task_runner = nullptr); | 95 scoped_refptr<base::SingleThreadTaskRunner> io_task_runner = nullptr); |
95 ~WindowTreeClient() override; | 96 ~WindowTreeClient() override; |
96 | 97 |
97 // Establishes the connection by way of the WindowTreeFactory. | 98 // Establishes the connection by way of the WindowTreeFactory. |
98 void ConnectViaWindowTreeFactory(); | 99 void ConnectViaWindowTreeFactory(); |
99 | 100 |
| 101 // Establishes the connection by way of the WindowTreeFactoryHost. |
| 102 void ConnectViaWindowTreeHostFactory(); |
| 103 |
100 // Establishes the connection by way of WindowManagerWindowTreeFactory. | 104 // Establishes the connection by way of WindowManagerWindowTreeFactory. |
101 void ConnectAsWindowManager(); | 105 void ConnectAsWindowManager(); |
102 | 106 |
103 service_manager::Connector* connector() { return connector_; } | 107 service_manager::Connector* connector() { return connector_; } |
104 ui::Gpu* gpu() { return gpu_.get(); } | 108 ui::Gpu* gpu() { return gpu_.get(); } |
105 CaptureSynchronizer* capture_synchronizer() { | 109 CaptureSynchronizer* capture_synchronizer() { |
106 return capture_synchronizer_.get(); | 110 return capture_synchronizer_.get(); |
107 } | 111 } |
108 | 112 |
109 bool connected() const { return tree_ != nullptr; } | 113 bool connected() const { return tree_ != nullptr; } |
(...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
212 void SetLocalPropertiesFromServerProperties( | 216 void SetLocalPropertiesFromServerProperties( |
213 WindowMus* window, | 217 WindowMus* window, |
214 const ui::mojom::WindowData& window_data); | 218 const ui::mojom::WindowData& window_data); |
215 | 219 |
216 // Creates a new WindowTreeHostMus. | 220 // Creates a new WindowTreeHostMus. |
217 std::unique_ptr<WindowTreeHostMus> CreateWindowTreeHost( | 221 std::unique_ptr<WindowTreeHostMus> CreateWindowTreeHost( |
218 WindowMusType window_mus_type, | 222 WindowMusType window_mus_type, |
219 const ui::mojom::WindowData& window_data, | 223 const ui::mojom::WindowData& window_data, |
220 int64_t display_id); | 224 int64_t display_id); |
221 | 225 |
| 226 void ConfigureWindowDataFromServer(WindowTreeHostMus* window_tree_host, |
| 227 const ui::mojom::WindowData& window_data); |
| 228 |
222 WindowMus* NewWindowFromWindowData(WindowMus* parent, | 229 WindowMus* NewWindowFromWindowData(WindowMus* parent, |
223 const ui::mojom::WindowData& window_data); | 230 const ui::mojom::WindowData& window_data); |
224 | 231 |
225 // Sets the ui::mojom::WindowTree implementation. | 232 // Sets the ui::mojom::WindowTree implementation. |
226 void SetWindowTree(ui::mojom::WindowTreePtr window_tree_ptr); | 233 void SetWindowTree(ui::mojom::WindowTreePtr window_tree_ptr); |
227 | 234 |
228 // Called when the connection to the server is established. | 235 // Called when the connection to the server is established. |
229 void WindowTreeConnectionEstablished(ui::mojom::WindowTree* window_tree); | 236 void WindowTreeConnectionEstablished(ui::mojom::WindowTree* window_tree); |
230 | 237 |
231 // Called when the ui::mojom::WindowTree connection is lost, deletes this. | 238 // Called when the ui::mojom::WindowTree connection is lost, deletes this. |
(...skipping 289 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
521 mojo::ScopedSharedBufferMapping cursor_location_mapping_; | 528 mojo::ScopedSharedBufferMapping cursor_location_mapping_; |
522 | 529 |
523 base::ObserverList<WindowTreeClientObserver> observers_; | 530 base::ObserverList<WindowTreeClientObserver> observers_; |
524 | 531 |
525 std::unique_ptr<mojo::AssociatedBinding<ui::mojom::WindowManager>> | 532 std::unique_ptr<mojo::AssociatedBinding<ui::mojom::WindowManager>> |
526 window_manager_internal_; | 533 window_manager_internal_; |
527 ui::mojom::WindowManagerClientAssociatedPtr window_manager_internal_client_; | 534 ui::mojom::WindowManagerClientAssociatedPtr window_manager_internal_client_; |
528 | 535 |
529 bool has_pointer_watcher_ = false; | 536 bool has_pointer_watcher_ = false; |
530 | 537 |
| 538 bool in_external_window_mode_ = false; |
| 539 |
531 // The current change id for the client. | 540 // The current change id for the client. |
532 uint32_t current_move_loop_change_ = 0u; | 541 uint32_t current_move_loop_change_ = 0u; |
533 | 542 |
534 // Callback executed when a move loop initiated by PerformWindowMove() is | 543 // Callback executed when a move loop initiated by PerformWindowMove() is |
535 // completed. | 544 // completed. |
536 base::Callback<void(bool)> on_current_move_finished_; | 545 base::Callback<void(bool)> on_current_move_finished_; |
537 | 546 |
538 // The current change id for the window manager. | 547 // The current change id for the window manager. |
539 uint32_t current_wm_move_loop_change_ = 0u; | 548 uint32_t current_wm_move_loop_change_ = 0u; |
540 Id current_wm_move_loop_window_id_ = 0u; | 549 Id current_wm_move_loop_window_id_ = 0u; |
541 | 550 |
542 std::unique_ptr<DragDropControllerMus> drag_drop_controller_; | 551 std::unique_ptr<DragDropControllerMus> drag_drop_controller_; |
543 | 552 |
544 base::ObserverList<WindowTreeClientTestObserver> test_observers_; | 553 base::ObserverList<WindowTreeClientTestObserver> test_observers_; |
545 | 554 |
546 std::unique_ptr<ui::Gpu> gpu_; | 555 std::unique_ptr<ui::Gpu> gpu_; |
547 std::unique_ptr<MusContextFactory> compositor_context_factory_; | 556 std::unique_ptr<MusContextFactory> compositor_context_factory_; |
548 | 557 |
549 // If |compositor_context_factory_| is installed on Env, then this is the | 558 // If |compositor_context_factory_| is installed on Env, then this is the |
550 // ContextFactory that was set on Env originally. | 559 // ContextFactory that was set on Env originally. |
551 ui::ContextFactory* initial_context_factory_ = nullptr; | 560 ui::ContextFactory* initial_context_factory_ = nullptr; |
| 561 |
| 562 ui::mojom::WindowTreeHostFactoryPtr window_tree_host_factory_ptr_; |
| 563 |
552 base::WeakPtrFactory<WindowTreeClient> weak_factory_; | 564 base::WeakPtrFactory<WindowTreeClient> weak_factory_; |
553 | 565 |
554 DISALLOW_COPY_AND_ASSIGN(WindowTreeClient); | 566 DISALLOW_COPY_AND_ASSIGN(WindowTreeClient); |
555 }; | 567 }; |
556 | 568 |
557 } // namespace aura | 569 } // namespace aura |
558 | 570 |
559 #endif // UI_AURA_MUS_WINDOW_TREE_CLIENT_H_ | 571 #endif // UI_AURA_MUS_WINDOW_TREE_CLIENT_H_ |
OLD | NEW |