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

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

Issue 2712203002: c++ / mojo changes for 'external window mode'
Patch Set: . Created 3 years, 10 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
Index: services/ui/ws/window_tree_host_factory_registrar.cc
diff --git a/services/ui/ws/window_tree_host_factory_registrar.cc b/services/ui/ws/window_tree_host_factory_registrar.cc
new file mode 100644
index 0000000000000000000000000000000000000000..6da3cf69165a0bc4ffb570de1f21715a49cd2288
--- /dev/null
+++ b/services/ui/ws/window_tree_host_factory_registrar.cc
@@ -0,0 +1,33 @@
+// Copyright 2017 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "services/ui/ws/window_tree_host_factory_registrar.h"
+
+#include "services/ui/ws/window_server.h"
+#include "services/ui/ws/window_tree_host_factory.h"
+
+namespace ui {
+namespace ws {
+
+WindowTreeHostFactoryRegistrar::WindowTreeHostFactoryRegistrar(
+ WindowServer* window_server,
+ const UserId& user_id)
+ : window_server_(window_server), user_id_(user_id) {}
+
+WindowTreeHostFactoryRegistrar::~WindowTreeHostFactoryRegistrar() {}
+
+void WindowTreeHostFactoryRegistrar::Register(
+ mojom::WindowTreeHostFactoryRequest host_factory_request,
+ mojom::WindowTreeRequest tree_request,
+ mojom::WindowTreeClientPtr tree_client) {
+ std::unique_ptr<WindowTreeHostFactory> host_factory(
+ new WindowTreeHostFactory(window_server_, user_id_));
+ host_factory->Init(std::move(host_factory_request), std::move(tree_request),
+ std::move(tree_client));
+
+ window_server_->set_window_tree_host_factory(std::move(host_factory));
+}
+
+} // namespace ws
+} // namespace ui

Powered by Google App Engine
This is Rietveld 408576698