| Index: content/public/android/java/src/org/chromium/content/browser/InterfaceRegistrarImpl.java
|
| diff --git a/content/public/android/java/src/org/chromium/content/browser/InterfaceRegistrarImpl.java b/content/public/android/java/src/org/chromium/content/browser/InterfaceRegistrarImpl.java
|
| new file mode 100644
|
| index 0000000000000000000000000000000000000000..b1d920a97f8a9bfc25699749fbcdb504077b9c47
|
| --- /dev/null
|
| +++ b/content/public/android/java/src/org/chromium/content/browser/InterfaceRegistrarImpl.java
|
| @@ -0,0 +1,31 @@
|
| +// 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.
|
| +
|
| +package org.chromium.content.browser;
|
| +
|
| +import android.content.Context;
|
| +
|
| +import org.chromium.base.annotations.CalledByNative;
|
| +import org.chromium.base.annotations.JNINamespace;
|
| +import org.chromium.content_public.browser.InterfaceRegistrar;
|
| +import org.chromium.content_public.browser.WebContents;
|
| +import org.chromium.mojo.system.impl.CoreImpl;
|
| +import org.chromium.services.shell.InterfaceRegistry;
|
| +
|
| +@JNINamespace("content")
|
| +class InterfaceRegistrarImpl {
|
| + @CalledByNative
|
| + static void createInterfaceRegistryForContext(int nativeHandle, Context applicationContext) {
|
| + InterfaceRegistry registry = InterfaceRegistry.create(
|
| + CoreImpl.getInstance().acquireNativeHandle(nativeHandle).toMessagePipeHandle());
|
| + InterfaceRegistrar.Registry.applyContextRegistrars(registry, applicationContext);
|
| + }
|
| +
|
| + @CalledByNative
|
| + static void createInterfaceRegistryForWebContents(int nativeHandle, WebContents webContents) {
|
| + InterfaceRegistry registry = InterfaceRegistry.create(
|
| + CoreImpl.getInstance().acquireNativeHandle(nativeHandle).toMessagePipeHandle());
|
| + InterfaceRegistrar.Registry.applyWebContentsRegistrars(registry, webContents);
|
| + }
|
| +}
|
|
|