Next really will be to get POST working.
A test/automated/src/classes/org/mozilla/webclient/DocumentLoadListenerImpl.java
- Forgot to add this.
M classes_spec/org/mozilla/webclient/impl/wrapper_native/HistoryImpl.java
M src_moz/HistoryImpl.cpp
- push through can{back,forward}(), forward().
M test/automated/src/classes/org/mozilla/webclient/HistoryTest.java
- exercise new methods.
git-svn-id: svn://10.0.0.236/trunk@158380 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
@@ -55,38 +55,80 @@ Java_org_mozilla_webclient_impl_wrapper_1native_HistoryImpl_nativeBack
|
||||
return;
|
||||
}
|
||||
|
||||
/*******************
|
||||
|
||||
JNIEXPORT jboolean
|
||||
JNICALL Java_org_mozilla_webclient_impl_wrapper_1native_HistoryImpl_nativeCanBack
|
||||
(JNIEnv *env, jobject obj, jint nativeBCPtr)
|
||||
{
|
||||
jboolean result = JNI_FALSE;
|
||||
JNIEnv * pEnv = env;
|
||||
jobject jobj = obj;
|
||||
void * voidResult;
|
||||
// PRBool voidResult;
|
||||
JNIEnv * pEnv = env;
|
||||
jobject jobj = obj;
|
||||
|
||||
NativeBrowserControl* initContext = (NativeBrowserControl *) nativeBCPtr;
|
||||
NativeBrowserControl* nativeBrowserControl = (NativeBrowserControl *) nativeBCPtr;
|
||||
|
||||
if (initContext == nsnull) {
|
||||
::util_ThrowExceptionToJava(env, "Exception: null nativeBCPtr passed to raptorWebShellCanBack");
|
||||
return result;
|
||||
}
|
||||
if (nativeBrowserControl == nsnull) {
|
||||
::util_ThrowExceptionToJava(env, "Exception: null nativeBCPtr passed to nativeCanBack");
|
||||
return result;
|
||||
}
|
||||
|
||||
if (initContext->initComplete) {
|
||||
wsCanBackEvent * actionEvent =
|
||||
new wsCanBackEvent(initContext->webNavigation);
|
||||
PLEvent * event = (PLEvent*) *actionEvent;
|
||||
|
||||
voidResult = ::util_PostSynchronousEvent(initContext, event);
|
||||
|
||||
result = (PR_FALSE == ((PRBool) voidResult)) ? JNI_FALSE : JNI_TRUE;
|
||||
nsresult rv =
|
||||
nativeBrowserControl->mNavigation->GetCanGoBack((PRBool *) &result);
|
||||
if (NS_FAILED(rv)) {
|
||||
::util_ThrowExceptionToJava(env, "Exception: Can't GetCanGoBack");
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
JNIEXPORT void JNICALL
|
||||
Java_org_mozilla_webclient_impl_wrapper_1native_HistoryImpl_nativeForward
|
||||
(JNIEnv *env, jobject obj, jint nativeBCPtr)
|
||||
{
|
||||
JNIEnv * pEnv = env;
|
||||
jobject jobj = obj;
|
||||
|
||||
NativeBrowserControl* nativeBrowserControl = (NativeBrowserControl *) nativeBCPtr;
|
||||
|
||||
if (nativeBrowserControl == nsnull) {
|
||||
::util_ThrowExceptionToJava(env, "Exception: null nativeBCPtr passed to nativeForward");
|
||||
return;
|
||||
}
|
||||
|
||||
nsresult rv =
|
||||
nativeBrowserControl->mNavigation->GoForward();
|
||||
if (NS_FAILED(rv)) {
|
||||
::util_ThrowExceptionToJava(env, "Exception: Can't GoForward");
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
JNIEXPORT jboolean
|
||||
JNICALL Java_org_mozilla_webclient_impl_wrapper_1native_HistoryImpl_nativeCanForward
|
||||
(JNIEnv *env, jobject obj, jint nativeBCPtr)
|
||||
{
|
||||
jboolean result = JNI_FALSE;
|
||||
JNIEnv * pEnv = env;
|
||||
jobject jobj = obj;
|
||||
|
||||
NativeBrowserControl* nativeBrowserControl = (NativeBrowserControl *) nativeBCPtr;
|
||||
|
||||
if (nativeBrowserControl == nsnull) {
|
||||
::util_ThrowExceptionToJava(env, "Exception: null nativeBCPtr passed to nativeCanForward");
|
||||
return result;
|
||||
}
|
||||
|
||||
nsresult rv =
|
||||
nativeBrowserControl->mNavigation->GetCanGoForward((PRBool *) &result);
|
||||
if (NS_FAILED(rv)) {
|
||||
::util_ThrowExceptionToJava(env, "Exception: Can't GetCanGoForward");
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
/*******************
|
||||
|
||||
JNIEXPORT jobjectArray JNICALL Java_org_mozilla_webclient_impl_wrapper_1native_HistoryImpl_nativeGetBackList
|
||||
(JNIEnv *env, jobject obj, jint nativeBCPtr)
|
||||
{
|
||||
@@ -102,58 +144,6 @@ Java_org_mozilla_webclient_impl_wrapper_1native_HistoryImpl_nativeClearHistory
|
||||
|
||||
}
|
||||
|
||||
JNIEXPORT void JNICALL Java_org_mozilla_webclient_impl_wrapper_1native_HistoryImpl_nativeForward
|
||||
(JNIEnv *env, jobject obj, jint nativeBCPtr)
|
||||
{
|
||||
JNIEnv * pEnv = env;
|
||||
jobject jobj = obj;
|
||||
|
||||
NativeBrowserControl* initContext = (NativeBrowserControl *) nativeBCPtr;
|
||||
|
||||
if (initContext == nsnull) {
|
||||
::util_ThrowExceptionToJava(env, "Exception: null nativeBCPtr passed to raptorWebShellForward");
|
||||
return;
|
||||
}
|
||||
|
||||
if (initContext->initComplete) {
|
||||
wsForwardEvent * actionEvent =
|
||||
new wsForwardEvent(initContext->webNavigation);
|
||||
PLEvent * event = (PLEvent*) *actionEvent;
|
||||
|
||||
::util_PostEvent(initContext, event);
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
JNIEXPORT jboolean JNICALL Java_org_mozilla_webclient_impl_wrapper_1native_HistoryImpl_nativeCanForward
|
||||
(JNIEnv *env, jobject obj, jint nativeBCPtr)
|
||||
{
|
||||
jboolean result = JNI_FALSE;
|
||||
JNIEnv * pEnv = env;
|
||||
jobject jobj = obj;
|
||||
void * voidResult;
|
||||
|
||||
NativeBrowserControl* initContext = (NativeBrowserControl *) nativeBCPtr;
|
||||
|
||||
if (initContext == nsnull) {
|
||||
::util_ThrowExceptionToJava(env, "Exception: null nativeBCPtr passed to raptorWebShellCanForward");
|
||||
return result;
|
||||
}
|
||||
|
||||
if (initContext->initComplete) {
|
||||
wsCanForwardEvent * actionEvent =
|
||||
new wsCanForwardEvent(initContext->webNavigation);
|
||||
PLEvent * event = (PLEvent*) *actionEvent;
|
||||
|
||||
voidResult = ::util_PostSynchronousEvent(initContext, event);
|
||||
|
||||
result = (PR_FALSE == ((PRBool) voidResult)) ? JNI_FALSE : JNI_TRUE;
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
JNIEXPORT jobjectArray JNICALL Java_org_mozilla_webclient_impl_wrapper_1native_HistoryImpl_nativeGetForwardList
|
||||
(JNIEnv *env, jobject obj, jint nativeBCPtr)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user