| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef CONTENT_PUBLIC_BROWSER_ANDROID_SERVICE_REGISTRY_ANDROID_H_ | 5 #ifndef CONTENT_PUBLIC_BROWSER_ANDROID_SERVICE_REGISTRY_ANDROID_H_ |
| 6 #define CONTENT_PUBLIC_BROWSER_ANDROID_SERVICE_REGISTRY_ANDROID_H_ | 6 #define CONTENT_PUBLIC_BROWSER_ANDROID_SERVICE_REGISTRY_ANDROID_H_ |
| 7 | 7 |
| 8 #include <jni.h> | 8 #include <jni.h> |
| 9 #include <memory> | 9 #include <memory> |
| 10 | 10 |
| 11 #include "base/android/scoped_java_ref.h" | 11 #include "base/android/scoped_java_ref.h" |
| 12 #include "content/common/content_export.h" | 12 #include "content/common/content_export.h" |
| 13 | 13 |
| 14 namespace shell { | 14 namespace shell { |
| 15 class InterfaceRegistry; | 15 class InterfaceRegistry; |
| 16 class InterfaceProvider; | 16 class InterfaceProvider; |
| 17 } | 17 } |
| 18 | 18 |
| 19 namespace content { | 19 namespace content { |
| 20 | 20 |
| 21 class ServiceRegistry; | |
| 22 | |
| 23 // Android wrapper over ServiceRegistry, allowing the browser services in Java | 21 // Android wrapper over ServiceRegistry, allowing the browser services in Java |
| 24 // to register with ServiceRegistry.java (and abstracting away the JNI calls). | 22 // to register with ServiceRegistry.java (and abstracting away the JNI calls). |
| 25 class CONTENT_EXPORT ServiceRegistryAndroid { | 23 class CONTENT_EXPORT ServiceRegistryAndroid { |
| 26 public: | 24 public: |
| 27 virtual ~ServiceRegistryAndroid() {} | 25 virtual ~ServiceRegistryAndroid() {} |
| 28 | 26 |
| 29 // The |registry| parameter must outlive |ServiceRegistryAndroid|. | 27 // The |registry| parameter must outlive |ServiceRegistryAndroid|. |
| 30 static std::unique_ptr<ServiceRegistryAndroid> Create( | 28 static std::unique_ptr<ServiceRegistryAndroid> Create( |
| 31 shell::InterfaceRegistry* interface_registry, | 29 shell::InterfaceRegistry* interface_registry, |
| 32 shell::InterfaceProvider* remote_interfaces); | 30 shell::InterfaceProvider* remote_interfaces); |
| (...skipping 15 matching lines...) Expand all Loading... |
| 48 const base::android::JavaParamRef<jstring>& j_name, | 46 const base::android::JavaParamRef<jstring>& j_name, |
| 49 jint handle) = 0; | 47 jint handle) = 0; |
| 50 | 48 |
| 51 // Accessor to the Java object. | 49 // Accessor to the Java object. |
| 52 virtual const base::android::ScopedJavaGlobalRef<jobject>& GetObj() = 0; | 50 virtual const base::android::ScopedJavaGlobalRef<jobject>& GetObj() = 0; |
| 53 }; | 51 }; |
| 54 | 52 |
| 55 } // namespace content | 53 } // namespace content |
| 56 | 54 |
| 57 #endif // CONTENT_PUBLIC_BROWSER_ANDROID_SERVICE_REGISTRY_ANDROID_H_ | 55 #endif // CONTENT_PUBLIC_BROWSER_ANDROID_SERVICE_REGISTRY_ANDROID_H_ |
| OLD | NEW |