JNIEXPORT void JNICALL Java_org_embedded_browser_Chromium_browser_1back
  (JNIEnv *env, jobject jobj, jlong gh)
{
  CefRefPtr<ClientHandler> g_handler_local = (ClientHandler*)gh;
  if (g_handler_local.get()) {
    CefRefPtr<CefBrowser> browser = g_handler_local->GetBrowser();
    if (browser.get() && browser->CanGoBack()) {
      browser->GoBack();
    }
  }
}
Exemple #2
0
    void ClientAdapter::OnLoadEnd(CefRefPtr<CefBrowser> browser, CefRefPtr<CefFrame> frame, int httpStatusCode)
    {
        if(browser->IsPopup())
        {
            return;
        }

        AutoLock lock_scope(this);
        if (frame->IsMain())
        {
            _browserControl->SetNavState(false, browser->CanGoBack(), browser->CanGoForward());        
        }

        _browserControl->FrameLoadComplete(frame);
    }
 CefHandler::RetVal HandlerAdapter::HandleLoadEnd(CefRefPtr<CefBrowser> browser, CefRefPtr<CefFrame> frame)
 {
     if(!browser->IsPopup())
     {
         Lock();
         if(!frame.get())
         {
             _browserControl->SetNavState(false, browser->CanGoBack(), browser->CanGoForward());        
         }
         _browserControl->FrameLoadComplete(frame);
         Unlock();
     }
     
     return RV_CONTINUE;
 }
Exemple #4
0
JNIEXPORT jboolean JNICALL Java_org_cef_browser_CefBrowser_1N_N_1CanGoBack
  (JNIEnv *env, jobject obj) {
  CefRefPtr<CefBrowser> browser = JNI_GET_BROWSER_OR_RETURN(env, obj,
                                                            JNI_FALSE);
  return browser->CanGoBack() ? JNI_TRUE : JNI_FALSE;
}