Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1166)

Unified Diff: services/ui/ws/window_tree_host_factory.cc

Issue 2712203002: c++ / mojo changes for 'external window mode'
Patch Set: rebased Created 3 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « services/ui/ws/window_tree_host_factory.h ('k') | services/ui/ws/window_tree_host_factory_registrar.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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
« no previous file with comments | « services/ui/ws/window_tree_host_factory.h ('k') | services/ui/ws/window_tree_host_factory_registrar.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698