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

Unified Diff: sky/apk/demo/org/domokit/sky/demo/SkyDemoApplication.java

Issue 969753003: Make it possible for SkyShell embedders to register services (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 5 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
« no previous file with comments | « sky/apk/demo/BUILD.gn ('k') | sky/shell/BUILD.gn » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sky/apk/demo/org/domokit/sky/demo/SkyDemoApplication.java
diff --git a/sky/apk/demo/org/domokit/sky/demo/SkyDemoApplication.java b/sky/apk/demo/org/domokit/sky/demo/SkyDemoApplication.java
new file mode 100644
index 0000000000000000000000000000000000000000..fff3ecd554d5057737d30ebb0f470ae55bc1374c
--- /dev/null
+++ b/sky/apk/demo/org/domokit/sky/demo/SkyDemoApplication.java
@@ -0,0 +1,31 @@
+// Copyright 2015 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.
+
+package org.domokit.sky.demo;
+
+import android.content.Context;
+
+import org.chromium.mojo.system.Core;
+import org.chromium.mojo.system.MessagePipeHandle;
+import org.chromium.mojom.sensors.SensorService;
+import org.domokit.sensors.SensorServiceImpl;
+import org.domokit.sky.shell.ServiceFactory;
+import org.domokit.sky.shell.ServiceRegistry;
+import org.domokit.sky.shell.SkyApplication;
+
+/**
+ * SkyDemo implementation of {@link android.app.Application}
+ */
+public class SkyDemoApplication extends SkyApplication {
+ @Override
+ public void onCreate() {
+ super.onCreate();
+
+ ServiceRegistry.SHARED.register(SensorService.MANAGER.getName(), new ServiceFactory() {
eseidel 2015/03/02 21:06:18 SensorService.register(self);
eseidel 2015/03/02 21:06:18 There must be a nicer way to do these. But I gues
+ public void connectToService(Context context, Core core, MessagePipeHandle pipe) {
eseidel 2015/03/02 21:06:18 @Override?
eseidel 2015/03/02 21:06:18 @Override?
abarth-chromium 2015/03/02 21:12:15 Done.
+ new SensorServiceImpl(context, core, pipe);
+ }
+ });
+ }
+}
« no previous file with comments | « sky/apk/demo/BUILD.gn ('k') | sky/shell/BUILD.gn » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698