| Index: services/ui/public/cpp/window_tree_host_factory.cc
|
| diff --git a/services/ui/public/cpp/window_tree_host_factory.cc b/services/ui/public/cpp/window_tree_host_factory.cc
|
| index 19b9008f6884c1e740809a9d383fd6469881c2dc..458f88a832bca7f5cf439c74e3c6577c9e8feb9c 100644
|
| --- a/services/ui/public/cpp/window_tree_host_factory.cc
|
| +++ b/services/ui/public/cpp/window_tree_host_factory.cc
|
| @@ -4,29 +4,35 @@
|
|
|
| #include "services/ui/public/cpp/window_tree_host_factory.h"
|
|
|
| +#include "base/memory/ptr_util.h"
|
| #include "services/shell/public/cpp/connector.h"
|
| #include "services/ui/public/cpp/window_tree_client.h"
|
| #include "services/ui/public/cpp/window_tree_client_delegate.h"
|
|
|
| namespace ui {
|
|
|
| -void CreateWindowTreeHost(mojom::WindowTreeHostFactory* factory,
|
| - WindowTreeClientDelegate* delegate,
|
| - mojom::WindowTreeHostPtr* host,
|
| - WindowManagerDelegate* window_manager_delegate) {
|
| +std::unique_ptr<WindowTreeClient> CreateWindowTreeHost(
|
| + mojom::WindowTreeHostFactory* factory,
|
| + WindowTreeClientDelegate* delegate,
|
| + mojom::WindowTreeHostPtr* host,
|
| + WindowManagerDelegate* window_manager_delegate) {
|
| mojom::WindowTreeClientPtr tree_client;
|
| - new WindowTreeClient(delegate, window_manager_delegate,
|
| - GetProxy(&tree_client));
|
| + std::unique_ptr<WindowTreeClient> window_tree_client =
|
| + base::MakeUnique<WindowTreeClient>(delegate, window_manager_delegate,
|
| + GetProxy(&tree_client));
|
| factory->CreateWindowTreeHost(GetProxy(host), std::move(tree_client));
|
| + return window_tree_client;
|
| }
|
|
|
| -void CreateWindowTreeHost(shell::Connector* connector,
|
| - WindowTreeClientDelegate* delegate,
|
| - mojom::WindowTreeHostPtr* host,
|
| - WindowManagerDelegate* window_manager_delegate) {
|
| +std::unique_ptr<WindowTreeClient> CreateWindowTreeHost(
|
| + shell::Connector* connector,
|
| + WindowTreeClientDelegate* delegate,
|
| + mojom::WindowTreeHostPtr* host,
|
| + WindowManagerDelegate* window_manager_delegate) {
|
| mojom::WindowTreeHostFactoryPtr factory;
|
| connector->ConnectToInterface("mojo:ui", &factory);
|
| - CreateWindowTreeHost(factory.get(), delegate, host, window_manager_delegate);
|
| + return CreateWindowTreeHost(factory.get(), delegate, host,
|
| + window_manager_delegate);
|
| }
|
|
|
| } // namespace ui
|
|
|