Clean up xpfe/appshell, removing nsIWebShellWindow in the process. Bug 282200, r=danm, sr=bzbarsky.

git-svn-id: svn://10.0.0.236/trunk@169504 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
bryner%brianryner.com
2005-02-19 22:42:01 +00:00
parent c3215ef0ec
commit f1c9d92868
17 changed files with 241 additions and 1167 deletions

View File

@@ -38,44 +38,22 @@
#ifndef nsWebShellWindow_h__
#define nsWebShellWindow_h__
#include "nsISupports.h"
#include "nsIWebShellWindow.h"
#include "nsGUIEvent.h"
#include "nsIWebProgressListener.h"
#include "nsIDocumentObserver.h"
#include "nsVoidArray.h"
#include "nsIMenu.h"
#include "nsITimer.h"
#include "nsIPrompt.h"
// can't use forward class decl's because of template bugs on Solaris
#include "nsIDOMDocument.h"
#include "nsIDOMNode.h"
#include "nsCOMPtr.h"
#include "nsXULWindow.h"
/* Forward declarations.... */
struct PLEvent;
class nsIURI;
class nsIAppShell;
class nsIContent;
class nsIDocument;
class nsIDOMCharacterData;
class nsIDOMElement;
class nsIDOMWindowInternal;
class nsIDOMHTMLImageElement;
class nsIDOMHTMLInputElement;
class nsIStreamObserver;
class nsIWidget;
class nsVoidArray;
class nsWebShellWindow : public nsXULWindow,
public nsIWebShellWindow,
public nsIWebProgressListener,
public nsIDocumentObserver
public nsIWebProgressListener
{
public:
nsWebShellWindow();
@@ -83,78 +61,38 @@ public:
// nsISupports interface...
NS_DECL_ISUPPORTS_INHERITED
NS_IMETHOD LockUntilChromeLoad() { mLockedUntilChromeLoad = PR_TRUE; return NS_OK; }
NS_IMETHOD GetLockedState(PRBool& aResult) { aResult = mLockedUntilChromeLoad; return NS_OK; }
NS_IMETHOD ShouldLoadDefaultPage(PRBool *aYes)
{ *aYes = mLoadDefaultPage; return NS_OK; }
// nsIWebShellWindow methods...
NS_IMETHOD Show(PRBool aShow);
NS_IMETHOD ShowModal();
NS_IMETHOD Toolbar();
NS_IMETHOD Close();
NS_IMETHOD GetDocShell(nsIDocShell *& aWebShell);
NS_IMETHOD GetContentDocShell(nsIDocShell **aResult);
NS_IMETHOD GetWidget(nsIWidget *& aWidget);
NS_IMETHOD GetDOMWindow(nsIDOMWindowInternal** aDOMWindow);
NS_IMETHOD ConvertDocShellToDOMWindow(nsIDocShell* aShell, nsIDOMWindowInternal** aDOMWindow);
// nsWebShellWindow methods...
nsresult Initialize(nsIXULWindow * aParent, nsIAppShell* aShell, nsIURI* aUrl,
PRBool aCreatedVisible, PRBool aLoadDefaultPage,
nsresult Initialize(nsIXULWindow * aParent, nsIAppShell* aShell,
nsIURI* aUrl,
PRInt32 aInitialWidth, PRInt32 aInitialHeight,
PRBool aIsHiddenWindow, nsWidgetInitData& widgetInitData);
nsIWidget* GetWidget(void) { return mWindow; }
PRBool aIsHiddenWindow,
nsWidgetInitData& widgetInitData);
nsresult Toolbar();
// nsIWebProgressListener
NS_DECL_NSIWEBPROGRESSLISTENER
// nsIDocumentObserver
NS_DECL_NSIDOCUMENTOBSERVER
// nsINetSupport
// nsIBaseWindow
NS_IMETHOD Destroy();
protected:
nsCOMPtr<nsIDOMNode> FindNamedDOMNode(const nsAString &aName, nsIDOMNode * aParent, PRInt32 & aCount, PRInt32 aEndCount);
nsCOMPtr<nsIDOMDocument> GetNamedDOMDoc(const nsAString & aWebShellName);
void DynamicLoadMenus(nsIDOMDocument * aDOMDoc, nsIWidget * aParentWindow);
#if 0
void LoadMenus(nsIDOMDocument * aDOMDoc, nsIWidget * aParentWindow);
NS_IMETHOD CreateMenu(nsIMenuBar * aMenuBar, nsIDOMNode * aMenuNode, nsString & aMenuName);
void LoadSubMenu(nsIMenu * pParentMenu, nsIDOMElement * menuElement,nsIDOMNode * menuNode);
NS_IMETHOD LoadMenuItem(nsIMenu * pParentMenu, nsIDOMElement * menuitemElement, nsIDOMNode * menuitemNode);
#endif
virtual ~nsWebShellWindow();
nsCOMPtr<nsIDOMDocument> GetNamedDOMDoc(const nsAString & aWebShellName);
void LoadNativeMenus(nsIDOMDocument * aDOMDoc, nsIWidget * aParentWindow);
nsCOMPtr<nsIDOMNode> GetDOMNodeFromDocShell(nsIDocShell *aShell);
void ExecuteStartupCode();
void LoadContentAreas();
PRBool ExecuteCloseHandler();
virtual ~nsWebShellWindow();
static nsEventStatus PR_CALLBACK HandleEvent(nsGUIEvent *aEvent);
PRBool mLockedUntilChromeLoad;
PRBool mLoadDefaultPage;
nsVoidArray mMenuDelegates;
nsIDOMNode * contextMenuTest;
nsCOMPtr<nsITimer> mSPTimer;
PRLock * mSPTimerLock;
nsCOMPtr<nsIPrompt> mPrompter;
void SetPersistenceTimer(PRUint32 aDirtyFlags);
static void FirePersistenceTimer(nsITimer *aTimer, void *aClosure);
private:
static void * HandleModalDialogEvent(PLEvent *aEvent);
static void DestroyModalDialogEvent(PLEvent *aEvent);
};