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. 4 5 #ifndef CONTENT_BROWSER_ANDROID_JAVA_GIN_JAVA_BOUND_OBJECT_DELEGATE_H_ 6 #define CONTENT_BROWSER_ANDROID_JAVA_GIN_JAVA_BOUND_OBJECT_DELEGATE_H_ 7 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" 11 12 namespace content { 13 14 class GinJavaBoundObjectDelegate 15 : public GinJavaMethodInvocationHelper::ObjectDelegate { 16 public: 17 GinJavaBoundObjectDelegate(scoped_refptr<GinJavaBoundObject> object); 18 virtual ~GinJavaBoundObjectDelegate(); 19 20 virtual base::android::ScopedJavaLocalRef<jobject> GetLocalRef( 21 JNIEnv* env) OVERRIDE; 22 virtual base::android::ScopedJavaLocalRef<jclass> GetLocalClassRef( 23 JNIEnv* env) OVERRIDE; 24 virtual const JavaMethod* FindMethod(const std::string& method_name, 25 size_t num_parameters) OVERRIDE; 26 virtual bool IsObjectGetClassMethod(const JavaMethod* method) OVERRIDE; 27 virtual const base::android::JavaRef<jclass>& GetSafeAnnotationClass() 28 OVERRIDE; 29 30 private: 31 scoped_refptr<GinJavaBoundObject> object_; 32 33 DISALLOW_COPY_AND_ASSIGN(GinJavaBoundObjectDelegate); 34 }; 35 36 } // namespace content 37 38 #endif // CONTENT_BROWSER_ANDROID_JAVA_GIN_JAVA_BOUND_OBJECT_DELEGATE_H_ 39