Index: services/ui/ws/window_tree_host_factory.cc |
diff --git a/services/ui/ws/window_tree_host_factory.cc b/services/ui/ws/window_tree_host_factory.cc |
index 1efbf9b5a429e200be7e13eacc01f56704830a3a..81be2847afaff68e442597118d8131a9a6095896 100644 |
--- a/services/ui/ws/window_tree_host_factory.cc |
+++ b/services/ui/ws/window_tree_host_factory.cc |
@@ -8,6 +8,7 @@ |
#include "services/ui/ws/display.h" |
#include "services/ui/ws/display_binding.h" |
#include "services/ui/ws/window_server.h" |
+#include "services/ui/ws/window_tree.h" |
namespace ui { |
namespace ws { |
@@ -44,5 +45,26 @@ void WindowTreeHostFactory::CreateWindowTreeHost( |
ws_display->Init(metrics, std::move(display_binding)); |
} |
+void WindowTreeHostFactory::CreatePlatformWindow( |
+ mojom::WindowTreeHostRequest tree_host_request, |
+ Id transport_window_id) { |
+ WindowTree* tree = window_server_->GetTreeForExternalWindowMode(); |
+ tree->WillCreateRootDisplay(transport_window_id); |
+ |
+ Display* ws_display = new Display(window_server_); |
+ |
+ std::unique_ptr<DisplayBindingImpl> display_binding( |
+ new DisplayBindingImpl(std::move(tree_host_request), ws_display, user_id_, |
+ nullptr, window_server_)); |
+ |
+ // Provide an initial size for the WindowTreeHost. |
+ display::ViewportMetrics metrics; |
+ metrics.bounds_in_pixels = gfx::Rect(1024, 768); |
+ metrics.device_scale_factor = 1.0f; |
+ metrics.ui_scale_factor = 1.0f; |
+ |
+ ws_display->Init(metrics, std::move(display_binding)); |
+} |
+ |
} // namespace ws |
} // namespace ui |