OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 #include "services/ui/public/cpp/window_tree_host_factory.h" | 5 #include "services/ui/public/cpp/window_tree_host_factory.h" |
6 | 6 |
7 #include "base/memory/ptr_util.h" | 7 #include "base/memory/ptr_util.h" |
8 #include "services/service_manager/public/cpp/connector.h" | 8 #include "services/service_manager/public/cpp/connector.h" |
9 #include "services/ui/public/cpp/window_tree_client.h" | 9 #include "services/ui/public/cpp/window_tree_client.h" |
10 #include "services/ui/public/cpp/window_tree_client_delegate.h" | 10 #include "services/ui/public/cpp/window_tree_client_delegate.h" |
11 #include "services/ui/public/interfaces/constants.mojom.h" | 11 #include "services/ui/public/interfaces/constants.mojom.h" |
12 | 12 |
13 namespace ui { | 13 namespace ui { |
14 | 14 |
15 std::unique_ptr<WindowTreeClient> CreateWindowTreeHost( | 15 std::unique_ptr<WindowTreeClient> CreateWindowTreeHost( |
16 mojom::WindowTreeHostFactory* factory, | 16 mojom::WindowTreeHostFactory* factory, |
17 WindowTreeClientDelegate* delegate, | 17 WindowTreeClientDelegate* delegate, |
18 mojom::WindowTreeHostPtr* host, | 18 mojom::WindowTreeHostPtr* host, |
19 WindowManagerDelegate* window_manager_delegate) { | 19 WindowManagerDelegate* window_manager_delegate) { |
20 mojom::WindowTreeClientPtr tree_client; | 20 mojom::WindowTreeClientPtr tree_client; |
21 std::unique_ptr<WindowTreeClient> window_tree_client = | 21 std::unique_ptr<WindowTreeClient> window_tree_client = |
22 base::MakeUnique<WindowTreeClient>(delegate, window_manager_delegate, | 22 base::MakeUnique<WindowTreeClient>(delegate, window_manager_delegate, |
23 GetProxy(&tree_client)); | 23 MakeRequest(&tree_client)); |
24 factory->CreateWindowTreeHost(GetProxy(host), std::move(tree_client)); | 24 factory->CreateWindowTreeHost(MakeRequest(host), std::move(tree_client)); |
25 return window_tree_client; | 25 return window_tree_client; |
26 } | 26 } |
27 | 27 |
28 std::unique_ptr<WindowTreeClient> CreateWindowTreeHost( | 28 std::unique_ptr<WindowTreeClient> CreateWindowTreeHost( |
29 service_manager::Connector* connector, | 29 service_manager::Connector* connector, |
30 WindowTreeClientDelegate* delegate, | 30 WindowTreeClientDelegate* delegate, |
31 mojom::WindowTreeHostPtr* host, | 31 mojom::WindowTreeHostPtr* host, |
32 WindowManagerDelegate* window_manager_delegate) { | 32 WindowManagerDelegate* window_manager_delegate) { |
33 mojom::WindowTreeHostFactoryPtr factory; | 33 mojom::WindowTreeHostFactoryPtr factory; |
34 connector->ConnectToInterface(ui::mojom::kServiceName, &factory); | 34 connector->ConnectToInterface(ui::mojom::kServiceName, &factory); |
35 return CreateWindowTreeHost(factory.get(), delegate, host, | 35 return CreateWindowTreeHost(factory.get(), delegate, host, |
36 window_manager_delegate); | 36 window_manager_delegate); |
37 } | 37 } |
38 | 38 |
39 } // namespace ui | 39 } // namespace ui |
OLD | NEW |