| 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/connection_manager.h" | 7 #include "components/mus/ws/connection_manager.h" |
| 8 #include "components/mus/ws/default_access_policy.h" |
| 8 #include "components/mus/ws/window_tree.h" | 9 #include "components/mus/ws/window_tree.h" |
| 9 #include "components/mus/ws/window_tree_binding.h" | 10 #include "components/mus/ws/window_tree_binding.h" |
| 10 | 11 |
| 11 namespace mus { | 12 namespace mus { |
| 12 namespace ws { | 13 namespace ws { |
| 13 | 14 |
| 14 WindowTreeFactory::WindowTreeFactory(ConnectionManager* connection_manager, | 15 WindowTreeFactory::WindowTreeFactory(ConnectionManager* connection_manager, |
| 15 const UserId& user_id) | 16 const UserId& user_id) |
| 16 : connection_manager_(connection_manager), user_id_(user_id) {} | 17 : connection_manager_(connection_manager), user_id_(user_id) {} |
| 17 | 18 |
| 18 WindowTreeFactory::~WindowTreeFactory() {} | 19 WindowTreeFactory::~WindowTreeFactory() {} |
| 19 | 20 |
| 20 void WindowTreeFactory::AddBinding( | 21 void WindowTreeFactory::AddBinding( |
| 21 mojo::InterfaceRequest<mus::mojom::WindowTreeFactory> request) { | 22 mojo::InterfaceRequest<mus::mojom::WindowTreeFactory> request) { |
| 22 binding_.AddBinding(this, std::move(request)); | 23 binding_.AddBinding(this, std::move(request)); |
| 23 } | 24 } |
| 24 | 25 |
| 25 void WindowTreeFactory::CreateWindowTree( | 26 void WindowTreeFactory::CreateWindowTree( |
| 26 mojo::InterfaceRequest<mojom::WindowTree> tree_request, | 27 mojo::InterfaceRequest<mojom::WindowTree> tree_request, |
| 27 mojom::WindowTreeClientPtr client) { | 28 mojom::WindowTreeClientPtr client) { |
| 28 scoped_ptr<ws::WindowTree> service( | 29 scoped_ptr<ws::WindowTree> service( |
| 29 new ws::WindowTree(connection_manager_, user_id_, nullptr)); | 30 new ws::WindowTree(connection_manager_, user_id_, nullptr, |
| 31 make_scoped_ptr(new DefaultAccessPolicy))); |
| 30 scoped_ptr<ws::DefaultWindowTreeBinding> binding( | 32 scoped_ptr<ws::DefaultWindowTreeBinding> binding( |
| 31 new ws::DefaultWindowTreeBinding(service.get(), connection_manager_, | 33 new ws::DefaultWindowTreeBinding(service.get(), connection_manager_, |
| 32 std::move(tree_request), | 34 std::move(tree_request), |
| 33 std::move(client))); | 35 std::move(client))); |
| 34 connection_manager_->AddTree(std::move(service), std::move(binding), nullptr); | 36 connection_manager_->AddTree(std::move(service), std::move(binding), nullptr); |
| 35 } | 37 } |
| 36 | 38 |
| 37 } // namespace ws | 39 } // namespace ws |
| 38 } // namespace mus | 40 } // namespace mus |
| OLD | NEW |