/*
 * Appends text to Java TextView.
 *
 * Note: Set jni_env, class_obj before calling.
 * Return: 0 (success), 1 (failure)
 */
int appendText(char* input)
{
    JNIEnv* env;
    jclass cls;         /* com.mit.kerberos.KerberosApp */
    jmethodID mid;      /* com.mit.kerberos.KerberosApp.appendText() */
    jstring javaOutput; /* text to append */
  
    env = GetJNIEnv(cached_jvm);
    cls = (*env)->GetObjectClass(env, cached_obj);
    mid = (*env)->GetMethodID(env, cls, "appendText", 
            "(Ljava/lang/String;)V");
    if (mid == 0)
    {
        LOGI("Unable to find Java appendText method");
        return 1;
    }
    else {
        javaOutput = (*env)->NewStringUTF(env, input);
        if (env == NULL || cached_obj == NULL || 
            mid == NULL || javaOutput == NULL)
        {
            LOGI("We have a null variable in native code");
            return 1;
        }
        (*env)->CallVoidMethod(env, cached_obj, mid, javaOutput);
    }
    return 0;
}
bool KeyboardHandler::OnPreKeyEvent(CefRefPtr<CefBrowser> browser,
                           const CefKeyEvent& event,
                           CefEventHandle os_event,
                           bool* is_keyboard_shortcut) {
  JNIEnv* env = GetJNIEnv();
  if (!env)
    return false;

  jobject jevent = getjEvent(env, event);
  if (!jevent)
    return false;

  jobject jboolRef = NewJNIBoolRef(env, *is_keyboard_shortcut);
  if (!jboolRef)
    return false;

  jboolean jresult = JNI_FALSE;
  JNI_CALL_METHOD(env, jhandler_,
                  "onPreKeyEvent",
                  "(Lorg/cef/browser/CefBrowser;Lorg/cef/handler/CefKeyboardHandler$CefKeyEvent;Lorg/cef/misc/BoolRef;)Z",
                  Boolean,
                  jresult,
                  GetJNIBrowser(browser),
                  jevent,
                  jboolRef);

  *is_keyboard_shortcut = GetJNIBoolRef(env, jboolRef);
  return (jresult != JNI_FALSE);
}
void ContextMenuHandler::OnBeforeContextMenu(CefRefPtr<CefBrowser> browser,
                                             CefRefPtr<CefFrame> frame,
                                             CefRefPtr<CefContextMenuParams> params,
                                             CefRefPtr<CefMenuModel> model) {
  JNIEnv* env = GetJNIEnv();
  if (!env)
    return;

  jobject jparams = NewJNIObject(env, "org/cef/callback/CefContextMenuParams_N");
  if (!jparams)
    return;
  jobject jmodel = NewJNIObject(env, "org/cef/callback/CefMenuModel_N");
  if (!jmodel)
    return;

  SetCefForJNIObject(env, jparams, params.get(), "CefContextMenuParams");
  SetCefForJNIObject(env, jmodel, model.get(), "CefMenuModel");

  JNI_CALL_VOID_METHOD(env, jhandler_,
                       "onBeforeContextMenu",
                       "(Lorg/cef/browser/CefBrowser;Lorg/cef/callback/CefContextMenuParams;"
                       "Lorg/cef/callback/CefMenuModel;)V",
                       GetJNIBrowser(browser),
                       jparams,
                       jmodel);

  // Do not keep references to |params| or |model| outside of this callback.
  SetCefForJNIObject<CefContextMenuParams>(env, jparams, NULL, "CefContextMenuParams");
  SetCefForJNIObject<CefMenuModel>(env, jmodel, NULL, "CefMenuModel");
}
示例#4
0
nsJavaXPTCStub::nsJavaXPTCStub(jobject aJavaObject, nsIInterfaceInfo *aIInfo,
                               nsresult *rv)
  : mJavaStrongRef(nsnull)
  , mIInfo(aIInfo)
  , mMaster(nsnull)
  , mWeakRefCnt(0)
{
  const nsIID *iid = nsnull;
  aIInfo->GetIIDShared(&iid);
  NS_ASSERTION(iid, "GetIIDShared must not fail!");

  *rv = InitStub(*iid);
  if (NS_FAILED(*rv))
    return;

  JNIEnv* env = GetJNIEnv();
  jobject weakref = env->NewObject(weakReferenceClass,
                                   weakReferenceConstructorMID, aJavaObject);
  mJavaWeakRef = env->NewGlobalRef(weakref);
  mJavaRefHashCode = env->CallStaticIntMethod(systemClass, hashCodeMID,
                                              aJavaObject);

#ifdef DEBUG_JAVAXPCOM
  char* iid_str = iid->ToString();
  LOG(("+ nsJavaXPTCStub (Java=%08x | XPCOM=%08x | IID=%s)\n",
      (PRUint32) mJavaRefHashCode, (PRUint32) this, iid_str));
  PR_Free(iid_str);
#endif
}
bool RenderHandler::GetScreenPoint(jobject browser,
                                   int viewX,
                                   int viewY,
                                   int& screenX,
                                   int& screenY) {
  JNIEnv* env = GetJNIEnv();
  if (!env)
  	return false;

  jobject jreturn = NULL;
  jobject point_obj = NewJNIPoint(env, viewX, viewY);
  if (!point_obj)
    return false;

  JNI_CALL_METHOD(env, jhandler_, 
                  "getScreenPoint", 
                  "(Lorg/cef/browser/CefBrowser;Ljava/awt/Point;)Ljava/awt/Point;",
                  Object,
                  jreturn, 
                  browser,
                  point_obj);
  if (jreturn) {
    GetJNIPoint(env, jreturn, &screenX, &screenY);
    env->DeleteLocalRef(jreturn);
    return true;
  }
  return false;
}
bool ContextMenuHandler::OnContextMenuCommand(CefRefPtr<CefBrowser> browser,
                                              CefRefPtr<CefFrame> frame,
                                              CefRefPtr<CefContextMenuParams> params,
                                              int command_id,
                                              EventFlags event_flags) {
  JNIEnv* env = GetJNIEnv();
  if (!env)
    return false;

  jobject jparams = NewJNIObject(env, "org/cef/callback/CefContextMenuParams_N");
  if (!jparams)
    return false;
  SetCefForJNIObject(env, jparams, params.get(), "CefContextMenuParams");

  jboolean result = JNI_FALSE;
  JNI_CALL_METHOD(env, jhandler_,
                  "onContextMenuCommand",
                  "(Lorg/cef/browser/CefBrowser;Lorg/cef/callback/CefContextMenuParams;II)Z",
                  Boolean,
                  result,
                  GetJNIBrowser(browser),
                  jparams,
                  (jint)command_id,
                  (jint)event_flags);

  // Do not keep references to |params| or |model| outside of this callback.
  SetCefForJNIObject<CefContextMenuParams>(env, jparams, NULL, "CefContextMenuParams");
  return (result != JNI_FALSE);
}
示例#7
0
void
nsJavaXPTCStub::Destroy()
{
  JNIEnv* env = GetJNIEnv();

#ifdef DEBUG_JAVAXPCOM
  nsIID* iid;
  mIInfo->GetInterfaceIID(&iid);
  char* iid_str = iid->ToString();
  LOG(("- nsJavaXPTCStub (Java=%08x | XPCOM=%08x | IID=%s)\n",
      (PRUint32) mJavaRefHashCode, (PRUint32) this, iid_str));
  PR_Free(iid_str);
  nsMemory::Free(iid);
#endif

  if (!mMaster) {
    // delete each child stub
    for (PRInt32 i = 0; i < mChildren.Count(); i++) {
      delete (nsJavaXPTCStub*) mChildren[i];
    }

    // Since we are destroying this stub, also remove the mapping.
    // It is possible for mJavaStrongRef to be NULL here.  That is why we
    // store the hash code value earlier.
    if (gJavaXPCOMInitialized) {
      gJavaToXPTCStubMap->Remove(mJavaRefHashCode);
    }
  }

  env->CallVoidMethod(mJavaWeakRef, clearReferentMID);
  env->DeleteGlobalRef(mJavaWeakRef);
}
CefRefPtr<CefResourceHandler> SchemeHandlerFactory::Create(
    CefRefPtr<CefBrowser> browser,
    CefRefPtr<CefFrame> frame,
    const CefString& scheme_name,
    CefRefPtr<CefRequest> request) {
  JNIEnv* env = GetJNIEnv();
  if (!env)
    return NULL;

  jobject jRequest = NewJNIObject(env, "org/cef/network/CefRequest_N");
  if (jRequest != NULL)
    SetCefForJNIObject(env, jRequest, request.get(), "CefRequest");

  jobject jResourceHandler = NULL;
  JNI_CALL_METHOD(env, jfactory_, "create",
                  "(Lorg/cef/browser/CefBrowser;Lorg/cef/browser/"
                  "CefFrame;Ljava/lang/String;Lorg/cef/"
                  "network/CefRequest;)Lorg/cef/handler/CefResourceHandler;",
                  Object, jResourceHandler, GetJNIBrowser(browser),
                  GetJNIFrame(env, frame), NewJNIString(env, scheme_name),
                  jRequest);

  if (jRequest != NULL)
    SetCefForJNIObject<CefRequest>(env, jRequest, NULL, "CefRequest");

  if (!jResourceHandler)
    return NULL;
  CefRefPtr<CefResourceHandler> result =
      new ResourceHandler(env, jResourceHandler);
  return result;
}
bool LifeSpanHandler::OnBeforePopup(CefRefPtr<CefBrowser> browser,
                                    CefRefPtr<CefFrame> frame,
                                    const CefString& target_url,
                                    const CefString& target_frame_name,
                                    const CefPopupFeatures& popupFeatures,
                                    CefWindowInfo& windowInfo,
                                    CefRefPtr<CefClient>& client,
                                    CefBrowserSettings& settings,
                                    bool* no_javascript_access) {
  if (browser->GetHost()->IsWindowRenderingDisabled()) {
    // Cancel popups in off-screen rendering mode.
    return true;
  }
  JNIEnv* env = GetJNIEnv();
  if (!env)
    return false;
  jboolean jreturn = JNI_FALSE;
  JNI_CALL_METHOD(env, jhandler_,
                  "onBeforePopup",
                  "(Lorg/cef/browser/CefBrowser;Ljava/lang/String;Ljava/lang/String;)Z",
                  Boolean,
                  jreturn,
                  GetJNIBrowser(browser),
                  NewJNIString(env, target_url),
                  NewJNIString(env, target_frame_name));
  return (jreturn != JNI_FALSE);
}
bool DragHandler::OnDragEnter(CefRefPtr<CefBrowser> browser,
                             CefRefPtr<CefDragData> dragData,
                             CefDragHandler::DragOperationsMask mask) {
  JNIEnv* env = GetJNIEnv();
  if (!env)
    return false;

  jobject jdragdata = NewJNIObject(env, "org/cef/callback/CefDragData_N");
  if (!jdragdata)
    return false;
  SetCefForJNIObject(env, jdragdata, dragData.get(), "CefDragData");

  jboolean result = JNI_FALSE;
  JNI_CALL_METHOD(env, jhandler_,
                  "onDragEnter",
                  "(Lorg/cef/browser/CefBrowser;Lorg/cef/callback/CefDragData;I)Z",
                  Boolean,
                  result,
                  GetJNIBrowser(browser),
                  jdragdata,
                  (jint)mask);

  //Remove native reference from java class
  SetCefForJNIObject<CefDragData>(env, jdragdata, NULL, "CefDragData");
  return (result != JNI_FALSE);
}
示例#11
0
void StringVisitor::Visit(const CefString& string) {
  JNIEnv* env = GetJNIEnv();
  if (!env)
    return;
  JNI_CALL_VOID_METHOD(env, jvisitor_, "visit", "(Ljava/lang/String;)V",
                       NewJNIString(env, string));
}
示例#12
0
bool JSDialogHandler::OnBeforeUnloadDialog(
    CefRefPtr<CefBrowser> browser,
    const CefString& message_text,
    bool is_reload,
    CefRefPtr<CefJSDialogCallback> callback) {
  JNIEnv* env = GetJNIEnv();
  if (!env)
    return false;

  jobject jcallback =
      NewJNIObject(env, "org/cef/callback/CefJSDialogCallback_N");
  if (!jcallback)
    return false;
  SetCefForJNIObject(env, jcallback, callback.get(), "CefJSDialogCallback");

  jboolean jresult = JNI_FALSE;
  JNI_CALL_METHOD(env, jhandler_, "onBeforeUnloadDialog",
                  "(Lorg/cef/browser/CefBrowser;Ljava/lang/String;ZLorg/cef/"
                  "callback/CefJSDialogCallback;)Z",
                  Boolean, jresult, GetJNIBrowser(browser),
                  NewJNIString(env, message_text),
                  (is_reload ? JNI_TRUE : JNI_FALSE), jcallback);

  if (jresult == JNI_FALSE) {
    // If the java method returns "false", the callback won't be used and
    // therefore the reference can be removed.
    SetCefForJNIObject<CefJSDialogCallback>(env, jcallback, NULL,
                                            "CefJSDialogCallback");
  }
  return (jresult != JNI_FALSE);
}
示例#13
0
void JSDialogHandler::OnDialogClosed(CefRefPtr<CefBrowser> browser) {
  JNIEnv* env = GetJNIEnv();
  if (!env)
    return;
  JNI_CALL_VOID_METHOD(env, jhandler_, "onDialogClosed",
                       "(Lorg/cef/browser/CefBrowser;)V",
                       GetJNIBrowser(browser));
}
示例#14
0
void
nsJavaXPTCStub::DeleteStrongRef()
{
  if (mJavaStrongRef == nsnull)
    return;

  GetJNIEnv()->DeleteGlobalRef(mJavaStrongRef);
  mJavaStrongRef = nsnull;
}
示例#15
0
//char* to jstring
jstring JNIUtil::String2Jstring(const char* pat)
{
	JNIEnv *env = NULL;
	env = GetJNIEnv();
	jbyteArray bytes = env->NewByteArray(strlen(pat));
	env->SetByteArrayRegion(bytes, 0, strlen(pat), (jbyte*) pat);
	jstring encoding = env->NewStringUTF("utf-8");
	return (jstring)env->NewObject(m_strClass, m_ctorID, bytes, encoding);
}
void DisplayHandler::OnStatusMessage(CefRefPtr<CefBrowser> browser,
                             const CefString& value) {
  JNIEnv* env = GetJNIEnv();
  if (!env)
    return;
  JNI_CALL_VOID_METHOD(env, jhandler_,
                       "onStatusMessage",
                       "(Lorg/cef/browser/CefBrowser;Ljava/lang/String;)V",
                       GetJNIBrowser(browser),
                       NewJNIString(env, value));
}
void ContextMenuHandler::OnContextMenuDismissed(CefRefPtr<CefBrowser> browser,
                                                CefRefPtr<CefFrame> frame) {
  JNIEnv* env = GetJNIEnv();
  if (!env)
    return;

  JNI_CALL_VOID_METHOD(env, jhandler_,
                       "onContextMenuDismissed",
                       "(Lorg/cef/browser/CefBrowser;)V",
                       GetJNIBrowser(browser));
}
void JniOnDeviceInfoListener::foundDeviceCallback(const OC::OCRepresentation& ocRepresentation)
{
    jint ret;
    JNIEnv *env = GetJNIEnv(ret);
    if (nullptr == env) return;

    jobject jListener = env->NewLocalRef(m_jwListener);
    if (!jListener)
    {
        LOGI("Java onDeviceInfoListener object is already destroyed, quiting");
        checkExAndRemoveListener(env);
        if (JNI_EDETACHED == ret) g_jvm->DetachCurrentThread();
        return;
    }

    OCRepresentation* rep = new OCRepresentation(ocRepresentation);
    jlong handle = reinterpret_cast<jlong>(rep);
    jobject jRepresentation = env->NewObject(g_cls_OcRepresentation, g_mid_OcRepresentation_N_ctor_bool,
                              handle, true);
    if (!jRepresentation)
    {
        delete rep;
        checkExAndRemoveListener(env);
        if (JNI_EDETACHED == ret) g_jvm->DetachCurrentThread();
        return;
    }

    jclass clsL = env->GetObjectClass(jListener);
    if (!clsL)
    {
        delete rep;
        checkExAndRemoveListener(env);
        if (JNI_EDETACHED == ret) g_jvm->DetachCurrentThread();
        return;
    }
    jmethodID midL = env->GetMethodID(clsL, "onDeviceFound", "(Lorg/iotivity/base/OcRepresentation;)V");
    if (!midL)
    {
        delete rep;
        checkExAndRemoveListener(env);
        if (JNI_EDETACHED == ret) g_jvm->DetachCurrentThread();
        return;
    }

    env->CallVoidMethod(jListener, midL, jRepresentation);
    if (env->ExceptionCheck())
    {
        LOGE("Java exception is thrown");
        delete rep;
        checkExAndRemoveListener(env);
    }

    if (JNI_EDETACHED == ret) g_jvm->DetachCurrentThread();
}
void RenderHandler::OnPopupShow(CefRefPtr<CefBrowser> browser,
                                bool show) {
  JNIEnv* env = GetJNIEnv();
  if (!env)
  	return;
  JNI_CALL_VOID_METHOD(env, jhandler_, 
                       "onPopupShow", 
                       "(Lorg/cef/browser/CefBrowser;Z)V", 
                       GetJNIBrowser(browser),
                       (jboolean)show);
}
示例#20
0
bool JSDialogHandler::OnJSDialog(CefRefPtr<CefBrowser> browser,
                                 const CefString& origin_url,
                                 CefJSDialogHandler::JSDialogType dialog_type,
                                 const CefString& message_text,
                                 const CefString& default_prompt_text,
                                 CefRefPtr<CefJSDialogCallback> callback,
                                 bool& suppress_message) {
  JNIEnv* env = GetJNIEnv();
  if (!env)
    return false;

  jobject jdialogType = NULL;
  switch (dialog_type) {
    default:
      JNI_CASE(env, "org/cef/handler/CefJSDialogHandler$JSDialogType",
               JSDIALOGTYPE_ALERT, jdialogType);
      JNI_CASE(env, "org/cef/handler/CefJSDialogHandler$JSDialogType",
               JSDIALOGTYPE_CONFIRM, jdialogType);
      JNI_CASE(env, "org/cef/handler/CefJSDialogHandler$JSDialogType",
               JSDIALOGTYPE_PROMPT, jdialogType);
  }

  jobject jboolRef = NewJNIBoolRef(env, suppress_message);
  if (!jboolRef)
    return false;

  jobject jcallback =
      NewJNIObject(env, "org/cef/callback/CefJSDialogCallback_N");
  if (!jcallback)
    return false;
  SetCefForJNIObject(env, jcallback, callback.get(), "CefJSDialogCallback");

  jboolean jresult = JNI_FALSE;
  JNI_CALL_METHOD(
      env, jhandler_, "onJSDialog",
      "(Lorg/cef/browser/CefBrowser;Ljava/lang/String;"
      "Lorg/cef/handler/CefJSDialogHandler$JSDialogType;Ljava/lang/String;"
      "Ljava/lang/String;Lorg/cef/callback/CefJSDialogCallback;Lorg/cef/misc/"
      "BoolRef;)Z",
      Boolean, jresult, GetJNIBrowser(browser), NewJNIString(env, origin_url),
      jdialogType, NewJNIString(env, message_text),
      NewJNIString(env, default_prompt_text), jcallback, jboolRef);

  suppress_message = GetJNIBoolRef(env, jboolRef);

  if (jresult == JNI_FALSE) {
    // If the java method returns "false", the callback won't be used and
    // therefore the reference can be removed.
    SetCefForJNIObject<CefJSDialogCallback>(env, jcallback, NULL,
                                            "CefJSDialogCallback");
  }
  return (jresult != JNI_FALSE);
}
void DisplayHandler::OnAddressChange(CefRefPtr<CefBrowser> browser,
                             CefRefPtr<CefFrame> frame,
                             const CefString& url) {
  JNIEnv* env = GetJNIEnv();
  if (!env)
  	return;
  JNI_CALL_VOID_METHOD(env, jhandler_, 
                       "onAddressChange", 
                       "(Lorg/cef/browser/CefBrowser;Ljava/lang/String;)V", 
                       GetJNIBrowser(browser),
                       NewJNIString(env, url));
}
void LifeSpanHandler::OnBeforeClose(CefRefPtr<CefBrowser> browser) {
  REQUIRE_UI_THREAD();
  JNIEnv* env = GetJNIEnv();
  if (!env)
    return;
  JNI_CALL_VOID_METHOD(env, jhandler_,
                       "onBeforeClose",
                       "(Lorg/cef/browser/CefBrowser;)V",
                       GetJNIBrowser(browser));
  CefRefPtr<ClientHandler> client = (ClientHandler*)browser->GetHost()->GetClient().get();
  client->OnBeforeClose(browser);
}
示例#23
0
/*
 * Is called automatically when library is unloaded.
 */
