Ok after this checkin we now have all the functionality of Sun's JDIC
WebBrowser <https://jdic.dev.java.net/nonav/documentation/javadoc/jdic/org/jdesktop/jdic/browser/WebBrowser.html>, with the following exceptions: - we're based on mozilla 1.6 - it only works on windows - we don't have mouse event support - we only support mozilla, not IE So, webclient still has a ways to go until we reach its former glory. However, I'm going to get together a 2.0 alpha release, including build instructions, from what we have now. I'd love it if someone could get the unit tests working on GNU/Linux again. I think the problem has to do with our old friend GDKSUPERWIN. M webclient/classes_spec/org/mozilla/webclient/impl/wrapper_native/NavigationImpl.java M webclient/src_moz/NavigationImpl.cpp - re-enable POST M webclient/src_moz/EmbedWindow.cpp M webclient/src_moz/EmbedWindow.h - expose DocShell post method. M webclient/test/automated/src/classes/org/mozilla/util/THTTPD.java M webclient/test/automated/src/classes/org/mozilla/webclient/NavigationTest.java - test code for POST git-svn-id: svn://10.0.0.236/trunk@158414 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
@@ -43,7 +43,7 @@
|
||||
#include "nsIInputStream.h"
|
||||
#include "nsIURI.h"
|
||||
#include "nsIDocShellLoadInfo.h"
|
||||
|
||||
#include "nsNetUtil.h" // for NS_NewPostDataStream
|
||||
|
||||
#include "NativeBrowserControl.h"
|
||||
#include "EmbedWindow.h"
|
||||
@@ -284,6 +284,67 @@ EmbedWindow::LoadStream(nsIInputStream *aStream, nsIURI * aURI,
|
||||
aLoadInfo);
|
||||
}
|
||||
|
||||
nsresult
|
||||
EmbedWindow::Post(nsIURI *absoluteURL,
|
||||
const PRUnichar *target,
|
||||
PRInt32 targetLength,
|
||||
PRInt32 postDataLength,
|
||||
const char *postData,
|
||||
PRInt32 postHeadersLength,
|
||||
const char *postHeaders)
|
||||
{
|
||||
nsresult rv = NS_ERROR_FAILURE;
|
||||
|
||||
nsCOMPtr<nsIDocShell> docShell = do_GetInterface(mWebBrowser);
|
||||
nsCOMPtr<nsIDocShellLoadInfo> docShellLoadInfo = nsnull;
|
||||
if (!docShell) {
|
||||
return rv;
|
||||
}
|
||||
|
||||
rv = docShell->CreateLoadInfo(getter_AddRefs(docShellLoadInfo));
|
||||
|
||||
if (NS_FAILED(rv)) {
|
||||
return rv;
|
||||
}
|
||||
|
||||
docShellLoadInfo->SetReferrer(absoluteURL);
|
||||
docShellLoadInfo->SetLoadType(nsIDocShellLoadInfo::loadNormalReplace);
|
||||
docShellLoadInfo->SetInheritOwner(PR_TRUE);
|
||||
docShellLoadInfo->SetTarget(target);
|
||||
|
||||
// create the streams
|
||||
nsCOMPtr<nsIInputStream> postDataStream = nsnull;
|
||||
nsCOMPtr<nsIInputStream> headersDataStream = nsnull;
|
||||
nsCOMPtr<nsIInputStream> inputStream = nsnull;
|
||||
|
||||
if (postData) {
|
||||
nsCAutoString postDataStr(postData);
|
||||
NS_NewPostDataStream(getter_AddRefs(postDataStream),
|
||||
PR_FALSE,
|
||||
postDataStr, 0);
|
||||
}
|
||||
|
||||
if (postHeaders) {
|
||||
NS_NewByteInputStream(getter_AddRefs(inputStream),
|
||||
postHeaders, postHeadersLength);
|
||||
if (inputStream) {
|
||||
headersDataStream = do_QueryInterface(inputStream, &rv);
|
||||
}
|
||||
|
||||
if (NS_FAILED(rv)) {
|
||||
return rv;
|
||||
}
|
||||
}
|
||||
|
||||
docShellLoadInfo->SetPostDataStream(postDataStream);
|
||||
docShellLoadInfo->SetHeadersStream(headersDataStream);
|
||||
|
||||
rv = docShell->LoadURI(absoluteURL, docShellLoadInfo,
|
||||
nsIWebNavigation::LOAD_FLAGS_NONE, PR_TRUE);
|
||||
|
||||
return rv;
|
||||
}
|
||||
|
||||
nsresult
|
||||
EmbedWindow::AddWebBrowserListener(nsIWeakReference *aListener,
|
||||
const nsIID & aIID)
|
||||
|
||||
Reference in New Issue
Block a user