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 |
107 // Triggers the creation of a mojom::WindowTreeHost (aka ws::Display) | |
108 // instance on the server side. | |
109 // This ends up calling back to client side, ui::WindowtreeClient::OnEmbed. | |
110 void CreateHost(ui::mojom::WindowTreeHostRequest host); | |
fwang
2017/02/28 08:23:53
You'll have to update the comment and function nam
| |
111 | |
103 service_manager::Connector* connector() { return connector_; } | 112 service_manager::Connector* connector() { return connector_; } |
104 ui::Gpu* gpu() { return gpu_.get(); } | 113 ui::Gpu* gpu() { return gpu_.get(); } |
105 CaptureSynchronizer* capture_synchronizer() { | 114 CaptureSynchronizer* capture_synchronizer() { |
106 return capture_synchronizer_.get(); | 115 return capture_synchronizer_.get(); |
107 } | 116 } |
108 | 117 |
109 bool connected() const { return tree_ != nullptr; } | 118 bool connected() const { return tree_ != nullptr; } |
110 ClientSpecificId client_id() const { return client_id_; } | 119 ClientSpecificId client_id() const { return client_id_; } |
111 | 120 |
112 void SetCanFocus(Window* window, bool can_focus); | 121 void SetCanFocus(Window* window, bool can_focus); |
(...skipping 424 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
537 std::unique_ptr<DragDropControllerMus> drag_drop_controller_; | 546 std::unique_ptr<DragDropControllerMus> drag_drop_controller_; |
538 | 547 |
539 base::ObserverList<WindowTreeClientTestObserver> test_observers_; | 548 base::ObserverList<WindowTreeClientTestObserver> test_observers_; |
540 | 549 |
541 std::unique_ptr<ui::Gpu> gpu_; | 550 std::unique_ptr<ui::Gpu> gpu_; |
542 std::unique_ptr<MusContextFactory> compositor_context_factory_; | 551 std::unique_ptr<MusContextFactory> compositor_context_factory_; |
543 | 552 |
544 // If |compositor_context_factory_| is installed on Env, then this is the | 553 // If |compositor_context_factory_| is installed on Env, then this is the |
545 // ContextFactory that was set on Env originally. | 554 // ContextFactory that was set on Env originally. |
546 ui::ContextFactory* initial_context_factory_ = nullptr; | 555 ui::ContextFactory* initial_context_factory_ = nullptr; |
556 | |
557 ui::mojom::WindowTreeHostFactoryPtr window_tree_host_factory_ptr_; | |
558 | |
547 base::WeakPtrFactory<WindowTreeClient> weak_factory_; | 559 base::WeakPtrFactory<WindowTreeClient> weak_factory_; |
548 | 560 |
549 DISALLOW_COPY_AND_ASSIGN(WindowTreeClient); | 561 DISALLOW_COPY_AND_ASSIGN(WindowTreeClient); |
550 }; | 562 }; |
551 | 563 |
552 } // namespace aura | 564 } // namespace aura |
553 | 565 |
554 #endif // UI_AURA_MUS_WINDOW_TREE_CLIENT_H_ | 566 #endif // UI_AURA_MUS_WINDOW_TREE_CLIENT_H_ |
OLD | NEW |