r=edburns
Author: Ron Capelli
These changes make webclient run with Mozilla 1.4.
Summary of changes:
src_moz/rdf_util.cpp
reason: API change to RDFServiceImpl::GetResource()
src_moz/RDFActionEvents.cpp
reason: API change to RDFServiceImpl::GetUnicodeResource()
src_moz/wsRDFObserver.cpp
reason: member name changes to inherited nsIRDFObserver
src_moz/CBrowserContainer.cpp
reasons:
- replaced obsolete/deleted nsFileSpec.h with nsCRT.h
(to access only required/referenced function)
- added new SetBlurSuppression and GetBlurSuppression methods
required by change to inherited nsIBaseWindow (implementation
copied from mozilla/xpfe/appshell/src/nsXULWindow.cpp).
src_moz/CBrowserContainer.h
reason: added mBlurSuppressionLevel member variable for
SetBlurSuppression and GetBlurSuppression methods.
The changes were relatively straightforward to identify from errors
attempting to build with Mozilla 1.4. Testing so far indicates no
new problems have been introduced...
git-svn-id: svn://10.0.0.236/trunk@144789 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
@@ -39,7 +39,7 @@
|
||||
#include "prprf.h" // for PR_snprintf
|
||||
#include "nsReadableUtils.h"
|
||||
#include "nsXPIDLString.h"
|
||||
#include "nsFileSpec.h" // for nsAutoCString
|
||||
#include "nsCRT.h"
|
||||
|
||||
#include "dom_util.h"
|
||||
|
||||
@@ -56,7 +56,8 @@ CBrowserContainer::CBrowserContainer(nsIWebBrowser *pOwner, JNIEnv *env,
|
||||
m_pOwner(pOwner), mJNIEnv(env), mInitContext(yourInitContext),
|
||||
mDocTarget(nsnull), mMouseTarget(nsnull), mPrompt(nsnull),
|
||||
mDomEventTarget(nsnull), inverseDepth(-1),
|
||||
properties(nsnull), currentDOMEvent(nsnull)
|
||||
properties(nsnull), currentDOMEvent(nsnull),
|
||||
mBlurSuppressionLevel(0)
|
||||
{
|
||||
NS_INIT_ISUPPORTS();
|
||||
// initialize the string constants (including properties keys)
|
||||
@@ -1165,6 +1166,28 @@ CBrowserContainer::SetTitle(const PRUnichar * aTitle)
|
||||
return NS_ERROR_FAILURE;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
CBrowserContainer::SetBlurSuppression(PRBool aBlurSuppression)
|
||||
{
|
||||
if (aBlurSuppression)
|
||||
++mBlurSuppressionLevel;
|
||||
else
|
||||
{
|
||||
NS_ASSERTION(mBlurSuppressionLevel > 0, "blur over-allowed");
|
||||
if (mBlurSuppressionLevel > 0)
|
||||
--mBlurSuppressionLevel;
|
||||
}
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
CBrowserContainer::GetBlurSuppression(PRBool *aBlurSuppression)
|
||||
{
|
||||
NS_ENSURE_ARG_POINTER(aBlurSuppression);
|
||||
*aBlurSuppression = (mBlurSuppressionLevel > 0);
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
// nsIWebBrowserChrome implementation
|
||||
|
||||
@@ -89,6 +89,7 @@ protected:
|
||||
jobject mMouseTarget;
|
||||
jobject mPrompt;
|
||||
nsCOMPtr<nsIDOMEventTarget> mDomEventTarget;
|
||||
PRInt32 mBlurSuppressionLevel;
|
||||
static PRInt32 mInstanceCount;
|
||||
|
||||
//
|
||||
@@ -96,25 +97,19 @@ protected:
|
||||
//
|
||||
|
||||
/**
|
||||
|
||||
* 0 is the leaf depth. That's why we call it the inverse depth.
|
||||
|
||||
*/
|
||||
|
||||
PRInt32 inverseDepth;
|
||||
|
||||
/**
|
||||
|
||||
* The properties table, created during a mouseEvent handler
|
||||
|
||||
*/
|
||||
|
||||
jobject properties;
|
||||
|
||||
/**
|
||||
|
||||
* the nsIDOMEvent in the current event
|
||||
|
||||
*/
|
||||
|
||||
nsCOMPtr<nsIDOMEvent> currentDOMEvent;
|
||||
@@ -157,33 +152,29 @@ public:
|
||||
NS_IMETHOD BeginLoadURL(nsIWebShell* aShell,
|
||||
const PRUnichar* aURL);
|
||||
|
||||
|
||||
NS_IMETHOD EndLoadURL(nsIWebShell* aShell,
|
||||
const PRUnichar* aURL,
|
||||
nsresult aStatus);
|
||||
|
||||
protected:
|
||||
//
|
||||
// Local methods
|
||||
//
|
||||
jobject JNICALL getPropertiesFromEvent(nsIDOMEvent *aMouseEvent);
|
||||
//
|
||||
// Local methods
|
||||
//
|
||||
jobject JNICALL getPropertiesFromEvent(nsIDOMEvent *aMouseEvent);
|
||||
|
||||
void JNICALL addMouseEventDataToProperties(nsIDOMEvent *aMouseEvent);
|
||||
|
||||
/**
|
||||
void JNICALL addMouseEventDataToProperties(nsIDOMEvent *aMouseEvent);
|
||||
|
||||
/**
|
||||
* Called from our nsIWebProgressListener.OnStateChanged()
|
||||
|
||||
*/
|
||||
|
||||
nsresult JNICALL doStartDocumentLoad(const PRUnichar *documentName);
|
||||
nsresult JNICALL doEndDocumentLoad(nsIWebProgress *aWebProgress);
|
||||
nsresult JNICALL doStartURLLoad(const PRUnichar *documentName);
|
||||
nsresult JNICALL doEndURLLoad(const PRUnichar *documentName);
|
||||
nsresult JNICALL doStartDocumentLoad(const PRUnichar *documentName);
|
||||
nsresult JNICALL doEndDocumentLoad(nsIWebProgress *aWebProgress);
|
||||
nsresult JNICALL doStartURLLoad(const PRUnichar *documentName);
|
||||
nsresult JNICALL doEndURLLoad(const PRUnichar *documentName);
|
||||
|
||||
static nsresult JNICALL takeActionOnNode(nsCOMPtr<nsIDOMNode> curNode,
|
||||
static nsresult JNICALL takeActionOnNode(nsCOMPtr<nsIDOMNode> curNode,
|
||||
void *yourObject);
|
||||
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
@@ -116,7 +116,7 @@ wsNewRDFNodeEvent::handleEvent ()
|
||||
// PENDING(edburns): does this leak?
|
||||
PRUnichar *uriUni = ToNewUnicode(uri);
|
||||
|
||||
rv = gRDF->GetUnicodeResource(uriUni, getter_AddRefs(newNode));
|
||||
rv = gRDF->GetUnicodeResource(nsDependentString(uriUni), getter_AddRefs(newNode));
|
||||
nsCRT::free(uriUni);
|
||||
if (NS_FAILED(rv)) {
|
||||
::util_ThrowExceptionToJava(env, "Exception: nativeNewRDFNode: can't create new nsIRDFResource.");
|
||||
|
||||
@@ -23,6 +23,7 @@
|
||||
#include "rdf_util.h"
|
||||
|
||||
#include "ns_globals.h" // for prLogModuleInfo and gComponentManager
|
||||
#include "nsString.h"
|
||||
|
||||
#include "nsIServiceManager.h"
|
||||
|
||||
@@ -108,7 +109,7 @@ nsresult rdf_InitRDFUtils()
|
||||
// init the properties
|
||||
// find the nsIRDFResource for the bookmarks
|
||||
if (nsnull == kNC_BookmarksRoot) {
|
||||
rv = gRDF->GetResource(BOOKMARKS_URI,
|
||||
rv = gRDF->GetResource(nsDependentCString(BOOKMARKS_URI),
|
||||
getter_AddRefs(kNC_BookmarksRoot));
|
||||
if (NS_FAILED(rv)) {
|
||||
return rv;
|
||||
@@ -116,7 +117,7 @@ nsresult rdf_InitRDFUtils()
|
||||
}
|
||||
|
||||
if (nsnull == kNC_Name) {
|
||||
rv = gRDF->GetResource("http://home.netscape.com/NC-rdf#Name",
|
||||
rv = gRDF->GetResource(NS_LITERAL_CSTRING("http://home.netscape.com/NC-rdf#Name"),
|
||||
getter_AddRefs(kNC_Name));
|
||||
if (NS_FAILED(rv)) {
|
||||
return rv;
|
||||
@@ -124,21 +125,21 @@ nsresult rdf_InitRDFUtils()
|
||||
}
|
||||
|
||||
if (nsnull == kNC_URL) {
|
||||
rv = gRDF->GetResource("http://home.netscape.com/NC-rdf#URL",
|
||||
rv = gRDF->GetResource(NS_LITERAL_CSTRING("http://home.netscape.com/NC-rdf#URL"),
|
||||
getter_AddRefs(kNC_URL));
|
||||
if (NS_FAILED(rv)) {
|
||||
return rv;
|
||||
}
|
||||
}
|
||||
if (nsnull == kNC_parent) {
|
||||
rv = gRDF->GetResource("http://home.netscape.com/NC-rdf#parent",
|
||||
rv = gRDF->GetResource(NS_LITERAL_CSTRING("http://home.netscape.com/NC-rdf#parent"),
|
||||
getter_AddRefs(kNC_parent));
|
||||
if (NS_FAILED(rv)) {
|
||||
return rv;
|
||||
}
|
||||
}
|
||||
if (nsnull == kNC_Folder) {
|
||||
rv = gRDF->GetResource("http://home.netscape.com/NC-rdf#Folder",
|
||||
rv = gRDF->GetResource(NS_LITERAL_CSTRING("http://home.netscape.com/NC-rdf#Folder"),
|
||||
getter_AddRefs(kNC_Folder));
|
||||
if (NS_FAILED(rv)) {
|
||||
return rv;
|
||||
@@ -146,21 +147,21 @@ nsresult rdf_InitRDFUtils()
|
||||
}
|
||||
|
||||
if (nsnull == kRDF_type) {
|
||||
rv = gRDF->GetResource("http://www.w3.org/1999/02/22-rdf-syntax-ns",
|
||||
rv = gRDF->GetResource(NS_LITERAL_CSTRING("http://www.w3.org/1999/02/22-rdf-syntax-ns"),
|
||||
getter_AddRefs(kRDF_type));
|
||||
if (NS_FAILED(rv)) {
|
||||
return rv;
|
||||
}
|
||||
}
|
||||
if (nsnull == kNewFolderCommand) {
|
||||
rv = gRDF->GetResource("http://home.netscape.com/NC-rdf#command?cmd=newfolder",
|
||||
rv = gRDF->GetResource(NS_LITERAL_CSTRING("http://home.netscape.com/NC-rdf#command?cmd=newfolder"),
|
||||
getter_AddRefs(kNewFolderCommand));
|
||||
if (NS_FAILED(rv)) {
|
||||
return rv;
|
||||
}
|
||||
}
|
||||
if (nsnull == kNewBookmarkCommand) {
|
||||
rv = gRDF->GetResource("http://home.netscape.com/NC-rdf#command?cmd=newbookmark",
|
||||
rv = gRDF->GetResource(NS_LITERAL_CSTRING("http://home.netscape.com/NC-rdf#command?cmd=newbookmark"),
|
||||
getter_AddRefs(kNewBookmarkCommand));
|
||||
if (NS_FAILED(rv)) {
|
||||
return rv;
|
||||
|
||||
@@ -99,12 +99,12 @@ NS_IMETHODIMP wsRDFObserver::OnMove(nsIRDFDataSource *aDataSource,
|
||||
return NS_ERROR_NOT_IMPLEMENTED;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP wsRDFObserver::BeginUpdateBatch(nsIRDFDataSource *aDataSource)
|
||||
NS_IMETHODIMP wsRDFObserver::OnBeginUpdateBatch(nsIRDFDataSource *aDataSource)
|
||||
{
|
||||
return NS_ERROR_NOT_IMPLEMENTED;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP wsRDFObserver::EndUpdateBatch(nsIRDFDataSource *aDataSource)
|
||||
NS_IMETHODIMP wsRDFObserver::OnEndUpdateBatch(nsIRDFDataSource *aDataSource)
|
||||
{
|
||||
return NS_ERROR_NOT_IMPLEMENTED;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user