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

Unified Diff: services/kiosk_wm/kiosk_wm.cc

Issue 1536713004: Revert "Delete the ViewManager and WindowManager services." (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: Created 5 years 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/kiosk_wm/kiosk_wm.h ('k') | services/kiosk_wm/kiosk_wm_controller.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: services/kiosk_wm/kiosk_wm.cc
diff --git a/services/kiosk_wm/kiosk_wm.cc b/services/kiosk_wm/kiosk_wm.cc
new file mode 100644
index 0000000000000000000000000000000000000000..9d4f3ab5b961dea2076971beb9c4258300349388
--- /dev/null
+++ b/services/kiosk_wm/kiosk_wm.cc
@@ -0,0 +1,44 @@
+// Copyright 2014 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/kiosk_wm/kiosk_wm.h"
+
+#include "mojo/services/window_manager/interfaces/window_manager.mojom.h"
+#include "services/kiosk_wm/kiosk_wm_controller.h"
+#include "services/window_manager/window_manager_delegate.h"
+
+namespace kiosk_wm {
+
+KioskWM::KioskWM()
+ : window_manager_app_(new window_manager::WindowManagerApp(this)) {}
+
+KioskWM::~KioskWM() {}
+
+void KioskWM::Initialize(mojo::ApplicationImpl* app) {
+ window_manager_app_->Initialize(app);
+
+ // Format: --args-for="app_url default_url"
+ if (app->args().size() > 1) {
+ std::string default_url = app->args()[1];
+ mojo::WindowManagerPtr window_manager;
+ app->ConnectToService("mojo:kiosk_wm", &window_manager);
+ window_manager->Embed(default_url, nullptr, nullptr);
+ }
+}
+
+scoped_ptr<window_manager::WindowManagerController>
+KioskWM::CreateWindowManagerController(
+ mojo::ApplicationConnection* connection,
+ window_manager::WindowManagerRoot* wm_root) {
+ return scoped_ptr<window_manager::WindowManagerController>(
+ new KioskWMController(wm_root));
+}
+
+bool KioskWM::ConfigureIncomingConnection(
+ mojo::ApplicationConnection* connection) {
+ window_manager_app_->ConfigureIncomingConnection(connection);
+ return true;
+}
+
+} // namespace kiosk_wm
« no previous file with comments | « services/kiosk_wm/kiosk_wm.h ('k') | services/kiosk_wm/kiosk_wm_controller.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698