From 3c5a502225dfd96f3029fe5bc00a62c037255bb8 Mon Sep 17 00:00:00 2001 From: "danm%netscape.com" Date: Wed, 11 Sep 2002 04:28:44 +0000 Subject: [PATCH] temporary amaaaaazing makefile stupidity to get extension-less builds to build. i promise to sort out the real problem tomorrow. git-svn-id: svn://10.0.0.236/trunk@129230 18797224-902f-48f8-a5cc-f745e15eee43 --- mozilla/xpfe/bootstrap/Makefile.in | 4 ++++ mozilla/xpfe/bootstrap/nsWindowCreator.cpp | 12 +++++++++++- 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/mozilla/xpfe/bootstrap/Makefile.in b/mozilla/xpfe/bootstrap/Makefile.in index cd790161318..63bdf7dc109 100644 --- a/mozilla/xpfe/bootstrap/Makefile.in +++ b/mozilla/xpfe/bootstrap/Makefile.in @@ -176,6 +176,10 @@ CPPSRCS += nsNativeAppSupportWin.cpp nsNativeAppSupportBase.cpp OS_LIBS += comctl32.lib comdlg32.lib uuid.lib shell32.lib ole32.lib oleaut32.lib version.lib winspool.lib endif +ifneq (,$(filter cookie,$(MOZ_EXTENSIONS))) +DEFINES += -DUSE_POPUP_MANAGER +endif + ifneq (,$(filter windows os2 gtk gtk2,$(MOZ_WIDGET_TOOLKIT))) ifneq (,$(filter windows os2,$(MOZ_WIDGET_TOOLKIT))) ICON_SUFFIX=.ico diff --git a/mozilla/xpfe/bootstrap/nsWindowCreator.cpp b/mozilla/xpfe/bootstrap/nsWindowCreator.cpp index 1a412478a30..c64bb7d0e04 100644 --- a/mozilla/xpfe/bootstrap/nsWindowCreator.cpp +++ b/mozilla/xpfe/bootstrap/nsWindowCreator.cpp @@ -80,12 +80,14 @@ #include "nsIInterfaceRequestor.h" #include "nsIInterfaceRequestorUtils.h" #include "nsIJSContextStack.h" -#include "nsIPopupWindowManager.h" #include "nsIPref.h" #include "nsIServiceManager.h" #include "nsIURI.h" #include "nsIXULWindow.h" #include "nsIWebBrowserChrome.h" +#ifdef USE_POPUP_MANAGER +#include "nsIPopupWindowManager.h" +#endif static NS_DEFINE_CID(kAppShellServiceCID, NS_APPSHELL_SERVICE_CID); static NS_DEFINE_CID(kAppShellCID, NS_APPSHELL_CID); @@ -117,21 +119,25 @@ nsWindowCreator::CreateChromeWindow2(nsIWebBrowserChrome *aParent, NS_ENSURE_ARG_POINTER(_retval); *_retval = 0; +#ifdef USE_POPUP_MANAGER PRUint32 allow = nsIPopupWindowManager::eAllow; nsCOMPtr parentURI; GetParentURI(aParent, getter_AddRefs(parentURI)); if (aContextFlags & PARENT_IS_LOADING_OR_RUNNING_TIMEOUT) allow = AllowWindowCreation(parentURI); +#endif nsCOMPtr newWindow; if (aParent) { +#ifdef USE_POPUP_MANAGER if (allow == nsIPopupWindowManager::eDisallow) return NS_OK; // ruse to not give scripts a catchable error if (allow == nsIPopupWindowManager::eAllow && (aContextFlags & PARENT_IS_LOADING_OR_RUNNING_TIMEOUT)) aContextFlags &= ~PARENT_IS_LOADING_OR_RUNNING_TIMEOUT; +#endif nsCOMPtr xulParent(do_GetInterface(aParent)); NS_ASSERTION(xulParent, "window created using non-XUL parent. that's unexpected, but may work."); @@ -170,6 +176,7 @@ nsWindowCreator::CreateChromeWindow2(nsIWebBrowserChrome *aParent, PRUint32 nsWindowCreator::AllowWindowCreation(nsIURI *aURI) { +#ifdef USE_POPUP_MANAGER nsCOMPtr pm(do_GetService(NS_POPUPWINDOWMANAGER_CONTRACTID)); if (!pm) return nsIPopupWindowManager::eAllow; @@ -178,6 +185,9 @@ nsWindowCreator::AllowWindowCreation(nsIURI *aURI) if (NS_SUCCEEDED(pm->TestPermission(aURI, &permission))) return permission; return nsIPopupWindowManager::eAllow; +#else + return 1; +#endif } void