зеркало из https://github.com/mozilla/gecko-dev.git
Added configurablility of nsXPBaseWindow
This commit is contained in:
Родитель
bc6ca3753f
Коммит
867e0b2971
|
@ -174,7 +174,7 @@ static NS_DEFINE_IID(kIToolbarItemIID, NS_ITOOLBARITEM_IID);
|
|||
static NS_DEFINE_IID(kIPopUpMenuIID, NS_IPOPUPMENU_IID);
|
||||
static NS_DEFINE_IID(kIMenuButtonIID, NS_IMENUBUTTON_IID);
|
||||
static NS_DEFINE_IID(kIXPBaseWindowIID, NS_IXPBASE_WINDOW_IID);
|
||||
static NS_DEFINE_IID(kINetSupportIID, NS_INETSUPPORT_IID);
|
||||
//static NS_DEFINE_IID(kINetSupportIID, NS_INETSUPPORT_IID);
|
||||
|
||||
static const char* gsAOLFormat = "AOLMAIL";
|
||||
static const char* gsHTMLFormat = "text/html";
|
||||
|
@ -1070,7 +1070,7 @@ void nsBrowserWindow::DoFind()
|
|||
kIXPBaseWindowIID,
|
||||
(void**) &dialog);
|
||||
if (rv == NS_OK) {
|
||||
dialog->Init(mAppShell, nsnull, findHTML, title, rect, PRUint32(~0), PR_FALSE);
|
||||
dialog->Init(eXPBaseWindowType_window, mAppShell, nsnull, findHTML, title, rect, PRUint32(~0), PR_FALSE);
|
||||
dialog->SetVisible(PR_TRUE);
|
||||
if (NS_OK == dialog->QueryInterface(kIXPBaseWindowIID, (void**) &mXPDialog)) {
|
||||
}
|
||||
|
|
|
@ -27,6 +27,7 @@
|
|||
#include "nsXPBaseWindow.h"
|
||||
#endif
|
||||
|
||||
#include "nsINetSupport.h"
|
||||
#include "nsIAppShell.h"
|
||||
#include "nsIWidget.h"
|
||||
#include "nsIDOMDocument.h"
|
||||
|
@ -46,6 +47,7 @@
|
|||
#include "nsHTMLContentSinkStream.h"
|
||||
#include "nsIDocument.h"
|
||||
#include "nsIDOMEventReceiver.h"
|
||||
#include "nsIDOMElement.h"
|
||||
#include "nsWindowListener.h"
|
||||
|
||||
|
||||
|
@ -63,6 +65,8 @@
|
|||
static NS_DEFINE_IID(kXPBaseWindowCID, NS_XPBASE_WINDOW_CID);
|
||||
static NS_DEFINE_IID(kWebShellCID, NS_WEB_SHELL_CID);
|
||||
static NS_DEFINE_IID(kWindowCID, NS_WINDOW_CID);
|
||||
static NS_DEFINE_IID(kDialogCID, NS_DIALOG_CID);
|
||||
|
||||
|
||||
static NS_DEFINE_IID(kIXPBaseWindowIID, NS_IXPBASE_WINDOW_IID);
|
||||
static NS_DEFINE_IID(kIStreamObserverIID, NS_ISTREAMOBSERVER_IID);
|
||||
|
@ -78,7 +82,7 @@ static NS_DEFINE_IID(kIDOMMouseListenerIID, NS_IDOMMOUSELISTENER_IID);
|
|||
static NS_DEFINE_IID(kIDOMEventReceiverIID, NS_IDOMEVENTRECEIVER_IID);
|
||||
static NS_DEFINE_IID(kIDOMElementIID, NS_IDOMELEMENT_IID);
|
||||
|
||||
static NS_DEFINE_IID(kINetSupportIID, NS_INETSUPPORT_IID);
|
||||
//static NS_DEFINE_IID(kINetSupportIID, NS_INETSUPPORT_IID);
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
nsXPBaseWindow::nsXPBaseWindow() :
|
||||
|
@ -185,25 +189,33 @@ HandleXPDialogEvent(nsGUIEvent *aEvent)
|
|||
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
nsresult nsXPBaseWindow::Init(nsIAppShell* aAppShell,
|
||||
nsIPref* aPrefs,
|
||||
const nsString& aDialogURL,
|
||||
const nsString& aTitle,
|
||||
const nsRect& aBounds,
|
||||
PRUint32 aChromeMask,
|
||||
PRBool aAllowPlugins)
|
||||
nsresult nsXPBaseWindow::Init(nsXPBaseWindowType aType,
|
||||
nsIAppShell* aAppShell,
|
||||
nsIPref* aPrefs,
|
||||
const nsString& aDialogURL,
|
||||
const nsString& aTitle,
|
||||
const nsRect& aBounds,
|
||||
PRUint32 aChromeMask,
|
||||
PRBool aAllowPlugins)
|
||||
{
|
||||
mAllowPlugins = aAllowPlugins;
|
||||
|
||||
mAppShell = aAppShell;
|
||||
mWindowType = aType;
|
||||
mAppShell = aAppShell;
|
||||
NS_IF_ADDREF(mAppShell);
|
||||
|
||||
mPrefs = aPrefs;
|
||||
NS_IF_ADDREF(mPrefs);
|
||||
|
||||
// Create top level window
|
||||
nsresult rv = nsRepository::CreateInstance(kWindowCID, nsnull, kIWidgetIID,
|
||||
nsresult rv;
|
||||
if (aType == eXPBaseWindowType_window) {
|
||||
nsRepository::CreateInstance(kWindowCID, nsnull, kIWidgetIID,
|
||||
(void**)&mWindow);
|
||||
} else {
|
||||
nsRepository::CreateInstance(kDialogCID, nsnull, kIWidgetIID,
|
||||
(void**)&mWindow);
|
||||
}
|
||||
|
||||
if (NS_OK != rv) {
|
||||
return rv;
|
||||
}
|
||||
|
@ -583,7 +595,7 @@ NS_IMETHODIMP nsXPBaseWindow::NewWebShell(nsIWebShell*& aNewWebShell)
|
|||
nsRect bounds;
|
||||
GetBounds(bounds);
|
||||
|
||||
rv = dialogWindow->Init(mAppShell, mPrefs, mDialogURL, mTitle, bounds, 0, mAllowPlugins);
|
||||
rv = dialogWindow->Init(mWindowType, mAppShell, mPrefs, mDialogURL, mTitle, bounds, 0, mAllowPlugins);
|
||||
if (NS_OK == rv) {
|
||||
dialogWindow->SetVisible(PR_TRUE);
|
||||
nsIWebShell *shell;
|
||||
|
|
|
@ -61,13 +61,14 @@ public:
|
|||
NS_DECL_ISUPPORTS
|
||||
|
||||
// nsIBrowserWindow
|
||||
NS_IMETHOD Init(nsIAppShell* aAppShell,
|
||||
nsIPref* aPrefs,
|
||||
const nsString& aDialogURL,
|
||||
const nsString& aTitle,
|
||||
const nsRect& aBounds,
|
||||
PRUint32 aChromeMask,
|
||||
PRBool aAllowPlugins = PR_TRUE);
|
||||
NS_IMETHOD Init(nsXPBaseWindowType aType,
|
||||
nsIAppShell* aAppShell,
|
||||
nsIPref* aPrefs,
|
||||
const nsString& aDialogURL,
|
||||
const nsString& aTitle,
|
||||
const nsRect& aBounds,
|
||||
PRUint32 aChromeMask,
|
||||
PRBool aAllowPlugins = PR_TRUE);
|
||||
|
||||
NS_IMETHOD SetLocation(PRInt32 aX, PRInt32 aY);
|
||||
NS_IMETHOD SetDimensions(PRInt32 aWidth, PRInt32 aHeight);
|
||||
|
@ -162,6 +163,7 @@ protected:
|
|||
nsIPref* mPrefs; //not addref'ed!
|
||||
PRBool mAllowPlugins;
|
||||
|
||||
nsXPBaseWindowType mWindowType;
|
||||
|
||||
};
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче