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 "services/ui/ws/window_tree_host_factory.h" | 5 #include "services/ui/ws/window_tree_host_factory.h" |
6 | 6 |
7 #include "services/ui/ws/display.h" | 7 #include "services/ui/ws/display.h" |
8 #include "services/ui/ws/display_binding.h" | 8 #include "services/ui/ws/display_binding.h" |
9 #include "services/ui/ws/window_server.h" | 9 #include "services/ui/ws/window_server.h" |
| 10 #include "services/ui/ws/window_tree.h" |
10 | 11 |
11 namespace ui { | 12 namespace ui { |
12 namespace ws { | 13 namespace ws { |
13 | 14 |
14 WindowTreeHostFactory::WindowTreeHostFactory(WindowServer* window_server, | 15 WindowTreeHostFactory::WindowTreeHostFactory(WindowServer* window_server, |
15 const UserId& user_id) | 16 const UserId& user_id) |
16 : window_server_(window_server), user_id_(user_id) { | 17 : window_server_(window_server), user_id_(user_id) { |
17 platform_display_init_params_.metrics.bounds.set_width(1024); | 18 platform_display_init_params_.metrics.bounds.set_width(1024); |
18 platform_display_init_params_.metrics.bounds.set_height(768); | 19 platform_display_init_params_.metrics.bounds.set_height(768); |
19 platform_display_init_params_.metrics.pixel_size.SetSize(1024, 768); | 20 platform_display_init_params_.metrics.pixel_size.SetSize(1024, 768); |
(...skipping 10 matching lines...) Expand all Loading... |
30 void WindowTreeHostFactory::CreateWindowTreeHost( | 31 void WindowTreeHostFactory::CreateWindowTreeHost( |
31 mojom::WindowTreeHostRequest host, | 32 mojom::WindowTreeHostRequest host, |
32 mojom::WindowTreeClientPtr tree_client) { | 33 mojom::WindowTreeClientPtr tree_client) { |
33 Display* display = new Display(window_server_); | 34 Display* display = new Display(window_server_); |
34 std::unique_ptr<DisplayBindingImpl> display_binding( | 35 std::unique_ptr<DisplayBindingImpl> display_binding( |
35 new DisplayBindingImpl(std::move(host), display, user_id_, | 36 new DisplayBindingImpl(std::move(host), display, user_id_, |
36 std::move(tree_client), window_server_)); | 37 std::move(tree_client), window_server_)); |
37 display->Init(platform_display_init_params_, std::move(display_binding)); | 38 display->Init(platform_display_init_params_, std::move(display_binding)); |
38 } | 39 } |
39 | 40 |
| 41 void WindowTreeHostFactory::CreatePlatformWindow( |
| 42 mojom::WindowTreeHostRequest tree_host_request, |
| 43 Id transport_window_id) { |
| 44 tree_->WillCreateRootDisplay(transport_window_id); |
| 45 |
| 46 Display* display = new Display(window_server_); |
| 47 std::unique_ptr<DisplayBindingImpl> display_binding( |
| 48 new DisplayBindingImpl(std::move(tree_host_request), display, user_id_, |
| 49 nullptr /* tree_client */, window_server_)); |
| 50 display->Init(platform_display_init_params_, std::move(display_binding)); |
| 51 } |
| 52 |
40 } // namespace ws | 53 } // namespace ws |
41 } // namespace ui | 54 } // namespace ui |
OLD | NEW |