Index: content/public/browser/android/interface_provider_android.h |
diff --git a/content/public/browser/android/interface_provider_android.h b/content/public/browser/android/interface_provider_android.h |
new file mode 100644 |
index 0000000000000000000000000000000000000000..2a283cd0a2951765463bc11bd43acd485af5a754 |
--- /dev/null |
+++ b/content/public/browser/android/interface_provider_android.h |
@@ -0,0 +1,43 @@ |
+// 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. |
+ |
+#ifndef CONTENT_PUBLIC_BROWSER_ANDROID_INTERFACE_PROVIDER_ANDROID_H_ |
+#define CONTENT_PUBLIC_BROWSER_ANDROID_INTERFACE_PROVIDER_ANDROID_H_ |
+ |
+#include <jni.h> |
+#include <memory> |
+ |
+#include "base/android/scoped_java_ref.h" |
+#include "content/common/content_export.h" |
+ |
+namespace shell { |
+class InterfaceProvider; |
+} |
+ |
+namespace content { |
+ |
+// Android wrapper around shell::InterfaceProvider, allowing code in Java to |
+// request interfaces implemented in other environments. |
+class CONTENT_EXPORT InterfaceProviderAndroid { |
+ public: |
+ virtual ~InterfaceProviderAndroid() {} |
+ |
+ // The |registry| parameter must outlive |InterfaceProviderAndroid|. |
no sievers
2016/07/29 18:02:13
s/registry/remote_interfaces
|
+ static std::unique_ptr<InterfaceProviderAndroid> Create( |
+ shell::InterfaceProvider* remote_interfaces); |
+ |
+ // Called from Java. |
+ virtual void GetInterface( |
+ JNIEnv* env, |
+ const base::android::JavaParamRef<jobject>& j_interface_provider, |
+ const base::android::JavaParamRef<jstring>& j_name, |
+ jint handle) = 0; |
+ |
+ // Accessor to the Java object. |
+ virtual const base::android::ScopedJavaGlobalRef<jobject>& GetObj() = 0; |
+}; |
+ |
+} // namespace content |
+ |
+#endif // CONTENT_PUBLIC_BROWSER_ANDROID_INTERFACE_PROVIDER_ANDROID_H_ |