Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / content / browser / android / java / gin_java_bound_object_delegate.h
blobcdee8a61c6cfa58935c0dec2a98377931ad8986c
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_ANDROID_JAVA_GIN_JAVA_BOUND_OBJECT_DELEGATE_H_
6 #define CONTENT_BROWSER_ANDROID_JAVA_GIN_JAVA_BOUND_OBJECT_DELEGATE_H_
8 #include "base/memory/ref_counted.h"
9 #include "content/browser/android/java/gin_java_bound_object.h"
10 #include "content/browser/android/java/gin_java_method_invocation_helper.h"
12 namespace content {
14 class GinJavaBoundObjectDelegate
15 : public GinJavaMethodInvocationHelper::ObjectDelegate {
16 public:
17 GinJavaBoundObjectDelegate(scoped_refptr<GinJavaBoundObject> object);
18 ~GinJavaBoundObjectDelegate() override;
20 base::android::ScopedJavaLocalRef<jobject> GetLocalRef(JNIEnv* env) override;
21 base::android::ScopedJavaLocalRef<jclass> GetLocalClassRef(
22 JNIEnv* env) override;
23 const JavaMethod* FindMethod(const std::string& method_name,
24 size_t num_parameters) override;
25 bool IsObjectGetClassMethod(const JavaMethod* method) override;
26 const base::android::JavaRef<jclass>& GetSafeAnnotationClass() override;
28 private:
29 scoped_refptr<GinJavaBoundObject> object_;
31 DISALLOW_COPY_AND_ASSIGN(GinJavaBoundObjectDelegate);
34 } // namespace content
36 #endif // CONTENT_BROWSER_ANDROID_JAVA_GIN_JAVA_BOUND_OBJECT_DELEGATE_H_