Use multiline attribute to check for IA2_STATE_MULTILINE.
[chromium-blink-merge.git] / content / browser / mojo / service_registry_android.h
blob37ec10a4be81f7631226a134cd9dfeebca4c6e7a
1 // Copyright 2014 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.
5 #ifndef CONTENT_BROWSER_MOJO_SERVICE_REGISTRY_ANDROID_H_
6 #define CONTENT_BROWSER_MOJO_SERVICE_REGISTRY_ANDROID_H_
8 #include <jni.h>
10 #include "base/android/scoped_java_ref.h"
11 #include "base/macros.h"
12 #include "content/common/content_export.h"
14 namespace content {
16 class ServiceRegistryImpl;
18 // Android wrapper over ServiceRegistryImpl, allowing the browser services in
19 // Java to register with ServiceRegistry.java (and abstracting away the JNI
20 // calls).
21 class CONTENT_EXPORT ServiceRegistryAndroid {
22 public:
23 static bool Register(JNIEnv* env);
25 explicit ServiceRegistryAndroid(ServiceRegistryImpl* service_registry);
26 virtual ~ServiceRegistryAndroid();
28 // Methods called from Java.
29 void AddService(JNIEnv* env,
30 jobject j_service_registry,
31 jobject j_manager,
32 jobject j_factory,
33 jstring j_name);
34 void RemoveService(JNIEnv* env, jobject j_service_registry, jstring j_name);
35 void ConnectToRemoteService(JNIEnv* env,
36 jobject j_service_registry,
37 jstring j_name,
38 jint handle);
40 const base::android::ScopedJavaGlobalRef<jobject>& GetObj() { return obj_; }
42 private:
43 ServiceRegistryImpl* service_registry_;
44 base::android::ScopedJavaGlobalRef<jobject> obj_;
46 DISALLOW_COPY_AND_ASSIGN(ServiceRegistryAndroid);
49 } // namespace content
51 #endif // CONTENT_BROWSER_MOJO_SERVICE_REGISTRY_ANDROID_H_