JNIEXPORT void JNICALL Java_org_embedded_browser_Chromium_browser_1forward (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->CanGoForward()) { browser->GoForward(); } } }
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; }
JNIEXPORT jboolean JNICALL Java_org_cef_browser_CefBrowser_1N_N_1CanGoForward (JNIEnv *env, jobject obj) { CefRefPtr<CefBrowser> browser = JNI_GET_BROWSER_OR_RETURN(env, obj, JNI_FALSE); return browser->CanGoForward() ? JNI_TRUE : JNI_FALSE; }