| OLD | NEW |
| (Empty) |
| 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 | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 #include "components/mus/ws/window_tree_host_factory.h" | |
| 6 | |
| 7 #include "components/mus/gles2/gpu_state.h" | |
| 8 #include "components/mus/surfaces/surfaces_state.h" | |
| 9 #include "components/mus/ws/display.h" | |
| 10 #include "components/mus/ws/display_binding.h" | |
| 11 #include "components/mus/ws/window_server.h" | |
| 12 | |
| 13 namespace mus { | |
| 14 namespace ws { | |
| 15 | |
| 16 WindowTreeHostFactory::WindowTreeHostFactory( | |
| 17 WindowServer* window_server, | |
| 18 const UserId& user_id, | |
| 19 const PlatformDisplayInitParams& platform_display_init_params) | |
| 20 : window_server_(window_server), | |
| 21 user_id_(user_id), | |
| 22 platform_display_init_params_(platform_display_init_params) {} | |
| 23 | |
| 24 WindowTreeHostFactory::~WindowTreeHostFactory() {} | |
| 25 | |
| 26 void WindowTreeHostFactory::AddBinding( | |
| 27 mojom::WindowTreeHostFactoryRequest request) { | |
| 28 bindings_.AddBinding(this, std::move(request)); | |
| 29 } | |
| 30 | |
| 31 void WindowTreeHostFactory::CreateWindowTreeHost( | |
| 32 mojom::WindowTreeHostRequest host, | |
| 33 mojom::WindowTreeClientPtr tree_client) { | |
| 34 Display* display = new Display(window_server_, platform_display_init_params_); | |
| 35 std::unique_ptr<DisplayBindingImpl> display_binding( | |
| 36 new DisplayBindingImpl(std::move(host), display, user_id_, | |
| 37 std::move(tree_client), window_server_)); | |
| 38 display->Init(std::move(display_binding)); | |
| 39 } | |
| 40 | |
| 41 } // namespace ws | |
| 42 } // namespace mus | |
| OLD | NEW |