| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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 "components/mus/ws/window_tree_factory.h" | 5 #include "components/mus/ws/window_tree_factory.h" |
| 6 | 6 |
| 7 #include "components/mus/ws/client_connection.h" | 7 #include "components/mus/ws/client_connection.h" |
| 8 #include "components/mus/ws/connection_manager.h" | 8 #include "components/mus/ws/connection_manager.h" |
| 9 #include "components/mus/ws/window_tree_impl.h" | 9 #include "components/mus/ws/window_tree_impl.h" |
| 10 | 10 |
| 11 namespace mus { | 11 namespace mus { |
| 12 namespace ws { | 12 namespace ws { |
| 13 | 13 |
| 14 WindowTreeFactory::WindowTreeFactory(ConnectionManager* connection_manager) | 14 WindowTreeFactory::WindowTreeFactory(ConnectionManager* connection_manager) |
| 15 : connection_manager_(connection_manager) {} | 15 : connection_manager_(connection_manager) {} |
| 16 | 16 |
| 17 WindowTreeFactory::~WindowTreeFactory() {} | 17 WindowTreeFactory::~WindowTreeFactory() {} |
| 18 | 18 |
| 19 void WindowTreeFactory::AddBinding( | 19 void WindowTreeFactory::AddBinding( |
| 20 mojo::InterfaceRequest<mus::mojom::WindowTreeFactory> request) { | 20 mojo::InterfaceRequest<mus::mojom::WindowTreeFactory> request) { |
| 21 binding_.AddBinding(this, std::move(request)); | 21 binding_.AddBinding(this, std::move(request)); |
| 22 } | 22 } |
| 23 | 23 |
| 24 void WindowTreeFactory::CreateWindowTree( | 24 void WindowTreeFactory::CreateWindowTree( |
| 25 mojo::InterfaceRequest<mojom::WindowTree> tree_request, | 25 mojo::InterfaceRequest<mojom::WindowTree> tree_request, |
| 26 mojom::WindowTreeClientPtr client) { | 26 mojom::WindowTreeClientPtr client) { |
| 27 scoped_ptr<ws::WindowTreeImpl> service(new ws::WindowTreeImpl( | 27 scoped_ptr<ws::WindowTreeImpl> service(new ws::WindowTreeImpl( |
| 28 connection_manager_, nullptr, mojom::WindowTree::kAccessPolicyDefault)); | 28 connection_manager_, nullptr, mojom::WindowTree::kAccessPolicyDefault)); |
| 29 scoped_ptr<ws::DefaultClientConnection> client_connection( | 29 scoped_ptr<ws::DefaultClientConnection> client_connection( |
| 30 new ws::DefaultClientConnection(std::move(service), connection_manager_, | 30 new ws::DefaultClientConnection(service.get(), connection_manager_, |
| 31 std::move(tree_request), | 31 std::move(tree_request), |
| 32 std::move(client))); | 32 std::move(client))); |
| 33 connection_manager_->AddConnection(std::move(client_connection), nullptr); | 33 connection_manager_->AddTree(std::move(service), std::move(client_connection), |
| 34 nullptr); |
| 34 } | 35 } |
| 35 | 36 |
| 36 } // namespace ws | 37 } // namespace ws |
| 37 } // namespace mus | 38 } // namespace mus |
| OLD | NEW |