JNIEXPORT void JNICALL JNI_OnUnload(JavaVM *jvm, void *reserved)
{
    JNIEnv *env;

    if( (env = GetJNIEnv(jvm)) == NULL) {
        return;
    }

    (*env)->DeleteGlobalRef(env, cached_obj);
    return;

}
UpnpWebFileHandle CESContentDirectory_Device_Android::FileOpen(const char *filename,IN enum UpnpOpenFileMode Mode)
{
	int nret = 0;
//	if(strcasecmp(SPECIAL_DEVICE,filename) == 0)
//	{
//		return (UpnpWebFileHandle)m_pSpecialDevice->FileOpen();
//	}
	
	JNIEnv *env = GetJNIEnv();
	jstring jid = env->NewStringUTF(filename);
	jobject jreturn = env->CallObjectMethod(m_jCallback,methIdGetFileInfo,jid);
	if(!jreturn)
	{
		Trace("File not found %s\n",filename);
		nret = -1;
	}
	else
	{
		jstring jrealPath = (jstring)env->GetObjectField(jreturn,MetaDataInfo::jrealPath);
		if(jrealPath)
		{
			icstring realpath = env->GetStringUTFChars(jrealPath,NULL);

			int fd = open(realpath,O_RDONLY);
			if(fd == -1)
			{
				Trace("fail to open %s\n",realpath);
				nret = -1;
			}
			else
			{
				IUpnpUtil::CQuickRWLock rwLock(&m_lock,FALSE);
				m_fileHandleList.push_back(fd);
				nret = fd;
			}

			env->ReleaseStringUTFChars(jrealPath,realpath);
		}
		else
		{
			nret = -1;
		}
	}
	if(jid)
		env->DeleteLocalRef(jid);
	if(jreturn)
		env->DeleteLocalRef(jreturn);

	DetachJNIThread();
	Trace("File opened %d\n",nret);
	return (UpnpWebFileHandle)nret ;

}
void RenderHandler::OnCursorChange(CefRefPtr<CefBrowser> browser,
                            CefCursorHandle cursor) {
  JNIEnv* env = GetJNIEnv();
  if (!env)
  	return;
  const int cursorId = NativeGetCursorId(cursor);
  JNI_CALL_VOID_METHOD(env, jhandler_, 
                       "onCursorChange", 
                       "(Lorg/cef/browser/CefBrowser;I)V", 
                       GetJNIBrowser(browser),
                       cursorId);
}
示例#26
0
JniOnGetListener::~JniOnGetListener()
{
    if (m_jwListener)
    {
        jint ret;
        JNIEnv *env = GetJNIEnv(ret);
        if (NULL == env) return;

        env->DeleteWeakGlobalRef(m_jwListener);

        if (JNI_EDETACHED == ret) g_jvm->DetachCurrentThread();
    }
}
JniOnPresenceListener::~JniOnPresenceListener()
{
    LOGD("~JniOnPresenceListener");
    if (m_jwListener)
    {
        jint ret;
        JNIEnv *env = GetJNIEnv(ret);
        if (NULL == env) return;
        env->DeleteWeakGlobalRef(m_jwListener);
        m_jwListener = nullptr;
        if (JNI_EDETACHED == ret) g_jvm->DetachCurrentThread();
    }
}
bool LifeSpanHandler::DoClose(CefRefPtr<CefBrowser> browser) {
  JNIEnv* env = GetJNIEnv();
  if (!env)
    return false;
  jboolean jreturn = JNI_FALSE;
  JNI_CALL_METHOD(env, jhandler_,
                  "doClose",
                  "(Lorg/cef/browser/CefBrowser;)Z",
                  Boolean,
                  jreturn,
                  GetJNIBrowser(browser));
  return (jreturn != JNI_FALSE);
}
void WindowHandler::OnMouseEvent(CefRefPtr<CefBrowser> browser, int mouseEvent,
    int absX, int absY, int modifier, int button) {
  JNIEnv* env = GetJNIEnv();
  if (!env)
    return;
  JNI_CALL_VOID_METHOD(env, jhandler_,
                       "onMouseEvent",
                       "(Lorg/cef/browser/CefBrowser;IIIII)V",
                       GetJNIBrowser(browser),
                       (jint)mouseEvent,
                       (jint)absX,
                       (jint)absY,
                       (jint)modifier,
                       (jint)button);
}
void RenderHandler::OnPopupSize(CefRefPtr<CefBrowser> browser,
                                const CefRect& rect) {
  JNIEnv* env = GetJNIEnv();
  if (!env)
  	return;
  jobject rect_obj = NewJNIRect(env, rect);
  if (!rect_obj)
    return;
  JNI_CALL_VOID_METHOD(env, jhandler_, 
                       "onPopupSize", 
                       "(Lorg/cef/browser/CefBrowser;Ljava/awt/Rectangle;)V", 
                       GetJNIBrowser(browser),
                       rect_obj);
  env->DeleteLocalRef(rect_obj);
}