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

Unified Diff: sky/shell/org/domokit/sky/shell/JavaServiceProvider.java

Issue 1139873004: Make android directory for Android-specific bits of SkyShell (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 5 years, 7 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: sky/shell/org/domokit/sky/shell/JavaServiceProvider.java
diff --git a/sky/shell/org/domokit/sky/shell/JavaServiceProvider.java b/sky/shell/org/domokit/sky/shell/JavaServiceProvider.java
deleted file mode 100644
index 47996f466501af32a7b34491439d90694d96bdaa..0000000000000000000000000000000000000000
--- a/sky/shell/org/domokit/sky/shell/JavaServiceProvider.java
+++ /dev/null
@@ -1,55 +0,0 @@
-// 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.shell;
-
-import android.content.Context;
-
-import org.chromium.base.CalledByNative;
-import org.chromium.base.JNINamespace;
-import org.chromium.mojo.system.Core;
-import org.chromium.mojo.system.MessagePipeHandle;
-import org.chromium.mojo.system.MojoException;
-import org.chromium.mojo.system.impl.CoreImpl;
-import org.chromium.mojom.mojo.ServiceProvider;
-
-/**
- * A collection of services implemented in Java.
- **/
-@JNINamespace("sky::shell")
-public class JavaServiceProvider implements ServiceProvider {
- private Core mCore;
- private Context mContext;
-
- @SuppressWarnings("unused")
- @CalledByNative
- public static void create(Context context, int nativeHandle) {
- Core core = CoreImpl.getInstance();
- MessagePipeHandle pipe = core.acquireNativeHandle(nativeHandle).toMessagePipeHandle();
- ServiceProvider.MANAGER.bind(new JavaServiceProvider(core, context), pipe);
- }
-
- public JavaServiceProvider(Core core, Context context) {
- assert core != null;
- assert context != null;
- mCore = core;
- mContext = context;
- }
-
- @Override
- public void close() {}
-
- @Override
- public void onConnectionError(MojoException e) {}
-
- @Override
- public void connectToService(String interfaceName, MessagePipeHandle pipe) {
- ServiceFactory factory = ServiceRegistry.SHARED.get(interfaceName);
- if (factory == null) {
- pipe.close();
- return;
- }
- factory.connectToService(mContext, mCore, pipe);
- }
-}
« no previous file with comments | « sky/shell/org/domokit/sky/shell/GestureProvider.java ('k') | sky/shell/org/domokit/sky/shell/PlatformView.java » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698