Removed huge chunks of dead webshell and cleaned up a few references to it elsewhere in the code. b=113970 r=valeski@netscape.com sr=rpotts@netscape.com
This commit is contained in:
@@ -176,7 +176,6 @@ nsDocShellFocusController nsDocShellFocusController::mDocShellFocusControllerSin
|
|||||||
|
|
||||||
nsDocShell::nsDocShell():
|
nsDocShell::nsDocShell():
|
||||||
mContentListener(nsnull),
|
mContentListener(nsnull),
|
||||||
mInitInfo(nsnull),
|
|
||||||
mMarginWidth(0),
|
mMarginWidth(0),
|
||||||
mMarginHeight(0),
|
mMarginHeight(0),
|
||||||
mItemType(typeContent),
|
mItemType(typeContent),
|
||||||
@@ -258,6 +257,7 @@ NS_INTERFACE_MAP_BEGIN(nsDocShell)
|
|||||||
NS_INTERFACE_MAP_ENTRY(nsIRefreshURI)
|
NS_INTERFACE_MAP_ENTRY(nsIRefreshURI)
|
||||||
NS_INTERFACE_MAP_ENTRY(nsIWebProgressListener)
|
NS_INTERFACE_MAP_ENTRY(nsIWebProgressListener)
|
||||||
NS_INTERFACE_MAP_ENTRY(nsISupportsWeakReference)
|
NS_INTERFACE_MAP_ENTRY(nsISupportsWeakReference)
|
||||||
|
NS_INTERFACE_MAP_ENTRY(nsIContentViewerContainer)
|
||||||
NS_INTERFACE_MAP_END_THREADSAFE
|
NS_INTERFACE_MAP_END_THREADSAFE
|
||||||
|
|
||||||
///*****************************************************************************
|
///*****************************************************************************
|
||||||
@@ -1116,6 +1116,53 @@ nsDocShell::SetParentURIContentListener(nsIURIContentListener * aParent)
|
|||||||
return mContentListener->SetParentContentListener(aParent);
|
return mContentListener->SetParentContentListener(aParent);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* [noscript] void setCurrentURI (in nsIURI uri); */
|
||||||
|
NS_IMETHODIMP nsDocShell::SetCurrentURI(nsIURI *aURI)
|
||||||
|
{
|
||||||
|
mCurrentURI = aURI; //This assignment addrefs
|
||||||
|
PRBool isRoot = PR_FALSE; // Is this the root docshell
|
||||||
|
PRBool isSubFrame=PR_FALSE; // Is this a subframe navigation?
|
||||||
|
|
||||||
|
if (!mLoadCookie)
|
||||||
|
return NS_OK;
|
||||||
|
|
||||||
|
nsCOMPtr<nsIDocumentLoader> loader(do_GetInterface(mLoadCookie));
|
||||||
|
nsCOMPtr<nsIWebProgress> webProgress(do_QueryInterface(mLoadCookie));
|
||||||
|
nsCOMPtr<nsIDocShellTreeItem> root;
|
||||||
|
|
||||||
|
GetSameTypeRootTreeItem(getter_AddRefs(root));
|
||||||
|
if (root.get() == NS_STATIC_CAST(nsIDocShellTreeItem *, this))
|
||||||
|
{
|
||||||
|
// This is the root docshell
|
||||||
|
isRoot = PR_TRUE;
|
||||||
|
}
|
||||||
|
if (mLSHE) {
|
||||||
|
nsCOMPtr<nsIHistoryEntry> historyEntry(do_QueryInterface(mLSHE));
|
||||||
|
|
||||||
|
// Check if this is a subframe navigation
|
||||||
|
if (historyEntry) {
|
||||||
|
historyEntry->GetIsSubFrame(&isSubFrame);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!isSubFrame && !isRoot) {
|
||||||
|
/*
|
||||||
|
* We don't want to send OnLocationChange notifications when
|
||||||
|
* a subframe is being loaded for the first time, while
|
||||||
|
* visiting a frameset page
|
||||||
|
*/
|
||||||
|
return NS_OK;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
NS_ASSERTION(loader, "No document loader");
|
||||||
|
if (loader) {
|
||||||
|
loader->FireOnLocationChange(webProgress, nsnull, aURI);
|
||||||
|
}
|
||||||
|
|
||||||
|
return NS_OK;
|
||||||
|
}
|
||||||
|
|
||||||
NS_IMETHODIMP
|
NS_IMETHODIMP
|
||||||
nsDocShell::GetCharset(PRUnichar** aCharset)
|
nsDocShell::GetCharset(PRUnichar** aCharset)
|
||||||
{
|
{
|
||||||
@@ -2509,11 +2556,6 @@ nsDocShell::Destroy()
|
|||||||
|
|
||||||
SetLoadCookie(nsnull);
|
SetLoadCookie(nsnull);
|
||||||
|
|
||||||
if (mInitInfo) {
|
|
||||||
delete mInitInfo;
|
|
||||||
mInitInfo = nsnull;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (mContentListener) {
|
if (mContentListener) {
|
||||||
mContentListener->DocShell(nsnull);
|
mContentListener->DocShell(nsnull);
|
||||||
mContentListener->SetParentContentListener(nsnull);
|
mContentListener->SetParentContentListener(nsnull);
|
||||||
@@ -2526,14 +2568,11 @@ nsDocShell::Destroy()
|
|||||||
NS_IMETHODIMP
|
NS_IMETHODIMP
|
||||||
nsDocShell::SetPosition(PRInt32 x, PRInt32 y)
|
nsDocShell::SetPosition(PRInt32 x, PRInt32 y)
|
||||||
{
|
{
|
||||||
|
mBounds.x = x;
|
||||||
|
mBounds.y = y;
|
||||||
|
|
||||||
if (mContentViewer)
|
if (mContentViewer)
|
||||||
NS_ENSURE_SUCCESS(mContentViewer->Move(x, y), NS_ERROR_FAILURE);
|
NS_ENSURE_SUCCESS(mContentViewer->Move(x, y), NS_ERROR_FAILURE);
|
||||||
else if (InitInfo()) {
|
|
||||||
mInitInfo->x = x;
|
|
||||||
mInitInfo->y = y;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
NS_ENSURE_TRUE(PR_FALSE, NS_ERROR_FAILURE);
|
|
||||||
|
|
||||||
return NS_OK;
|
return NS_OK;
|
||||||
}
|
}
|
||||||
@@ -2564,20 +2603,15 @@ NS_IMETHODIMP
|
|||||||
nsDocShell::SetPositionAndSize(PRInt32 x, PRInt32 y, PRInt32 cx,
|
nsDocShell::SetPositionAndSize(PRInt32 x, PRInt32 y, PRInt32 cx,
|
||||||
PRInt32 cy, PRBool fRepaint)
|
PRInt32 cy, PRBool fRepaint)
|
||||||
{
|
{
|
||||||
|
mBounds.x = x;
|
||||||
|
mBounds.y = y;
|
||||||
|
mBounds.width = cx;
|
||||||
|
mBounds.height = cy;
|
||||||
|
|
||||||
if (mContentViewer) {
|
if (mContentViewer) {
|
||||||
//XXX Border figured in here or is that handled elsewhere?
|
//XXX Border figured in here or is that handled elsewhere?
|
||||||
nsRect bounds(x, y, cx, cy);
|
NS_ENSURE_SUCCESS(mContentViewer->SetBounds(mBounds), NS_ERROR_FAILURE);
|
||||||
|
|
||||||
NS_ENSURE_SUCCESS(mContentViewer->SetBounds(bounds), NS_ERROR_FAILURE);
|
|
||||||
}
|
}
|
||||||
else if (InitInfo()) {
|
|
||||||
mInitInfo->x = x;
|
|
||||||
mInitInfo->y = y;
|
|
||||||
mInitInfo->cx = cx;
|
|
||||||
mInitInfo->cy = cy;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
NS_ENSURE_TRUE(PR_FALSE, NS_ERROR_FAILURE);
|
|
||||||
|
|
||||||
return NS_OK;
|
return NS_OK;
|
||||||
}
|
}
|
||||||
@@ -2586,32 +2620,14 @@ NS_IMETHODIMP
|
|||||||
nsDocShell::GetPositionAndSize(PRInt32 * x, PRInt32 * y, PRInt32 * cx,
|
nsDocShell::GetPositionAndSize(PRInt32 * x, PRInt32 * y, PRInt32 * cx,
|
||||||
PRInt32 * cy)
|
PRInt32 * cy)
|
||||||
{
|
{
|
||||||
if (mContentViewer) {
|
if (x)
|
||||||
nsRect bounds;
|
*x = mBounds.x;
|
||||||
|
if (y)
|
||||||
NS_ENSURE_SUCCESS(mContentViewer->GetBounds(bounds), NS_ERROR_FAILURE);
|
*y = mBounds.y;
|
||||||
|
if (cx)
|
||||||
if (x)
|
*cx = mBounds.width;
|
||||||
*x = bounds.x;
|
if (cy)
|
||||||
if (y)
|
*cy = mBounds.height;
|
||||||
*y = bounds.y;
|
|
||||||
if (cx)
|
|
||||||
*cx = bounds.width;
|
|
||||||
if (cy)
|
|
||||||
*cy = bounds.height;
|
|
||||||
}
|
|
||||||
else if (InitInfo()) {
|
|
||||||
if (x)
|
|
||||||
*x = mInitInfo->x;
|
|
||||||
if (y)
|
|
||||||
*y = mInitInfo->y;
|
|
||||||
if (cx)
|
|
||||||
*cx = mInitInfo->cx;
|
|
||||||
if (cy)
|
|
||||||
*cy = mInitInfo->cy;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
NS_ENSURE_TRUE(PR_FALSE, NS_ERROR_FAILURE);
|
|
||||||
|
|
||||||
return NS_OK;
|
return NS_OK;
|
||||||
}
|
}
|
||||||
@@ -5061,51 +5077,6 @@ nsDocShell::OnLoadingSite(nsIChannel * aChannel)
|
|||||||
return NS_OK;
|
return NS_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
|
||||||
nsDocShell::SetCurrentURI(nsIURI * aURI)
|
|
||||||
{
|
|
||||||
mCurrentURI = aURI; //This assignment addrefs
|
|
||||||
PRBool isRoot = PR_FALSE; // Is this the root docshell
|
|
||||||
PRBool isSubFrame=PR_FALSE; // Is this a subframe navigation?
|
|
||||||
|
|
||||||
if (!mLoadCookie)
|
|
||||||
return;
|
|
||||||
|
|
||||||
nsCOMPtr<nsIDocumentLoader> loader(do_GetInterface(mLoadCookie));
|
|
||||||
nsCOMPtr<nsIWebProgress> webProgress(do_QueryInterface(mLoadCookie));
|
|
||||||
nsCOMPtr<nsIDocShellTreeItem> root;
|
|
||||||
|
|
||||||
GetSameTypeRootTreeItem(getter_AddRefs(root));
|
|
||||||
if (root.get() == NS_STATIC_CAST(nsIDocShellTreeItem *, this))
|
|
||||||
{
|
|
||||||
// This is the root docshell
|
|
||||||
isRoot = PR_TRUE;
|
|
||||||
}
|
|
||||||
if (mLSHE) {
|
|
||||||
nsCOMPtr<nsIHistoryEntry> historyEntry(do_QueryInterface(mLSHE));
|
|
||||||
|
|
||||||
// Check if this is a subframe navigation
|
|
||||||
if (historyEntry) {
|
|
||||||
historyEntry->GetIsSubFrame(&isSubFrame);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!isSubFrame && !isRoot) {
|
|
||||||
/*
|
|
||||||
* We don't want to send OnLocationChange notifications when
|
|
||||||
* a subframe is being loaded for the first time, while
|
|
||||||
* visiting a frameset page
|
|
||||||
*/
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
NS_ASSERTION(loader, "No document loader");
|
|
||||||
if (loader) {
|
|
||||||
loader->FireOnLocationChange(webProgress, nsnull, aURI);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
void
|
void
|
||||||
nsDocShell::SetReferrerURI(nsIURI * aURI)
|
nsDocShell::SetReferrerURI(nsIURI * aURI)
|
||||||
{
|
{
|
||||||
@@ -5626,14 +5597,6 @@ nsDocShell::GetLoadType(PRUint32 * aLoadType)
|
|||||||
return NS_OK;
|
return NS_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
nsDocShellInitInfo *
|
|
||||||
nsDocShell::InitInfo()
|
|
||||||
{
|
|
||||||
if (mInitInfo)
|
|
||||||
return mInitInfo;
|
|
||||||
return mInitInfo = new nsDocShellInitInfo();
|
|
||||||
}
|
|
||||||
|
|
||||||
#define DIALOG_STRING_URI "chrome://global/locale/appstrings.properties"
|
#define DIALOG_STRING_URI "chrome://global/locale/appstrings.properties"
|
||||||
|
|
||||||
NS_IMETHODIMP
|
NS_IMETHODIMP
|
||||||
|
|||||||
@@ -131,20 +131,6 @@ protected:
|
|||||||
virtual ~nsRefreshTimer();
|
virtual ~nsRefreshTimer();
|
||||||
};
|
};
|
||||||
|
|
||||||
//*****************************************************************************
|
|
||||||
//*** nsDocShellInitInfo
|
|
||||||
//*****************************************************************************
|
|
||||||
|
|
||||||
class nsDocShellInitInfo
|
|
||||||
{
|
|
||||||
public:
|
|
||||||
//nsIGenericWindow Stuff
|
|
||||||
PRInt32 x;
|
|
||||||
PRInt32 y;
|
|
||||||
PRInt32 cx;
|
|
||||||
PRInt32 cy;
|
|
||||||
};
|
|
||||||
|
|
||||||
//*****************************************************************************
|
//*****************************************************************************
|
||||||
//*** nsDocShell
|
//*** nsDocShell
|
||||||
//*****************************************************************************
|
//*****************************************************************************
|
||||||
@@ -226,7 +212,6 @@ protected:
|
|||||||
|
|
||||||
NS_IMETHOD OnNewURI(nsIURI * aURI, nsIChannel * aChannel, PRUint32 aLoadType);
|
NS_IMETHOD OnNewURI(nsIURI * aURI, nsIChannel * aChannel, PRUint32 aLoadType);
|
||||||
|
|
||||||
virtual void SetCurrentURI(nsIURI * aURI);
|
|
||||||
virtual void SetReferrerURI(nsIURI * aURI);
|
virtual void SetReferrerURI(nsIURI * aURI);
|
||||||
|
|
||||||
// Session History
|
// Session History
|
||||||
@@ -247,7 +232,6 @@ protected:
|
|||||||
NS_IMETHOD UpdateCurrentGlobalHistory();
|
NS_IMETHOD UpdateCurrentGlobalHistory();
|
||||||
|
|
||||||
// Helper Routines
|
// Helper Routines
|
||||||
nsDocShellInitInfo * InitInfo();
|
|
||||||
NS_IMETHOD GetPromptAndStringBundle(nsIPrompt ** aPrompt,
|
NS_IMETHOD GetPromptAndStringBundle(nsIPrompt ** aPrompt,
|
||||||
nsIStringBundle ** aStringBundle);
|
nsIStringBundle ** aStringBundle);
|
||||||
NS_IMETHOD GetChildOffset(nsIDOMNode * aChild, nsIDOMNode * aParent,
|
NS_IMETHOD GetChildOffset(nsIDOMNode * aChild, nsIDOMNode * aParent,
|
||||||
@@ -289,7 +273,7 @@ protected:
|
|||||||
nsVoidArray mChildren;
|
nsVoidArray mChildren;
|
||||||
nsCOMPtr<nsISupportsArray> mRefreshURIList;
|
nsCOMPtr<nsISupportsArray> mRefreshURIList;
|
||||||
nsDSURIContentListener * mContentListener;
|
nsDSURIContentListener * mContentListener;
|
||||||
nsDocShellInitInfo * mInitInfo;
|
nsRect mBounds; // Dimensions of the docshell
|
||||||
nsCOMPtr<nsIContentViewer> mContentViewer;
|
nsCOMPtr<nsIContentViewer> mContentViewer;
|
||||||
nsCOMPtr<nsIDocumentCharsetInfo> mDocumentCharsetInfo;
|
nsCOMPtr<nsIDocumentCharsetInfo> mDocumentCharsetInfo;
|
||||||
nsCOMPtr<nsIDeviceContext> mDeviceContext;
|
nsCOMPtr<nsIDeviceContext> mDeviceContext;
|
||||||
|
|||||||
@@ -113,7 +113,7 @@ interface nsIDocShell : nsISupports
|
|||||||
* in nsIWebNavigation.
|
* in nsIWebNavigation.
|
||||||
* @param aSHEntry - Active Session History entry (if loading from SH)
|
* @param aSHEntry - Active Session History entry (if loading from SH)
|
||||||
*/
|
*/
|
||||||
[noscript]void InternalLoad(in nsIURI aURI,
|
[noscript]void internalLoad(in nsIURI aURI,
|
||||||
in nsIURI aReferrer,
|
in nsIURI aReferrer,
|
||||||
in nsISupports aOwner,
|
in nsISupports aOwner,
|
||||||
in boolean aInheritOwner,
|
in boolean aInheritOwner,
|
||||||
@@ -135,7 +135,18 @@ interface nsIDocShell : nsISupports
|
|||||||
*/
|
*/
|
||||||
void prepareForNewContentModel();
|
void prepareForNewContentModel();
|
||||||
|
|
||||||
[noscript] void FireUnloadNotification();
|
/**
|
||||||
|
* For editors and suchlike who wish to change the URI associated with the
|
||||||
|
* document. Note if you want to get the current URI, use the read-only
|
||||||
|
* property on nsIWebNavigation.
|
||||||
|
*/
|
||||||
|
[noscript] void setCurrentURI(in nsIURI aURI);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Notify the associated content viewer and all child docshells that they are
|
||||||
|
* about to be unloaded.
|
||||||
|
*/
|
||||||
|
[noscript] void fireUnloadNotification();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Presentation context for the currently loaded document. This may be null.
|
* Presentation context for the currently loaded document. This may be null.
|
||||||
@@ -245,15 +256,15 @@ interface nsIDocShell : nsISupports
|
|||||||
*/
|
*/
|
||||||
attribute long marginHeight;
|
attribute long marginHeight;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Tells the DocShell that it now has focus or has lost focus
|
* Tells the DocShell that it now has focus or has lost focus
|
||||||
*/
|
*/
|
||||||
attribute boolean hasFocus;
|
attribute boolean hasFocus;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Tells the docshell whether the canvas should have focus
|
* Tells the docshell whether the canvas should have focus
|
||||||
*/
|
*/
|
||||||
attribute boolean canvasHasFocus;
|
attribute boolean canvasHasFocus;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Tells the docshell to offer focus to its tree owner.
|
* Tells the docshell to offer focus to its tree owner.
|
||||||
@@ -280,6 +291,6 @@ interface nsIDocShell : nsISupports
|
|||||||
/*
|
/*
|
||||||
* returns true if the docshell is being destroyed, false otherwise
|
* returns true if the docshell is being destroyed, false otherwise
|
||||||
*/
|
*/
|
||||||
boolean IsBeingDestroyed();
|
boolean isBeingDestroyed();
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -61,7 +61,6 @@ typedef unsigned long HMTX;
|
|||||||
#include "nsIStreamListener.h"
|
#include "nsIStreamListener.h"
|
||||||
#include "nsIPrompt.h"
|
#include "nsIPrompt.h"
|
||||||
#include "nsNetUtil.h"
|
#include "nsNetUtil.h"
|
||||||
#include "nsIProtocolHandler.h"
|
|
||||||
#include "nsIDNSService.h"
|
#include "nsIDNSService.h"
|
||||||
#include "nsISocketProvider.h"
|
#include "nsISocketProvider.h"
|
||||||
#include "nsIRefreshURI.h"
|
#include "nsIRefreshURI.h"
|
||||||
@@ -70,7 +69,6 @@ typedef unsigned long HMTX;
|
|||||||
#include "nsIDOMEvent.h"
|
#include "nsIDOMEvent.h"
|
||||||
#include "nsIPresContext.h"
|
#include "nsIPresContext.h"
|
||||||
#include "nsIComponentManager.h"
|
#include "nsIComponentManager.h"
|
||||||
#include "nsIServiceManager.h"
|
|
||||||
#include "nsIEventQueueService.h"
|
#include "nsIEventQueueService.h"
|
||||||
#include "nsCRT.h"
|
#include "nsCRT.h"
|
||||||
#include "nsVoidArray.h"
|
#include "nsVoidArray.h"
|
||||||
@@ -82,11 +80,8 @@ typedef unsigned long HMTX;
|
|||||||
#include "prprf.h"
|
#include "prprf.h"
|
||||||
#include "nsIPluginHost.h"
|
#include "nsIPluginHost.h"
|
||||||
#include "nsplugin.h"
|
#include "nsplugin.h"
|
||||||
//#include "nsPluginsCID.h"
|
|
||||||
#include "nsIPluginManager.h"
|
#include "nsIPluginManager.h"
|
||||||
#include "nsCDefaultURIFixup.h"
|
#include "nsCDefaultURIFixup.h"
|
||||||
#include "nsITimer.h"
|
|
||||||
#include "nsITimerCallback.h"
|
|
||||||
#include "nsIContent.h"
|
#include "nsIContent.h"
|
||||||
#include "prlog.h"
|
#include "prlog.h"
|
||||||
#include "nsCOMPtr.h"
|
#include "nsCOMPtr.h"
|
||||||
@@ -97,8 +92,6 @@ typedef unsigned long HMTX;
|
|||||||
#include "prthread.h"
|
#include "prthread.h"
|
||||||
#include "nsXPIDLString.h"
|
#include "nsXPIDLString.h"
|
||||||
#include "nsDOMError.h"
|
#include "nsDOMError.h"
|
||||||
#include "nsIDOMHTMLElement.h"
|
|
||||||
#include "nsIDOMHTMLDocument.h"
|
|
||||||
#include "nsLayoutCID.h"
|
#include "nsLayoutCID.h"
|
||||||
#include "nsIDOMRange.h"
|
#include "nsIDOMRange.h"
|
||||||
#include "nsIURIContentListener.h"
|
#include "nsIURIContentListener.h"
|
||||||
@@ -120,21 +113,14 @@ typedef unsigned long HMTX;
|
|||||||
#include "nsIController.h"
|
#include "nsIController.h"
|
||||||
#include "nsIFocusController.h"
|
#include "nsIFocusController.h"
|
||||||
#include "nsGUIEvent.h"
|
#include "nsGUIEvent.h"
|
||||||
#include "nsISelection.h"
|
|
||||||
#include "nsISelectionController.h"
|
|
||||||
#include "nsIFileStream.h"
|
#include "nsIFileStream.h"
|
||||||
#include "nsISHistoryInternal.h"
|
#include "nsISHistoryInternal.h"
|
||||||
#include "nsIHistoryEntry.h"
|
|
||||||
|
|
||||||
#include "nsIHttpChannel.h" // add this to the ick include list...we need it to QI for post data interface
|
#include "nsIHttpChannel.h" // add this to the ick include list...we need it to QI for post data interface
|
||||||
#include "nsIUploadChannel.h"
|
|
||||||
|
|
||||||
#include "nsILocaleService.h"
|
#include "nsILocaleService.h"
|
||||||
#include "nsIStringBundle.h"
|
#include "nsIStringBundle.h"
|
||||||
|
|
||||||
#include "nsIIOService.h"
|
|
||||||
#include "nsIURL.h"
|
|
||||||
#include "nsIProtocolHandler.h"
|
|
||||||
#include "nsICachingChannel.h"
|
#include "nsICachingChannel.h"
|
||||||
|
|
||||||
//XXX for nsIPostData; this is wrong; we shouldn't see the nsIDocument type
|
//XXX for nsIPostData; this is wrong; we shouldn't see the nsIDocument type
|
||||||
@@ -165,8 +151,6 @@ static PRLogModuleInfo* gLogModule = PR_NewLogModule("webshell");
|
|||||||
#define WEB_TRACE(_bit,_args)
|
#define WEB_TRACE(_bit,_args)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
//static NS_DEFINE_CID(kGlobalHistoryCID, NS_GLOBALHISTORY_CID);
|
|
||||||
//static NS_DEFINE_CID(kIOServiceCID, NS_IOSERVICE_CID);
|
|
||||||
static NS_DEFINE_CID(kSimpleURICID, NS_SIMPLEURI_CID);
|
static NS_DEFINE_CID(kSimpleURICID, NS_SIMPLEURI_CID);
|
||||||
|
|
||||||
//----------------------------------------------------------------------
|
//----------------------------------------------------------------------
|
||||||
@@ -195,8 +179,6 @@ nsWebShell::nsWebShell() : nsDocShell()
|
|||||||
InitFrameData();
|
InitFrameData();
|
||||||
mItemType = typeContent;
|
mItemType = typeContent;
|
||||||
mCharsetReloadState = eCharsetReloadInit;
|
mCharsetReloadState = eCharsetReloadInit;
|
||||||
mHistoryState = nsnull;
|
|
||||||
mBounds.SetRect(0, 0, 0, 0);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
nsWebShell::~nsWebShell()
|
nsWebShell::~nsWebShell()
|
||||||
@@ -250,26 +232,11 @@ NS_IMPL_ADDREF_INHERITED(nsWebShell, nsDocShell)
|
|||||||
NS_IMPL_RELEASE_INHERITED(nsWebShell, nsDocShell)
|
NS_IMPL_RELEASE_INHERITED(nsWebShell, nsDocShell)
|
||||||
|
|
||||||
NS_INTERFACE_MAP_BEGIN(nsWebShell)
|
NS_INTERFACE_MAP_BEGIN(nsWebShell)
|
||||||
#if 0 // inherits from nsDocShell:
|
|
||||||
NS_INTERFACE_MAP_ENTRY_AMBIGUOUS(nsISupports, nsIWebShell)
|
|
||||||
#endif
|
|
||||||
NS_INTERFACE_MAP_ENTRY(nsIWebShell)
|
NS_INTERFACE_MAP_ENTRY(nsIWebShell)
|
||||||
NS_INTERFACE_MAP_ENTRY(nsIWebShellServices)
|
NS_INTERFACE_MAP_ENTRY(nsIWebShellServices)
|
||||||
NS_INTERFACE_MAP_ENTRY_AMBIGUOUS(nsIContentViewerContainer, nsIWebShell)
|
|
||||||
NS_INTERFACE_MAP_ENTRY(nsIWebShellContainer)
|
NS_INTERFACE_MAP_ENTRY(nsIWebShellContainer)
|
||||||
NS_INTERFACE_MAP_ENTRY(nsILinkHandler)
|
NS_INTERFACE_MAP_ENTRY(nsILinkHandler)
|
||||||
NS_INTERFACE_MAP_ENTRY(nsIClipboardCommands)
|
NS_INTERFACE_MAP_ENTRY(nsIClipboardCommands)
|
||||||
#if 0 // inherits from nsDocShell:
|
|
||||||
NS_INTERFACE_MAP_ENTRY(nsIScriptGlobalObjectOwner)
|
|
||||||
NS_INTERFACE_MAP_ENTRY(nsIInterfaceRequestor)
|
|
||||||
NS_INTERFACE_MAP_ENTRY(nsIBaseWindow)
|
|
||||||
NS_INTERFACE_MAP_ENTRY(nsIDocShell)
|
|
||||||
NS_INTERFACE_MAP_ENTRY(nsIDocShellTreeItem)
|
|
||||||
NS_INTERFACE_MAP_ENTRY(nsIDocShellTreeNode)
|
|
||||||
NS_INTERFACE_MAP_ENTRY(nsIWebNavigation)
|
|
||||||
NS_INTERFACE_MAP_ENTRY(nsIRefreshURI)
|
|
||||||
NS_INTERFACE_MAP_ENTRY(nsIScrollable)
|
|
||||||
#endif
|
|
||||||
NS_INTERFACE_MAP_END_INHERITING(nsDocShell)
|
NS_INTERFACE_MAP_END_INHERITING(nsDocShell)
|
||||||
|
|
||||||
NS_IMETHODIMP
|
NS_IMETHODIMP
|
||||||
@@ -314,36 +281,6 @@ nsWebShell::GetInterface(const nsIID &aIID, void** aInstancePtr)
|
|||||||
return rv;
|
return rv;
|
||||||
}
|
}
|
||||||
|
|
||||||
NS_IMETHODIMP
|
|
||||||
nsWebShell::SetupNewViewer(nsIContentViewer* aViewer)
|
|
||||||
{
|
|
||||||
NS_ENSURE_SUCCESS(nsDocShell::SetupNewViewer(aViewer), NS_ERROR_FAILURE);
|
|
||||||
|
|
||||||
// If the history state has been set by session history,
|
|
||||||
// set it on the pres shell now that we have a content
|
|
||||||
// viewer.
|
|
||||||
if(mContentViewer && mHistoryState)
|
|
||||||
{
|
|
||||||
nsCOMPtr<nsIDocumentViewer> docv(do_QueryInterface(mContentViewer));
|
|
||||||
if(docv)
|
|
||||||
{
|
|
||||||
nsCOMPtr<nsIPresShell> shell;
|
|
||||||
docv->GetPresShell(*getter_AddRefs(shell));
|
|
||||||
if(shell)
|
|
||||||
shell->SetHistoryState((nsILayoutHistoryState*)mHistoryState);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return NS_OK;
|
|
||||||
}
|
|
||||||
|
|
||||||
NS_IMETHODIMP
|
|
||||||
nsWebShell::Embed(nsIContentViewer* aContentViewer,
|
|
||||||
const char* aCommand,
|
|
||||||
nsISupports* aExtraInfo)
|
|
||||||
{
|
|
||||||
return nsDocShell::Embed(aContentViewer, aCommand, aExtraInfo);
|
|
||||||
}
|
|
||||||
|
|
||||||
NS_IMETHODIMP
|
NS_IMETHODIMP
|
||||||
nsWebShell::SetContainer(nsIWebShellContainer* aContainer)
|
nsWebShell::SetContainer(nsIWebShellContainer* aContainer)
|
||||||
{
|
{
|
||||||
@@ -362,98 +299,12 @@ nsWebShell::GetContainer(nsIWebShellContainer*& aResult)
|
|||||||
return NS_OK;
|
return NS_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
NS_IMETHODIMP
|
|
||||||
nsWebShell::GetTopLevelWindow(nsIWebShellContainer** aTopLevelWindow)
|
|
||||||
{
|
|
||||||
NS_ENSURE_ARG_POINTER(aTopLevelWindow);
|
|
||||||
*aTopLevelWindow = nsnull;
|
|
||||||
|
|
||||||
nsCOMPtr<nsIWebShell> rootWebShell;
|
|
||||||
|
|
||||||
GetRootWebShellEvenIfChrome(getter_AddRefs(rootWebShell));
|
|
||||||
if(!rootWebShell)
|
|
||||||
return NS_OK;
|
|
||||||
|
|
||||||
nsCOMPtr<nsIWebShellContainer> rootContainer;
|
|
||||||
rootWebShell->GetContainer(*aTopLevelWindow);
|
|
||||||
|
|
||||||
return NS_OK;
|
|
||||||
}
|
|
||||||
|
|
||||||
nsEventStatus PR_CALLBACK
|
nsEventStatus PR_CALLBACK
|
||||||
nsWebShell::HandleEvent(nsGUIEvent *aEvent)
|
nsWebShell::HandleEvent(nsGUIEvent *aEvent)
|
||||||
{
|
{
|
||||||
return nsEventStatus_eIgnore;
|
return nsEventStatus_eIgnore;
|
||||||
}
|
}
|
||||||
|
|
||||||
NS_IMETHODIMP
|
|
||||||
nsWebShell::GetRootWebShell(nsIWebShell*& aResult)
|
|
||||||
{
|
|
||||||
nsCOMPtr<nsIDocShellTreeItem> top;
|
|
||||||
GetSameTypeRootTreeItem(getter_AddRefs(top));
|
|
||||||
nsCOMPtr<nsIWebShell> topAsWebShell(do_QueryInterface(top));
|
|
||||||
aResult = topAsWebShell;
|
|
||||||
NS_IF_ADDREF(aResult);
|
|
||||||
return NS_OK;
|
|
||||||
}
|
|
||||||
|
|
||||||
void
|
|
||||||
nsWebShell::GetRootWebShellEvenIfChrome(nsIWebShell** aResult)
|
|
||||||
{
|
|
||||||
nsCOMPtr<nsIDocShellTreeItem> top;
|
|
||||||
GetRootTreeItem(getter_AddRefs(top));
|
|
||||||
nsCOMPtr<nsIWebShell> topAsWebShell(do_QueryInterface(top));
|
|
||||||
*aResult = topAsWebShell;
|
|
||||||
NS_IF_ADDREF(*aResult);
|
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
|
||||||
NS_IMETHODIMP
|
|
||||||
nsWebShell::SetParent(nsIWebShell* aParent)
|
|
||||||
{
|
|
||||||
nsCOMPtr<nsIDocShellTreeItem> parentAsTreeItem(do_QueryInterface(aParent));
|
|
||||||
|
|
||||||
mParent = parentAsTreeItem.get();
|
|
||||||
return NS_OK;
|
|
||||||
}
|
|
||||||
|
|
||||||
NS_IMETHODIMP
|
|
||||||
nsWebShell::GetParent(nsIWebShell*& aParent)
|
|
||||||
{
|
|
||||||
nsCOMPtr<nsIDocShellTreeItem> parent;
|
|
||||||
NS_ENSURE_SUCCESS(GetSameTypeParent(getter_AddRefs(parent)), NS_ERROR_FAILURE);
|
|
||||||
|
|
||||||
if(parent)
|
|
||||||
parent->QueryInterface(NS_GET_IID(nsIWebShell), (void**)&aParent);
|
|
||||||
else
|
|
||||||
aParent = nsnull;
|
|
||||||
return NS_OK;
|
|
||||||
}
|
|
||||||
*/
|
|
||||||
NS_IMETHODIMP
|
|
||||||
nsWebShell::GetReferrer(nsIURI **aReferrer)
|
|
||||||
{
|
|
||||||
*aReferrer = mReferrerURI;
|
|
||||||
NS_IF_ADDREF(*aReferrer);
|
|
||||||
return NS_OK;
|
|
||||||
}
|
|
||||||
|
|
||||||
void
|
|
||||||
nsWebShell::SetReferrer(const PRUnichar* aReferrer)
|
|
||||||
{
|
|
||||||
NS_NewURI(getter_AddRefs(mReferrerURI), nsDependentString(aReferrer), nsnull);
|
|
||||||
}
|
|
||||||
|
|
||||||
NS_IMETHODIMP
|
|
||||||
nsWebShell::SetURL(const PRUnichar* aURL)
|
|
||||||
{
|
|
||||||
nsCOMPtr<nsIURI> uri;
|
|
||||||
NS_ENSURE_SUCCESS(NS_NewURI(getter_AddRefs(uri), nsDependentString(aURL),
|
|
||||||
nsnull),
|
|
||||||
NS_ERROR_FAILURE);
|
|
||||||
SetCurrentURI(uri);
|
|
||||||
return NS_OK;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Document Load methods
|
* Document Load methods
|
||||||
@@ -466,85 +317,6 @@ nsWebShell::GetDocumentLoader(nsIDocumentLoader*& aResult)
|
|||||||
return (nsnull != mDocLoader) ? NS_OK : NS_ERROR_FAILURE;
|
return (nsnull != mDocLoader) ? NS_OK : NS_ERROR_FAILURE;
|
||||||
}
|
}
|
||||||
|
|
||||||
//----------------------------------------
|
|
||||||
|
|
||||||
// History methods
|
|
||||||
|
|
||||||
NS_IMETHODIMP nsWebShell::GoTo(PRInt32 aIndex)
|
|
||||||
{
|
|
||||||
NS_ENSURE_STATE(mSessionHistory);
|
|
||||||
NS_ENSURE_TRUE(!IsFrame(), NS_ERROR_FAILURE);
|
|
||||||
nsCOMPtr<nsIHistoryEntry> entry;
|
|
||||||
|
|
||||||
mSessionHistory->GetEntryAtIndex(aIndex, PR_TRUE, getter_AddRefs(entry));
|
|
||||||
NS_ENSURE_TRUE(entry, NS_ERROR_FAILURE);
|
|
||||||
nsCOMPtr<nsISHEntry> shEntry(do_QueryInterface(entry));
|
|
||||||
NS_ENSURE_TRUE(shEntry, NS_ERROR_FAILURE);
|
|
||||||
|
|
||||||
NS_ENSURE_SUCCESS(LoadHistoryEntry(shEntry, LOAD_HISTORY), NS_ERROR_FAILURE);
|
|
||||||
|
|
||||||
return NS_OK;
|
|
||||||
}
|
|
||||||
|
|
||||||
NS_IMETHODIMP
|
|
||||||
nsWebShell::GetHistoryLength(PRInt32& aResult)
|
|
||||||
{
|
|
||||||
NS_ENSURE_STATE(mSessionHistory);
|
|
||||||
NS_ENSURE_TRUE(!IsFrame(), NS_ERROR_FAILURE);
|
|
||||||
|
|
||||||
NS_ENSURE_SUCCESS(mSessionHistory->GetCount(&aResult), NS_ERROR_FAILURE);
|
|
||||||
return NS_OK;
|
|
||||||
}
|
|
||||||
|
|
||||||
NS_IMETHODIMP
|
|
||||||
nsWebShell::GetHistoryIndex(PRInt32& aResult)
|
|
||||||
{
|
|
||||||
NS_ENSURE_STATE(mSessionHistory);
|
|
||||||
NS_ENSURE_TRUE(!IsFrame(), NS_ERROR_FAILURE);
|
|
||||||
|
|
||||||
NS_ENSURE_SUCCESS(mSessionHistory->GetIndex(&aResult), NS_ERROR_FAILURE);
|
|
||||||
return NS_OK;
|
|
||||||
}
|
|
||||||
|
|
||||||
NS_IMETHODIMP
|
|
||||||
nsWebShell::GetURL(PRInt32 aIndex, PRUnichar** aURLResult)
|
|
||||||
{
|
|
||||||
NS_ENSURE_STATE(mSessionHistory);
|
|
||||||
NS_ENSURE_TRUE(!IsFrame(), NS_ERROR_FAILURE);
|
|
||||||
|
|
||||||
nsCOMPtr<nsIHistoryEntry> entry;
|
|
||||||
|
|
||||||
NS_ENSURE_SUCCESS(mSessionHistory->GetEntryAtIndex(aIndex, PR_TRUE,
|
|
||||||
getter_AddRefs(entry)), NS_ERROR_FAILURE);
|
|
||||||
NS_ENSURE_TRUE(entry, NS_ERROR_FAILURE);
|
|
||||||
|
|
||||||
nsCOMPtr<nsIURI> uri;
|
|
||||||
|
|
||||||
entry->GetURI(getter_AddRefs(uri));
|
|
||||||
|
|
||||||
NS_ENSURE_TRUE(uri, NS_ERROR_FAILURE);
|
|
||||||
|
|
||||||
nsXPIDLCString spec;
|
|
||||||
uri->GetSpec(getter_Copies(spec));
|
|
||||||
|
|
||||||
*aURLResult = ToNewUnicode(NS_ConvertASCIItoUCS2(spec));
|
|
||||||
|
|
||||||
return NS_OK;
|
|
||||||
}
|
|
||||||
|
|
||||||
//----------------------------------------
|
|
||||||
|
|
||||||
//----------------------------------------------------------------------
|
|
||||||
|
|
||||||
// WebShell container implementation
|
|
||||||
|
|
||||||
NS_IMETHODIMP
|
|
||||||
nsWebShell::SetHistoryState(nsISupports* aLayoutHistoryState)
|
|
||||||
{
|
|
||||||
mHistoryState = aLayoutHistoryState;
|
|
||||||
return NS_OK;
|
|
||||||
}
|
|
||||||
|
|
||||||
//----------------------------------------------------------------------
|
//----------------------------------------------------------------------
|
||||||
// Web Shell Services API
|
// Web Shell Services API
|
||||||
|
|
||||||
@@ -1405,13 +1177,6 @@ nsWebShell::SelectNone(void)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
//----------------------------------------------------
|
|
||||||
NS_IMETHODIMP
|
|
||||||
nsWebShell::FindNext(const PRUnichar * aSearchStr, PRBool aMatchCase, PRBool aSearchDown, PRBool &aIsFound)
|
|
||||||
{
|
|
||||||
return NS_ERROR_FAILURE;
|
|
||||||
}
|
|
||||||
|
|
||||||
#ifdef XP_MAC
|
#ifdef XP_MAC
|
||||||
#pragma mark -
|
#pragma mark -
|
||||||
#endif
|
#endif
|
||||||
@@ -1439,8 +1204,9 @@ NS_IMETHODIMP nsWebShell::Create()
|
|||||||
nsCOMPtr<nsIURILoader> uriLoader = do_GetService(NS_URI_LOADER_CONTRACTID);
|
nsCOMPtr<nsIURILoader> uriLoader = do_GetService(NS_URI_LOADER_CONTRACTID);
|
||||||
uriLoader->GetDocumentLoaderForContext(NS_STATIC_CAST( nsISupports*, (nsIWebShell *) this), &mDocLoader);
|
uriLoader->GetDocumentLoaderForContext(NS_STATIC_CAST( nsISupports*, (nsIWebShell *) this), &mDocLoader);
|
||||||
|
|
||||||
|
nsCOMPtr<nsIContentViewerContainer> shellAsContainer = do_QueryInterface(NS_STATIC_CAST(nsIWebShell*, this));
|
||||||
// Set the webshell as the default IContentViewerContainer for the loader...
|
// Set the webshell as the default IContentViewerContainer for the loader...
|
||||||
mDocLoader->SetContainer(NS_STATIC_CAST(nsIContentViewerContainer*, (nsIWebShell*)this));
|
mDocLoader->SetContainer(shellAsContainer);
|
||||||
|
|
||||||
return nsDocShell::Create();
|
return nsDocShell::Create();
|
||||||
}
|
}
|
||||||
@@ -1454,28 +1220,6 @@ NS_IMETHODIMP nsWebShell::Destroy()
|
|||||||
return NS_OK;
|
return NS_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
NS_IMETHODIMP nsWebShell::SetPositionAndSize(PRInt32 x, PRInt32 y, PRInt32 cx,
|
|
||||||
PRInt32 cy, PRBool fRepaint)
|
|
||||||
{
|
|
||||||
mBounds.SetRect(x, y, cx, cy);
|
|
||||||
return nsDocShell::SetPositionAndSize(x, y, cx, cy, fRepaint);
|
|
||||||
}
|
|
||||||
|
|
||||||
NS_IMETHODIMP nsWebShell::GetPositionAndSize(PRInt32* x, PRInt32* y,
|
|
||||||
PRInt32* cx, PRInt32* cy)
|
|
||||||
{
|
|
||||||
if(x)
|
|
||||||
*x = mBounds.x;
|
|
||||||
if(y)
|
|
||||||
*y = mBounds.y;
|
|
||||||
if(cx)
|
|
||||||
*cx = mBounds.width;
|
|
||||||
if(cy)
|
|
||||||
*cy = mBounds.height;
|
|
||||||
|
|
||||||
return NS_OK;
|
|
||||||
}
|
|
||||||
|
|
||||||
#ifdef DEBUG
|
#ifdef DEBUG
|
||||||
unsigned long nsWebShell::gNumberOfWebShells = 0;
|
unsigned long nsWebShell::gNumberOfWebShells = 0;
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -58,36 +58,11 @@ public:
|
|||||||
NS_DECL_NSICLIPBOARDCOMMANDS
|
NS_DECL_NSICLIPBOARDCOMMANDS
|
||||||
NS_DECL_NSIWEBSHELLSERVICES
|
NS_DECL_NSIWEBSHELLSERVICES
|
||||||
|
|
||||||
NS_IMETHOD SetupNewViewer(nsIContentViewer* aViewer);
|
|
||||||
|
|
||||||
// nsIContentViewerContainer
|
|
||||||
NS_IMETHOD Embed(nsIContentViewer* aDocViewer,
|
|
||||||
const char* aCommand,
|
|
||||||
nsISupports* aExtraInfo);
|
|
||||||
|
|
||||||
// nsIWebShell
|
// nsIWebShell
|
||||||
NS_IMETHOD SetContainer(nsIWebShellContainer* aContainer);
|
NS_IMETHOD SetContainer(nsIWebShellContainer* aContainer);
|
||||||
NS_IMETHOD GetContainer(nsIWebShellContainer*& aResult);
|
NS_IMETHOD GetContainer(nsIWebShellContainer*& aResult);
|
||||||
NS_IMETHOD GetTopLevelWindow(nsIWebShellContainer** aWebShellWindow);
|
|
||||||
NS_IMETHOD GetRootWebShell(nsIWebShell*& aResult);
|
|
||||||
/*NS_IMETHOD SetParent(nsIWebShell* aParent);
|
|
||||||
NS_IMETHOD GetParent(nsIWebShell*& aParent);*/
|
|
||||||
NS_IMETHOD GetReferrer(nsIURI **aReferrer);
|
|
||||||
|
|
||||||
// Document load api's
|
|
||||||
NS_IMETHOD GetDocumentLoader(nsIDocumentLoader*& aResult);
|
NS_IMETHOD GetDocumentLoader(nsIDocumentLoader*& aResult);
|
||||||
|
|
||||||
void SetReferrer(const PRUnichar* aReferrer);
|
|
||||||
|
|
||||||
// History api's
|
|
||||||
NS_IMETHOD GoTo(PRInt32 aHistoryIndex);
|
|
||||||
NS_IMETHOD GetHistoryLength(PRInt32& aResult);
|
|
||||||
NS_IMETHOD GetHistoryIndex(PRInt32& aResult);
|
|
||||||
NS_IMETHOD GetURL(PRInt32 aHistoryIndex, PRUnichar** aURLResult);
|
|
||||||
|
|
||||||
// nsIWebShellContainer
|
|
||||||
NS_IMETHOD SetHistoryState(nsISupports* aLayoutHistoryState);
|
|
||||||
|
|
||||||
// nsILinkHandler
|
// nsILinkHandler
|
||||||
NS_IMETHOD OnLinkClick(nsIContent* aContent,
|
NS_IMETHOD OnLinkClick(nsIContent* aContent,
|
||||||
nsLinkVerb aVerb,
|
nsLinkVerb aVerb,
|
||||||
@@ -100,14 +75,6 @@ public:
|
|||||||
const PRUnichar* aTargetSpec);
|
const PRUnichar* aTargetSpec);
|
||||||
NS_IMETHOD GetLinkState(const char* aLinkURI, nsLinkState& aState);
|
NS_IMETHOD GetLinkState(const char* aLinkURI, nsLinkState& aState);
|
||||||
|
|
||||||
NS_IMETHOD FindNext(const PRUnichar * aSearchStr, PRBool aMatchCase,
|
|
||||||
PRBool aSearchDown, PRBool &aIsFound);
|
|
||||||
|
|
||||||
// nsIBaseWindow
|
|
||||||
NS_IMETHOD SetPositionAndSize(PRInt32 x, PRInt32 y, PRInt32 cx,
|
|
||||||
PRInt32 cy, PRBool fRepaint);
|
|
||||||
NS_IMETHOD GetPositionAndSize(PRInt32* x, PRInt32* y,
|
|
||||||
PRInt32* cx, PRInt32* cy);
|
|
||||||
NS_IMETHOD Create();
|
NS_IMETHOD Create();
|
||||||
NS_IMETHOD Destroy();
|
NS_IMETHOD Destroy();
|
||||||
|
|
||||||
@@ -122,10 +89,10 @@ public:
|
|||||||
|
|
||||||
static nsEventStatus PR_CALLBACK HandleEvent(nsGUIEvent *aEvent);
|
static nsEventStatus PR_CALLBACK HandleEvent(nsGUIEvent *aEvent);
|
||||||
|
|
||||||
NS_IMETHOD SetURL(const PRUnichar* aURL);
|
// NS_IMETHOD SetURL(const PRUnichar* aURL);
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
void GetRootWebShellEvenIfChrome(nsIWebShell** aResult);
|
// void GetRootWebShellEvenIfChrome(nsIWebShell** aResult);
|
||||||
void InitFrameData();
|
void InitFrameData();
|
||||||
|
|
||||||
// helpers for executing commands
|
// helpers for executing commands
|
||||||
@@ -146,8 +113,6 @@ protected:
|
|||||||
nsIWebShellContainer* mContainer;
|
nsIWebShellContainer* mContainer;
|
||||||
nsIDocumentLoader* mDocLoader;
|
nsIDocumentLoader* mDocLoader;
|
||||||
|
|
||||||
nsRect mBounds;
|
|
||||||
|
|
||||||
eCharsetReloadState mCharsetReloadState;
|
eCharsetReloadState mCharsetReloadState;
|
||||||
|
|
||||||
nsISupports* mHistoryState; // Weak reference. Session history owns this.
|
nsISupports* mHistoryState; // Weak reference. Session history owns this.
|
||||||
|
|||||||
@@ -40,7 +40,6 @@
|
|||||||
|
|
||||||
#include "nsEditorShell.h"
|
#include "nsEditorShell.h"
|
||||||
#include "nsIPlaintextEditor.h"
|
#include "nsIPlaintextEditor.h"
|
||||||
#include "nsIWebShell.h"
|
|
||||||
#include "nsIBaseWindow.h"
|
#include "nsIBaseWindow.h"
|
||||||
#include "nsIContentViewerFile.h"
|
#include "nsIContentViewerFile.h"
|
||||||
#include "prprf.h"
|
#include "prprf.h"
|
||||||
@@ -2827,10 +2826,13 @@ nsEditorShell::DoAfterSave(PRBool aShouldUpdateURL, const PRUnichar *aURLString)
|
|||||||
if (aShouldUpdateURL)
|
if (aShouldUpdateURL)
|
||||||
{
|
{
|
||||||
NS_ENSURE_ARG_POINTER(aURLString);
|
NS_ENSURE_ARG_POINTER(aURLString);
|
||||||
nsCOMPtr<nsIWebShell> webShell(do_QueryInterface(mContentAreaDocShell));
|
nsCOMPtr<nsIURI> uri;
|
||||||
if (!webShell) return NS_ERROR_NULL_POINTER;
|
nsresult rv = NS_NewURI(getter_AddRefs(uri), nsDependentString(aURLString), nsnull);
|
||||||
|
NS_ASSERTION(NS_SUCCEEDED(rv), "Failed to create a uri");
|
||||||
nsresult res = webShell->SetURL(aURLString);
|
if (NS_SUCCEEDED(rv))
|
||||||
|
{
|
||||||
|
mContentAreaDocShell->SetCurrentURI(uri);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Update window title to show possibly different filename
|
// Update window title to show possibly different filename
|
||||||
|
|||||||
@@ -82,10 +82,16 @@ public:
|
|||||||
* Web shells are also nsIWebShellContainer's because they can contain
|
* Web shells are also nsIWebShellContainer's because they can contain
|
||||||
* other web shells.
|
* other web shells.
|
||||||
*/
|
*/
|
||||||
class nsIWebShell : public nsIContentViewerContainer {
|
class nsIWebShell : public nsISupports {
|
||||||
public:
|
public:
|
||||||
static const nsIID& GetIID() { static nsIID iid = NS_IWEB_SHELL_IID; return iid; }
|
static const nsIID& GetIID() { static nsIID iid = NS_IWEB_SHELL_IID; return iid; }
|
||||||
|
|
||||||
|
/**
|
||||||
|
* WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING !!!!
|
||||||
|
*
|
||||||
|
* THIS INTERFACE IS DEPRECATED. DO NOT ADD STUFF OR CODE TO IT!!!!
|
||||||
|
*/
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Set the nsIWebShellContainer for the WebShell.
|
* Set the nsIWebShellContainer for the WebShell.
|
||||||
*/
|
*/
|
||||||
@@ -96,56 +102,10 @@ public:
|
|||||||
*/
|
*/
|
||||||
NS_IMETHOD GetContainer(nsIWebShellContainer*& aResult) = 0;
|
NS_IMETHOD GetContainer(nsIWebShellContainer*& aResult) = 0;
|
||||||
|
|
||||||
/**
|
|
||||||
* Returns the top level window (this would be the containing window
|
|
||||||
* the same object that implements nsIWebShellContainer, nsIWebShellWindow).
|
|
||||||
*/
|
|
||||||
NS_IMETHOD GetTopLevelWindow(nsIWebShellContainer** aTopLevelWindow) = 0;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Return the root WebShell instance. Since WebShells can be nested
|
|
||||||
* (when frames are present for example) this instance represents the
|
|
||||||
* outermost WebShell.
|
|
||||||
*/
|
|
||||||
NS_IMETHOD GetRootWebShell(nsIWebShell*& aResult) = 0;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Get the referrer of the link using this WebShell.
|
|
||||||
*/
|
|
||||||
NS_IMETHOD GetReferrer(nsIURI **aReferrer) = 0;
|
|
||||||
|
|
||||||
//
|
|
||||||
// Document load api's
|
|
||||||
//
|
|
||||||
/**
|
/**
|
||||||
* Return the nsIDocumentLoader associated with the WebShell.
|
* Return the nsIDocumentLoader associated with the WebShell.
|
||||||
*/
|
*/
|
||||||
NS_IMETHOD GetDocumentLoader(nsIDocumentLoader*& aResult) = 0;
|
NS_IMETHOD GetDocumentLoader(nsIDocumentLoader*& aResult) = 0;
|
||||||
|
|
||||||
//
|
|
||||||
// History api's
|
|
||||||
//
|
|
||||||
/**
|
|
||||||
* Load the previous document in the history list.
|
|
||||||
*/
|
|
||||||
NS_IMETHOD GoTo(PRInt32 aHistoryIndex) = 0;
|
|
||||||
NS_IMETHOD GetHistoryLength(PRInt32& aResult) = 0;
|
|
||||||
NS_IMETHOD GetHistoryIndex(PRInt32& aResult) = 0;
|
|
||||||
NS_IMETHOD GetURL(PRInt32 aHistoryIndex, PRUnichar **aURLResult) = 0;
|
|
||||||
|
|
||||||
// SetToolBar
|
|
||||||
// SetMenuBar
|
|
||||||
// SetStatusBar
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Finds text in content
|
|
||||||
*/
|
|
||||||
NS_IMETHOD FindNext(const PRUnichar * aSearchStr, PRBool aMatchCase, PRBool aSearchDown, PRBool &aIsFound) = 0;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Set the URL of the current WebShell.
|
|
||||||
*/
|
|
||||||
NS_IMETHOD SetURL(const PRUnichar* aURL) = 0;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif /* nsIWebShell_h___ */
|
#endif /* nsIWebShell_h___ */
|
||||||
|
|||||||
@@ -807,13 +807,13 @@ nsBrowserWindow::DispatchMenuItem(PRInt32 aID)
|
|||||||
|
|
||||||
case VIEW_SOURCE:
|
case VIEW_SOURCE:
|
||||||
{
|
{
|
||||||
PRInt32 theIndex;
|
// PRInt32 theIndex;
|
||||||
nsCOMPtr<nsIWebShell> webShell(do_QueryInterface(mDocShell));
|
// nsCOMPtr<nsIWebShell> webShell(do_QueryInterface(mDocShell));
|
||||||
webShell->GetHistoryIndex(theIndex);
|
// webShell->GetHistoryIndex(theIndex);
|
||||||
nsXPIDLString theURL;
|
// nsXPIDLString theURL;
|
||||||
webShell->GetURL(theIndex, getter_Copies(theURL));
|
// webShell->GetURL(theIndex, getter_Copies(theURL));
|
||||||
nsAutoString theString(theURL);
|
// nsAutoString theString(theURL);
|
||||||
mApp->ViewSource(theString);
|
// mApp->ViewSource(theString);
|
||||||
//XXX Find out how the string is allocated, and perhaps delete it...
|
//XXX Find out how the string is allocated, and perhaps delete it...
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
@@ -1532,7 +1532,8 @@ nsnull, r.x, r.y, r.width, r.height);
|
|||||||
nsIDocumentViewer* docv;
|
nsIDocumentViewer* docv;
|
||||||
aDocumentViewer->CreateDocumentViewerUsing(aPresContext, docv);
|
aDocumentViewer->CreateDocumentViewerUsing(aPresContext, docv);
|
||||||
docv->SetContainer(mWebBrowser);
|
docv->SetContainer(mWebBrowser);
|
||||||
webShell->Embed(docv, "duh", nsnull);
|
nsCOMPtr<nsIContentViewerContainer> cvContainer = do_QueryInterface(mDocShell);
|
||||||
|
cvContainer->Embed(docv, "duh", nsnull);
|
||||||
|
|
||||||
|
|
||||||
webBrowserWin->SetVisibility(PR_TRUE);
|
webBrowserWin->SetVisibility(PR_TRUE);
|
||||||
|
|||||||
Reference in New Issue
Block a user