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

Unified Diff: mash/package/mash_packaged_service.cc

Issue 2295433003: Changes around how browser_tests are launched for mash (Closed)
Patch Set: make manifest chromeos specific Created 4 years, 4 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 | « mash/package/mash_packaged_service.h ('k') | services/ui/service.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: mash/package/mash_packaged_service.cc
diff --git a/mash/package/mash_packaged_service.cc b/mash/package/mash_packaged_service.cc
new file mode 100644
index 0000000000000000000000000000000000000000..9e903e497f25e48e3640e49435a3ad30ec5d3b39
--- /dev/null
+++ b/mash/package/mash_packaged_service.cc
@@ -0,0 +1,77 @@
+// Copyright 2016 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 "mash/package/mash_packaged_service.h"
+
+#include "ash/mus/window_manager_application.h"
+#include "ash/touch_hud/mus/touch_hud_application.h"
+#include "mash/app_driver/app_driver.h"
+#include "mash/quick_launch/quick_launch.h"
+#include "mash/session/session.h"
+#include "mash/task_viewer/task_viewer.h"
+#include "services/shell/public/cpp/service_context.h"
+#include "services/ui/service.h"
+
+#if defined(OS_LINUX)
+#include "components/font_service/font_service_app.h"
+#endif
+
+namespace mash {
+
+MashPackagedService::MashPackagedService() {}
+
+MashPackagedService::~MashPackagedService() {}
+
+bool MashPackagedService::OnConnect(const shell::Identity& remote_identity,
+ shell::InterfaceRegistry* registry) {
+ registry->AddInterface<ServiceFactory>(this);
+ return true;
+}
+
+void MashPackagedService::Create(
+ const shell::Identity& remote_identity,
+ mojo::InterfaceRequest<ServiceFactory> request) {
+ service_factory_bindings_.AddBinding(this, std::move(request));
+}
+
+void MashPackagedService::CreateService(shell::mojom::ServiceRequest request,
+ const std::string& mojo_name) {
+ if (service_) {
+ LOG(ERROR) << "request to create additional service " << mojo_name;
+ return;
+ }
+ service_ = CreateService(mojo_name);
+ if (service_) {
+ service_->set_context(base::MakeUnique<shell::ServiceContext>(
+ service_.get(), std::move(request)));
+ return;
+ }
+ LOG(ERROR) << "unknown name " << mojo_name;
+ NOTREACHED();
+}
+
+std::unique_ptr<shell::Service> MashPackagedService::CreateService(
+ const std::string& name) {
+ if (name == "mojo:ash")
+ return base::WrapUnique(new ash::mus::WindowManagerApplication);
+ if (name == "mojo:touch_hud")
+ return base::WrapUnique(new ash::touch_hud::TouchHudApplication);
+ if (name == "mojo:mash_session")
+ return base::WrapUnique(new mash::session::Session);
+ if (name == "mojo:ui")
+ return base::WrapUnique(new ui::Service);
+ if (name == "mojo:quick_launch")
+ return base::WrapUnique(new mash::quick_launch::QuickLaunch);
+ if (name == "mojo:task_viewer")
+ return base::WrapUnique(new mash::task_viewer::TaskViewer);
+#if defined(OS_LINUX)
+ if (name == "mojo:font_service")
+ return base::WrapUnique(new font_service::FontServiceApp);
+#endif
+ if (name == "mojo:app_driver")
+ return base::WrapUnique(new mash::app_driver::AppDriver);
+ return nullptr;
+}
+
+} // namespace mash
« no previous file with comments | « mash/package/mash_packaged_service.h ('k') | services/ui/service.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698