| OLD | NEW |
| (Empty) |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | |
| 2 // Use of this source code is governed by a BSD-style license that can be | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 #ifndef CONTENT_PUBLIC_BROWSER_ANDROID_INTERFACE_PROVIDER_ANDROID_H_ | |
| 6 #define CONTENT_PUBLIC_BROWSER_ANDROID_INTERFACE_PROVIDER_ANDROID_H_ | |
| 7 | |
| 8 #include <jni.h> | |
| 9 #include <memory> | |
| 10 | |
| 11 #include "base/android/scoped_java_ref.h" | |
| 12 #include "content/common/content_export.h" | |
| 13 | |
| 14 namespace shell { | |
| 15 class InterfaceProvider; | |
| 16 } | |
| 17 | |
| 18 namespace content { | |
| 19 | |
| 20 // Android wrapper around shell::InterfaceProvider, allowing code in Java to | |
| 21 // request interfaces implemented in other environments. | |
| 22 class CONTENT_EXPORT InterfaceProviderAndroid { | |
| 23 public: | |
| 24 virtual ~InterfaceProviderAndroid() {} | |
| 25 | |
| 26 // The |remote_interfaces| parameter must outlive |InterfaceProviderAndroid|. | |
| 27 static std::unique_ptr<InterfaceProviderAndroid> Create( | |
| 28 shell::InterfaceProvider* remote_interfaces); | |
| 29 | |
| 30 // Called from Java. | |
| 31 virtual void GetInterface( | |
| 32 JNIEnv* env, | |
| 33 const base::android::JavaParamRef<jobject>& j_interface_provider, | |
| 34 const base::android::JavaParamRef<jstring>& j_name, | |
| 35 jint handle) = 0; | |
| 36 | |
| 37 // Accessor to the Java object. | |
| 38 virtual const base::android::ScopedJavaGlobalRef<jobject>& GetObj() = 0; | |
| 39 }; | |
| 40 | |
| 41 } // namespace content | |
| 42 | |
| 43 #endif // CONTENT_PUBLIC_BROWSER_ANDROID_INTERFACE_PROVIDER_ANDROID_H_ | |
| OLD | NEW |