From 2a37cb4a1f1dc63e00f7cd8bca9718576941431d Mon Sep 17 00:00:00 2001 From: Neil Deakin Date: Fri, 14 Oct 2011 09:06:39 -0400 Subject: [PATCH] Bug 694224, remove appshell argument from various widget creation methods, r=roc --- embedding/browser/webBrowser/nsWebBrowser.cpp | 2 +- layout/generic/nsObjectFrame.cpp | 2 +- toolkit/components/startup/nsAppStartup.cpp | 6 +++--- view/src/nsView.cpp | 8 ++++---- widget/public/nsIWidget.h | 9 ++------- widget/src/android/nsWindow.cpp | 3 +-- widget/src/android/nsWindow.h | 1 - widget/src/cocoa/nsChildView.h | 3 --- widget/src/cocoa/nsChildView.mm | 3 +-- widget/src/cocoa/nsCocoaWindow.h | 2 -- widget/src/cocoa/nsCocoaWindow.mm | 9 +++------ widget/src/gtk2/nsWindow.cpp | 3 +-- widget/src/gtk2/nsWindow.h | 1 - widget/src/os2/nsWindow.cpp | 3 +-- widget/src/os2/nsWindow.h | 1 - widget/src/qt/nsWindow.cpp | 5 +---- widget/src/qt/nsWindow.h | 2 -- widget/src/windows/nsWindow.cpp | 4 +--- widget/src/windows/nsWindow.h | 1 - widget/src/xpwidgets/PuppetWidget.cpp | 6 ++---- widget/src/xpwidgets/PuppetWidget.h | 2 -- widget/src/xpwidgets/nsBaseWidget.cpp | 4 +--- widget/src/xpwidgets/nsBaseWidget.h | 3 --- widget/tests/TestWinTSF.cpp | 2 +- xpfe/appshell/public/nsIAppShellService.idl | 9 +++------ xpfe/appshell/public/nsIXULWindow.idl | 6 ++---- xpfe/appshell/src/nsAppShellService.cpp | 11 ++++------- xpfe/appshell/src/nsAppShellService.h | 2 +- xpfe/appshell/src/nsWebShellWindow.cpp | 6 +----- xpfe/appshell/src/nsWebShellWindow.h | 3 +-- xpfe/appshell/src/nsXULWindow.cpp | 14 +++++++------- xpfe/appshell/src/nsXULWindow.h | 6 ++---- 32 files changed, 45 insertions(+), 97 deletions(-) diff --git a/embedding/browser/webBrowser/nsWebBrowser.cpp b/embedding/browser/webBrowser/nsWebBrowser.cpp index bd0aa628f56..50cd841ea86 100644 --- a/embedding/browser/webBrowser/nsWebBrowser.cpp +++ b/embedding/browser/webBrowser/nsWebBrowser.cpp @@ -1156,7 +1156,7 @@ NS_IMETHODIMP nsWebBrowser::Create() mInternalWidget->SetClientData(static_cast(this)); mInternalWidget->Create(nsnull, mParentNativeWindow, bounds, nsWebBrowser::HandleEvent, - nsnull, nsnull, nsnull, &widgetInit); + nsnull, nsnull, &widgetInit); } nsCOMPtr docShell(do_CreateInstance("@mozilla.org/docshell;1", &rv)); diff --git a/layout/generic/nsObjectFrame.cpp b/layout/generic/nsObjectFrame.cpp index a60270bcc6d..af1160049ad 100644 --- a/layout/generic/nsObjectFrame.cpp +++ b/layout/generic/nsObjectFrame.cpp @@ -468,7 +468,7 @@ nsObjectFrame::CreateWidget(nscoord aWidth, // mWidget isn't the view's designated widget. EVENT_CALLBACK eventHandler = mInnerView->AttachWidgetEventHandler(mWidget); rv = mWidget->Create(parentWidget, nsnull, nsIntRect(0,0,0,0), - eventHandler, dx, nsnull, nsnull, &initData); + eventHandler, dx, nsnull, &initData); if (NS_FAILED(rv)) { mWidget->Destroy(); mWidget = nsnull; diff --git a/toolkit/components/startup/nsAppStartup.cpp b/toolkit/components/startup/nsAppStartup.cpp index 806efd39334..333f185601e 100644 --- a/toolkit/components/startup/nsAppStartup.cpp +++ b/toolkit/components/startup/nsAppStartup.cpp @@ -194,7 +194,7 @@ nsAppStartup::CreateHiddenWindow() (do_GetService(NS_APPSHELLSERVICE_CONTRACTID)); NS_ENSURE_TRUE(appShellService, NS_ERROR_FAILURE); - return appShellService->CreateHiddenWindow(mAppShell); + return appShellService->CreateHiddenWindow(); } @@ -512,7 +512,7 @@ nsAppStartup::CreateChromeWindow2(nsIWebBrowserChrome *aParent, NS_ASSERTION(xulParent, "window created using non-XUL parent. that's unexpected, but may work."); if (xulParent) - xulParent->CreateNewWindow(aChromeFlags, mAppShell, getter_AddRefs(newWindow)); + xulParent->CreateNewWindow(aChromeFlags, getter_AddRefs(newWindow)); // And if it fails, don't try again without a parent. It could fail // intentionally (bug 115969). } else { // try using basic methods: @@ -529,7 +529,7 @@ nsAppStartup::CreateChromeWindow2(nsIWebBrowserChrome *aParent, appShell->CreateTopLevelWindow(0, 0, aChromeFlags, nsIAppShellService::SIZE_TO_CONTENT, nsIAppShellService::SIZE_TO_CONTENT, - mAppShell, getter_AddRefs(newWindow)); + getter_AddRefs(newWindow)); } // if anybody gave us anything to work with, use it diff --git a/view/src/nsView.cpp b/view/src/nsView.cpp index 2b95c7b8101..b6a47568d5d 100644 --- a/view/src/nsView.cpp +++ b/view/src/nsView.cpp @@ -747,7 +747,7 @@ nsresult nsView::CreateWidget(nsWidgetInitData *aWidgetInitData, // XXX: using aForceUseIWidgetParent=true to preserve previous // semantics. It's not clear that it's actually needed. mWindow = parentWidget->CreateChild(trect, ::HandleEvent, - dx, nsnull, nsnull, aWidgetInitData, + dx, nsnull, aWidgetInitData, PR_TRUE).get(); if (!mWindow) { return NS_ERROR_FAILURE; @@ -779,7 +779,7 @@ nsresult nsView::CreateWidgetForParent(nsIWidget* aParentWidget, mWindow = aParentWidget->CreateChild(trect, ::HandleEvent, - dx, nsnull, nsnull, aWidgetInitData).get(); + dx, nsnull, aWidgetInitData).get(); if (!mWindow) { return NS_ERROR_FAILURE; } @@ -812,7 +812,7 @@ nsresult nsView::CreateWidgetForPopup(nsWidgetInitData *aWidgetInitData, // XXX: using aForceUseIWidgetParent=true to preserve previous // semantics. It's not clear that it's actually needed. mWindow = aParentWidget->CreateChild(trect, ::HandleEvent, - dx, nsnull, nsnull, aWidgetInitData, + dx, nsnull, aWidgetInitData, PR_TRUE).get(); } else { @@ -826,7 +826,7 @@ nsresult nsView::CreateWidgetForPopup(nsWidgetInitData *aWidgetInitData, mWindow = nearestParent->CreateChild(trect, ::HandleEvent, - dx, nsnull, nsnull, aWidgetInitData).get(); + dx, nsnull, aWidgetInitData).get(); } if (!mWindow) { return NS_ERROR_FAILURE; diff --git a/widget/public/nsIWidget.h b/widget/public/nsIWidget.h index 17e46f6dc39..10b1b0cd35d 100644 --- a/widget/public/nsIWidget.h +++ b/widget/public/nsIWidget.h @@ -57,7 +57,6 @@ #include "nsXULAppAPI.h" // forward declarations -class nsIAppShell; class nsIToolkit; class nsFontMetrics; class nsRenderingContext; @@ -121,8 +120,8 @@ typedef nsEventStatus (* EVENT_CALLBACK)(nsGUIEvent *event); #endif #define NS_IWIDGET_IID \ - { 0xf43254ce, 0xd315, 0x458b, \ - { 0xba, 0x72, 0xa8, 0xdf, 0x21, 0xcf, 0xa7, 0x2a } } + { 0x64e1ee3d, 0xe0f2, 0x4ace, \ + { 0x91, 0xb7, 0xdc, 0xd1, 0xbe, 0x69, 0xb6, 0xe6 } } /* * Window shadow styles @@ -326,8 +325,6 @@ class nsIWidget : public nsISupports { * @param aRect the widget dimension * @param aHandleEventFunction the event handler callback function * @param aContext - * @param aAppShell the parent application shell. If nsnull, - * the parent window's application shell will be used. * @param aToolkit * @param aInitData data that is used for widget initialization * @@ -337,7 +334,6 @@ class nsIWidget : public nsISupports { const nsIntRect &aRect, EVENT_CALLBACK aHandleEventFunction, nsDeviceContext *aContext, - nsIAppShell *aAppShell = nsnull, nsIToolkit *aToolkit = nsnull, nsWidgetInitData *aInitData = nsnull) = 0; @@ -361,7 +357,6 @@ class nsIWidget : public nsISupports { CreateChild(const nsIntRect &aRect, EVENT_CALLBACK aHandleEventFunction, nsDeviceContext *aContext, - nsIAppShell *aAppShell = nsnull, nsIToolkit *aToolkit = nsnull, nsWidgetInitData *aInitData = nsnull, bool aForceUseIWidgetParent = false) = 0; diff --git a/widget/src/android/nsWindow.cpp b/widget/src/android/nsWindow.cpp index 389c56943ff..e8733638da4 100644 --- a/widget/src/android/nsWindow.cpp +++ b/widget/src/android/nsWindow.cpp @@ -202,7 +202,6 @@ nsWindow::Create(nsIWidget *aParent, const nsIntRect &aRect, EVENT_CALLBACK aHandleEventFunction, nsDeviceContext *aContext, - nsIAppShell *aAppShell, nsIToolkit *aToolkit, nsWidgetInitData *aInitData) { @@ -232,7 +231,7 @@ nsWindow::Create(nsIWidget *aParent, } BaseCreate(nsnull, mBounds, aHandleEventFunction, aContext, - aAppShell, aToolkit, aInitData); + aToolkit, aInitData); NS_ASSERTION(IsTopLevel() || parent, "non top level windowdoesn't have a parent!"); diff --git a/widget/src/android/nsWindow.h b/widget/src/android/nsWindow.h index e7b15fe9fd6..57d3c36f60e 100644 --- a/widget/src/android/nsWindow.h +++ b/widget/src/android/nsWindow.h @@ -87,7 +87,6 @@ public: const nsIntRect &aRect, EVENT_CALLBACK aHandleEventFunction, nsDeviceContext *aContext, - nsIAppShell *aAppShell, nsIToolkit *aToolkit, nsWidgetInitData *aInitData); NS_IMETHOD Destroy(void); diff --git a/widget/src/cocoa/nsChildView.h b/widget/src/cocoa/nsChildView.h index fbd786fda8c..ab8edb1ebdf 100644 --- a/widget/src/cocoa/nsChildView.h +++ b/widget/src/cocoa/nsChildView.h @@ -55,8 +55,6 @@ #include "TextInputHandler.h" #include "nsCocoaUtils.h" -#include "nsIAppShell.h" - #include "nsString.h" #include "nsIDragService.h" @@ -398,7 +396,6 @@ public: const nsIntRect &aRect, EVENT_CALLBACK aHandleEventFunction, nsDeviceContext *aContext, - nsIAppShell *aAppShell = nsnull, nsIToolkit *aToolkit = nsnull, nsWidgetInitData *aInitData = nsnull); diff --git a/widget/src/cocoa/nsChildView.mm b/widget/src/cocoa/nsChildView.mm index 1378583f4f7..fa8e9a4b1e3 100644 --- a/widget/src/cocoa/nsChildView.mm +++ b/widget/src/cocoa/nsChildView.mm @@ -291,7 +291,6 @@ nsresult nsChildView::Create(nsIWidget *aParent, const nsIntRect &aRect, EVENT_CALLBACK aHandleEventFunction, nsDeviceContext *aContext, - nsIAppShell *aAppShell, nsIToolkit *aToolkit, nsWidgetInitData *aInitData) { @@ -324,7 +323,7 @@ nsresult nsChildView::Create(nsIWidget *aParent, mBounds = aRect; BaseCreate(aParent, aRect, aHandleEventFunction, - aContext, aAppShell, aToolkit, aInitData); + aContext, aToolkit, aInitData); // inherit things from the parent view and create our parallel // NSView in the Cocoa display system diff --git a/widget/src/cocoa/nsCocoaWindow.h b/widget/src/cocoa/nsCocoaWindow.h index 43a108e9705..4ea6fbcc6f9 100644 --- a/widget/src/cocoa/nsCocoaWindow.h +++ b/widget/src/cocoa/nsCocoaWindow.h @@ -216,7 +216,6 @@ public: const nsIntRect &aRect, EVENT_CALLBACK aHandleEventFunction, nsDeviceContext *aContext, - nsIAppShell *aAppShell = nsnull, nsIToolkit *aToolkit = nsnull, nsWidgetInitData *aInitData = nsnull); @@ -309,7 +308,6 @@ protected: nsresult CreatePopupContentView(const nsIntRect &aRect, EVENT_CALLBACK aHandleEventFunction, nsDeviceContext *aContext, - nsIAppShell *aAppShell, nsIToolkit *aToolkit); void DestroyNativeWindow(); void AdjustWindowShadow(); diff --git a/widget/src/cocoa/nsCocoaWindow.mm b/widget/src/cocoa/nsCocoaWindow.mm index d1b49655740..2e0bb28a274 100644 --- a/widget/src/cocoa/nsCocoaWindow.mm +++ b/widget/src/cocoa/nsCocoaWindow.mm @@ -47,7 +47,6 @@ #include "nsChildView.h" #include "nsWindowMap.h" #include "nsAppShell.h" -#include "nsIAppShell.h" #include "nsIAppShellService.h" #include "nsIBaseWindow.h" #include "nsIInterfaceRequestorUtils.h" @@ -247,7 +246,6 @@ nsresult nsCocoaWindow::Create(nsIWidget *aParent, const nsIntRect &aRect, EVENT_CALLBACK aHandleEventFunction, nsDeviceContext *aContext, - nsIAppShell *aAppShell, nsIToolkit *aToolkit, nsWidgetInitData *aInitData) { @@ -285,7 +283,7 @@ nsresult nsCocoaWindow::Create(nsIWidget *aParent, mWindowType = eWindowType_toplevel; mBorderStyle = eBorderStyle_default; - Inherited::BaseCreate(aParent, newBounds, aHandleEventFunction, aContext, aAppShell, + Inherited::BaseCreate(aParent, newBounds, aHandleEventFunction, aContext, aToolkit, aInitData); mParent = aParent; @@ -302,7 +300,7 @@ nsresult nsCocoaWindow::Create(nsIWidget *aParent, if (aInitData->mIsDragPopup) { [mWindow setIgnoresMouseEvents:YES]; } - return CreatePopupContentView(newBounds, aHandleEventFunction, aContext, aAppShell, aToolkit); + return CreatePopupContentView(newBounds, aHandleEventFunction, aContext, aToolkit); } return NS_OK; @@ -480,7 +478,6 @@ nsresult nsCocoaWindow::CreateNativeWindow(const NSRect &aRect, NS_IMETHODIMP nsCocoaWindow::CreatePopupContentView(const nsIntRect &aRect, EVENT_CALLBACK aHandleEventFunction, nsDeviceContext *aContext, - nsIAppShell *aAppShell, nsIToolkit *aToolkit) { NS_OBJC_BEGIN_TRY_ABORT_BLOCK_NSRESULT; @@ -494,7 +491,7 @@ NS_IMETHODIMP nsCocoaWindow::CreatePopupContentView(const nsIntRect &aRect, nsIWidget* thisAsWidget = static_cast(this); mPopupContentView->Create(thisAsWidget, nsnull, aRect, aHandleEventFunction, - aContext, aAppShell, aToolkit, nsnull); + aContext, aToolkit, nsnull); ChildView* newContentView = (ChildView*)mPopupContentView->GetNativeData(NS_NATIVE_WIDGET); [mWindow setContentView:newContentView]; diff --git a/widget/src/gtk2/nsWindow.cpp b/widget/src/gtk2/nsWindow.cpp index 03b81d46191..6b2f1567d7c 100644 --- a/widget/src/gtk2/nsWindow.cpp +++ b/widget/src/gtk2/nsWindow.cpp @@ -3878,7 +3878,6 @@ nsWindow::Create(nsIWidget *aParent, const nsIntRect &aRect, EVENT_CALLBACK aHandleEventFunction, nsDeviceContext *aContext, - nsIAppShell *aAppShell, nsIToolkit *aToolkit, nsWidgetInitData *aInitData) { @@ -3894,7 +3893,7 @@ nsWindow::Create(nsIWidget *aParent, // initialize all the common bits of this class BaseCreate(baseParent, aRect, aHandleEventFunction, aContext, - aAppShell, aToolkit, aInitData); + aToolkit, aInitData); // Do we need to listen for resizes? bool listenForResizes = false;; diff --git a/widget/src/gtk2/nsWindow.h b/widget/src/gtk2/nsWindow.h index ad9e1b990db..f95aeb47d59 100644 --- a/widget/src/gtk2/nsWindow.h +++ b/widget/src/gtk2/nsWindow.h @@ -138,7 +138,6 @@ public: const nsIntRect &aRect, EVENT_CALLBACK aHandleEventFunction, nsDeviceContext *aContext, - nsIAppShell *aAppShell, nsIToolkit *aToolkit, nsWidgetInitData *aInitData); NS_IMETHOD Destroy(void); diff --git a/widget/src/os2/nsWindow.cpp b/widget/src/os2/nsWindow.cpp index a4cb47a9be3..ea59bbee2be 100644 --- a/widget/src/os2/nsWindow.cpp +++ b/widget/src/os2/nsWindow.cpp @@ -336,7 +336,6 @@ NS_METHOD nsWindow::Create(nsIWidget* aParent, const nsIntRect& aRect, EVENT_CALLBACK aHandleEventFunction, nsDeviceContext* aContext, - nsIAppShell* aAppShell, nsIToolkit* aToolkit, nsWidgetInitData* aInitData) { @@ -361,7 +360,7 @@ NS_METHOD nsWindow::Create(nsIWidget* aParent, } BaseCreate(aParent, aRect, aHandleEventFunction, - aContext, aAppShell, aToolkit, aInitData); + aContext, aToolkit, aInitData); #ifdef DEBUG_FOCUS diff --git a/widget/src/os2/nsWindow.h b/widget/src/os2/nsWindow.h index f4b5625148e..5a2cfd1bb2d 100644 --- a/widget/src/os2/nsWindow.h +++ b/widget/src/os2/nsWindow.h @@ -166,7 +166,6 @@ public: const nsIntRect& aRect, EVENT_CALLBACK aHandleEventFunction, nsDeviceContext* aContext, - nsIAppShell* aAppShell = nsnull, nsIToolkit* aToolkit = nsnull, nsWidgetInitData* aInitData = nsnull); NS_IMETHOD Destroy(); diff --git a/widget/src/qt/nsWindow.cpp b/widget/src/qt/nsWindow.cpp index dfb41045183..95222bcb005 100644 --- a/widget/src/qt/nsWindow.cpp +++ b/widget/src/qt/nsWindow.cpp @@ -2253,7 +2253,6 @@ nsWindow::Create(nsIWidget *aParent, const nsIntRect &aRect, EVENT_CALLBACK aHandleEventFunction, nsDeviceContext *aContext, - nsIAppShell *aAppShell, nsIToolkit *aToolkit, nsWidgetInitData *aInitData) { @@ -2273,7 +2272,7 @@ nsWindow::Create(nsIWidget *aParent, // initialize all the common bits of this class BaseCreate(baseParent, aRect, aHandleEventFunction, aContext, - aAppShell, aToolkit, aInitData); + aToolkit, aInitData); // and do our common creation mParent = aParent; @@ -2309,7 +2308,6 @@ already_AddRefed nsWindow::CreateChild(const nsIntRect& aRect, EVENT_CALLBACK aHandleEventFunction, nsDeviceContext* aContext, - nsIAppShell* aAppShell, nsIToolkit* aToolkit, nsWidgetInitData* aInitData, bool /*aForceUseIWidgetParent*/) @@ -2318,7 +2316,6 @@ nsWindow::CreateChild(const nsIntRect& aRect, return nsBaseWidget::CreateChild(aRect, aHandleEventFunction, aContext, - aAppShell, aToolkit, aInitData, PR_TRUE); // Force parent diff --git a/widget/src/qt/nsWindow.h b/widget/src/qt/nsWindow.h index 8cfbc5ae1e3..801e9c9af4b 100644 --- a/widget/src/qt/nsWindow.h +++ b/widget/src/qt/nsWindow.h @@ -128,7 +128,6 @@ public: const nsIntRect &aRect, EVENT_CALLBACK aHandleEventFunction, nsDeviceContext *aContext, - nsIAppShell *aAppShell, nsIToolkit *aToolkit, nsWidgetInitData *aInitData); @@ -136,7 +135,6 @@ public: CreateChild(const nsIntRect& aRect, EVENT_CALLBACK aHandleEventFunction, nsDeviceContext* aContext, - nsIAppShell* aAppShell = nsnull, nsIToolkit* aToolkit = nsnull, nsWidgetInitData* aInitData = nsnull, bool aForceUseIWidgetParent = true); diff --git a/widget/src/windows/nsWindow.cpp b/widget/src/windows/nsWindow.cpp index 3be9e377fa6..73f233b63af 100644 --- a/widget/src/windows/nsWindow.cpp +++ b/widget/src/windows/nsWindow.cpp @@ -503,7 +503,6 @@ nsWindow::Create(nsIWidget *aParent, const nsIntRect &aRect, EVENT_CALLBACK aHandleEventFunction, nsDeviceContext *aContext, - nsIAppShell *aAppShell, nsIToolkit *aToolkit, nsWidgetInitData *aInitData) { @@ -521,8 +520,7 @@ nsWindow::Create(nsIWidget *aParent, mIsTopWidgetWindow = (nsnull == baseParent); mBounds = aRect; - BaseCreate(baseParent, aRect, aHandleEventFunction, aContext, - aAppShell, aToolkit, aInitData); + BaseCreate(baseParent, aRect, aHandleEventFunction, aContext, aToolkit, aInitData); HWND parent; if (aParent) { // has a nsIWidget parent diff --git a/widget/src/windows/nsWindow.h b/widget/src/windows/nsWindow.h index 15f34f08c9a..ece564fb32f 100644 --- a/widget/src/windows/nsWindow.h +++ b/widget/src/windows/nsWindow.h @@ -114,7 +114,6 @@ public: const nsIntRect &aRect, EVENT_CALLBACK aHandleEventFunction, nsDeviceContext *aContext, - nsIAppShell *aAppShell = nsnull, nsIToolkit *aToolkit = nsnull, nsWidgetInitData *aInitData = nsnull); NS_IMETHOD Destroy(); diff --git a/widget/src/xpwidgets/PuppetWidget.cpp b/widget/src/xpwidgets/PuppetWidget.cpp index a3bc397b270..838603d4d9f 100644 --- a/widget/src/xpwidgets/PuppetWidget.cpp +++ b/widget/src/xpwidgets/PuppetWidget.cpp @@ -112,14 +112,13 @@ PuppetWidget::Create(nsIWidget *aParent, const nsIntRect &aRect, EVENT_CALLBACK aHandleEventFunction, nsDeviceContext *aContext, - nsIAppShell *aAppShell, nsIToolkit *aToolkit, nsWidgetInitData *aInitData) { NS_ABORT_IF_FALSE(!aNativeParent, "got a non-Puppet native parent"); BaseCreate(nsnull, aRect, aHandleEventFunction, aContext, - aAppShell, aToolkit, aInitData); + aToolkit, aInitData); mBounds = aRect; mEnabled = PR_TRUE; @@ -152,7 +151,6 @@ already_AddRefed PuppetWidget::CreateChild(const nsIntRect &aRect, EVENT_CALLBACK aHandleEventFunction, nsDeviceContext *aContext, - nsIAppShell *aAppShell, nsIToolkit *aToolkit, nsWidgetInitData *aInitData, bool aForceUseIWidgetParent) @@ -162,7 +160,7 @@ PuppetWidget::CreateChild(const nsIntRect &aRect, return ((widget && NS_SUCCEEDED(widget->Create(isPopup ? nsnull: this, nsnull, aRect, aHandleEventFunction, - aContext, aAppShell, aToolkit, + aContext, aToolkit, aInitData))) ? widget.forget() : nsnull); } diff --git a/widget/src/xpwidgets/PuppetWidget.h b/widget/src/xpwidgets/PuppetWidget.h index ee27ef75d07..983984e3432 100644 --- a/widget/src/xpwidgets/PuppetWidget.h +++ b/widget/src/xpwidgets/PuppetWidget.h @@ -75,7 +75,6 @@ public: const nsIntRect& aRect, EVENT_CALLBACK aHandleEventFunction, nsDeviceContext* aContext, - nsIAppShell* aAppShell = nsnull, nsIToolkit* aToolkit = nsnull, nsWidgetInitData* aInitData = nsnull); @@ -83,7 +82,6 @@ public: CreateChild(const nsIntRect &aRect, EVENT_CALLBACK aHandleEventFunction, nsDeviceContext *aContext, - nsIAppShell *aAppShell = nsnull, nsIToolkit *aToolkit = nsnull, nsWidgetInitData *aInitData = nsnull, bool aForceUseIWidgetParent = false); diff --git a/widget/src/xpwidgets/nsBaseWidget.cpp b/widget/src/xpwidgets/nsBaseWidget.cpp index 519aec077fa..9efe560483b 100644 --- a/widget/src/xpwidgets/nsBaseWidget.cpp +++ b/widget/src/xpwidgets/nsBaseWidget.cpp @@ -163,7 +163,6 @@ void nsBaseWidget::BaseCreate(nsIWidget *aParent, const nsIntRect &aRect, EVENT_CALLBACK aHandleEventFunction, nsDeviceContext *aContext, - nsIAppShell *aAppShell, nsIToolkit *aToolkit, nsWidgetInitData *aInitData) { @@ -252,7 +251,6 @@ already_AddRefed nsBaseWidget::CreateChild(const nsIntRect &aRect, EVENT_CALLBACK aHandleEventFunction, nsDeviceContext *aContext, - nsIAppShell *aAppShell, nsIToolkit *aToolkit, nsWidgetInitData *aInitData, bool aForceUseIWidgetParent) @@ -280,7 +278,7 @@ nsBaseWidget::CreateChild(const nsIntRect &aRect, if (widget && NS_SUCCEEDED(widget->Create(parent, nativeParent, aRect, aHandleEventFunction, - aContext, aAppShell, aToolkit, + aContext, aToolkit, aInitData))) { return widget.forget(); } diff --git a/widget/src/xpwidgets/nsBaseWidget.h b/widget/src/xpwidgets/nsBaseWidget.h index b414ea29aef..f048a47e28a 100644 --- a/widget/src/xpwidgets/nsBaseWidget.h +++ b/widget/src/xpwidgets/nsBaseWidget.h @@ -41,7 +41,6 @@ #include "nsIWidget.h" #include "nsWidgetsCID.h" #include "nsIToolkit.h" -#include "nsIAppShell.h" #include "nsILocalFile.h" #include "nsString.h" #include "nsCOMPtr.h" @@ -166,7 +165,6 @@ public: CreateChild(const nsIntRect &aRect, EVENT_CALLBACK aHandleEventFunction, nsDeviceContext *aContext, - nsIAppShell *aAppShell = nsnull, nsIToolkit *aToolkit = nsnull, nsWidgetInitData *aInitData = nsnull, bool aForceUseIWidgetParent = false); @@ -236,7 +234,6 @@ protected: const nsIntRect &aRect, EVENT_CALLBACK aHandleEventFunction, nsDeviceContext *aContext, - nsIAppShell *aAppShell, nsIToolkit *aToolkit, nsWidgetInitData *aInitData); diff --git a/widget/tests/TestWinTSF.cpp b/widget/tests/TestWinTSF.cpp index 7d9625a8a49..dce8c686f18 100644 --- a/widget/tests/TestWinTSF.cpp +++ b/widget/tests/TestWinTSF.cpp @@ -1468,7 +1468,7 @@ TestApp::Run(void) nsIWebBrowserChrome::CHROME_DEFAULT, 800 /*nsIAppShellService::SIZE_TO_CONTENT*/, 600 /*nsIAppShellService::SIZE_TO_CONTENT*/, - mAppShell, getter_AddRefs(mWindow)); + getter_AddRefs(mWindow)); NS_ENSURE_SUCCESS(rv, rv); nsCOMPtr docShell; diff --git a/xpfe/appshell/public/nsIAppShellService.idl b/xpfe/appshell/public/nsIAppShellService.idl index 6f485f3a9b6..1384a93d917 100644 --- a/xpfe/appshell/public/nsIAppShellService.idl +++ b/xpfe/appshell/public/nsIAppShellService.idl @@ -48,7 +48,7 @@ interface nsIAppShell; struct JSContext; %} -[scriptable, uuid(361facd0-6e9a-4ff1-a0d4-450744cf0023)] +[scriptable, uuid(EBCD34E2-2E43-45C0-AAC8-E6F1C692B371)] interface nsIAppShellService : nsISupports { /** @@ -66,8 +66,6 @@ interface nsIAppShellService : nsISupports * tag in the XUL. Set to NS_SIZETOCONTENT to force * the window to wrap to its contents. * @param aInitialHeight like aInitialWidth, but subtly different. - * @param aAppShell a widget "appshell" (event processor) to associate - * with the new window * @param aResult the newly created window is returned here. */ const long SIZE_TO_CONTENT = -1; @@ -75,11 +73,10 @@ interface nsIAppShellService : nsISupports in nsIURI aUrl, in PRUint32 aChromeMask, in long aInitialWidth, - in long aInitialHeight, - in nsIAppShell aAppShell); + in long aInitialHeight); [noscript] - void createHiddenWindow(in nsIAppShell aAppShell); + void createHiddenWindow(); void destroyHiddenWindow(); diff --git a/xpfe/appshell/public/nsIXULWindow.idl b/xpfe/appshell/public/nsIXULWindow.idl index 812e1219c6d..64a7b6aa261 100644 --- a/xpfe/appshell/public/nsIXULWindow.idl +++ b/xpfe/appshell/public/nsIXULWindow.idl @@ -48,10 +48,9 @@ interface nsIDocShell; interface nsIDocShellTreeItem; -interface nsIAppShell; interface nsIXULBrowserWindow; -[scriptable, uuid(5869c5e5-743d-473c-bb71-41752146d373)] +[scriptable, uuid(CCF9E98A-E442-4061-9F74-94539DD9FE9E)] interface nsIXULWindow : nsISupports { /** @@ -144,8 +143,7 @@ interface nsIXULWindow : nsISupports * @param aChromeFlags see nsIWebBrowserChrome * @return the newly minted window */ - nsIXULWindow createNewWindow(in PRInt32 aChromeFlags, - in nsIAppShell aAppShell); + nsIXULWindow createNewWindow(in PRInt32 aChromeFlags); attribute nsIXULBrowserWindow XULBrowserWindow; diff --git a/xpfe/appshell/src/nsAppShellService.cpp b/xpfe/appshell/src/nsAppShellService.cpp index 8a5170f9467..6d24ab8fb3d 100644 --- a/xpfe/appshell/src/nsAppShellService.cpp +++ b/xpfe/appshell/src/nsAppShellService.cpp @@ -111,7 +111,7 @@ NS_IMPL_ISUPPORTS2(nsAppShellService, nsIObserver) NS_IMETHODIMP -nsAppShellService::CreateHiddenWindow(nsIAppShell* aAppShell) +nsAppShellService::CreateHiddenWindow() { nsresult rv; PRInt32 initialHeight = 100, initialWidth = 100; @@ -134,7 +134,7 @@ nsAppShellService::CreateHiddenWindow(nsIAppShell* aAppShell) nsRefPtr newWindow; rv = JustCreateTopWindow(nsnull, url, chromeMask, initialWidth, initialHeight, - PR_TRUE, aAppShell, getter_AddRefs(newWindow)); + PR_TRUE, getter_AddRefs(newWindow)); NS_ENSURE_SUCCESS(rv, rv); mHiddenWindow.swap(newWindow); @@ -167,7 +167,6 @@ nsAppShellService::CreateTopLevelWindow(nsIXULWindow *aParent, PRUint32 aChromeMask, PRInt32 aInitialWidth, PRInt32 aInitialHeight, - nsIAppShell* aAppShell, nsIXULWindow **aResult) { @@ -179,7 +178,7 @@ nsAppShellService::CreateTopLevelWindow(nsIXULWindow *aParent, nsWebShellWindow *newWindow = nsnull; rv = JustCreateTopWindow(aParent, aUrl, aChromeMask, aInitialWidth, aInitialHeight, - PR_FALSE, aAppShell, &newWindow); // addrefs + PR_FALSE, &newWindow); // addrefs *aResult = newWindow; // transfer ref @@ -280,7 +279,6 @@ nsAppShellService::JustCreateTopWindow(nsIXULWindow *aParent, PRInt32 aInitialWidth, PRInt32 aInitialHeight, bool aIsHiddenWindow, - nsIAppShell* aAppShell, nsWebShellWindow **aResult) { *aResult = nsnull; @@ -381,8 +379,7 @@ nsAppShellService::JustCreateTopWindow(nsIXULWindow *aParent, } nsresult rv = window->Initialize(parent, center ? aParent : nsnull, - aAppShell, aUrl, - aInitialWidth, aInitialHeight, + aUrl, aInitialWidth, aInitialHeight, aIsHiddenWindow, widgetInitData); NS_ENSURE_SUCCESS(rv, rv); diff --git a/xpfe/appshell/src/nsAppShellService.h b/xpfe/appshell/src/nsAppShellService.h index fae33ae889b..784b6697ce0 100644 --- a/xpfe/appshell/src/nsAppShellService.h +++ b/xpfe/appshell/src/nsAppShellService.h @@ -67,7 +67,7 @@ protected: nsIURI *aUrl, PRUint32 aChromeMask, PRInt32 aInitialWidth, PRInt32 aInitialHeight, - bool aIsHiddenWindow, nsIAppShell* aAppShell, + bool aIsHiddenWindow, nsWebShellWindow **aResult); PRUint32 CalculateWindowZLevel(nsIXULWindow *aParent, PRUint32 aChromeMask); diff --git a/xpfe/appshell/src/nsWebShellWindow.cpp b/xpfe/appshell/src/nsWebShellWindow.cpp index fcd3874c78b..a68312cfa42 100644 --- a/xpfe/appshell/src/nsWebShellWindow.cpp +++ b/xpfe/appshell/src/nsWebShellWindow.cpp @@ -64,9 +64,6 @@ #include "nsGUIEvent.h" #include "nsWidgetsCID.h" #include "nsIWidget.h" -#include "nsIAppShell.h" - -#include "nsIAppShellService.h" #include "nsIDOMCharacterData.h" #include "nsIDOMNodeList.h" @@ -149,7 +146,7 @@ NS_INTERFACE_MAP_END_INHERITING(nsXULWindow) nsresult nsWebShellWindow::Initialize(nsIXULWindow* aParent, nsIXULWindow* aOpener, - nsIAppShell* aShell, nsIURI* aUrl, + nsIURI* aUrl, PRInt32 aInitialWidth, PRInt32 aInitialHeight, bool aIsHiddenWindow, @@ -209,7 +206,6 @@ nsresult nsWebShellWindow::Initialize(nsIXULWindow* aParent, r, // Widget dimensions nsWebShellWindow::HandleEvent, // Event handler function nsnull, // Device context - aShell, // Application shell nsnull, // nsIToolkit &widgetInitData); // Widget initialization data mWindow->GetClientBounds(r); diff --git a/xpfe/appshell/src/nsWebShellWindow.h b/xpfe/appshell/src/nsWebShellWindow.h index 9a6d9cb3de3..b3d65478fe5 100644 --- a/xpfe/appshell/src/nsWebShellWindow.h +++ b/xpfe/appshell/src/nsWebShellWindow.h @@ -51,7 +51,6 @@ /* Forward declarations.... */ class nsIURI; -class nsIAppShell; class nsWebShellWindow : public nsXULWindow, public nsIWebProgressListener @@ -64,7 +63,7 @@ public: // nsWebShellWindow methods... nsresult Initialize(nsIXULWindow * aParent, nsIXULWindow * aOpener, - nsIAppShell* aShell, nsIURI* aUrl, + nsIURI* aUrl, PRInt32 aInitialWidth, PRInt32 aInitialHeight, bool aIsHiddenWindow, nsWidgetInitData& widgetInitData); diff --git a/xpfe/appshell/src/nsXULWindow.cpp b/xpfe/appshell/src/nsXULWindow.cpp index 85c5040eab6..9b0a4723f6c 100644 --- a/xpfe/appshell/src/nsXULWindow.cpp +++ b/xpfe/appshell/src/nsXULWindow.cpp @@ -1738,17 +1738,17 @@ NS_IMETHODIMP nsXULWindow::ExitModalLoop(nsresult aStatus) // top-level function to create a new window NS_IMETHODIMP nsXULWindow::CreateNewWindow(PRInt32 aChromeFlags, - nsIAppShell* aAppShell, nsIXULWindow **_retval) + nsIXULWindow **_retval) { NS_ENSURE_ARG_POINTER(_retval); if (aChromeFlags & nsIWebBrowserChrome::CHROME_OPENAS_CHROME) - return CreateNewChromeWindow(aChromeFlags, aAppShell, _retval); - return CreateNewContentWindow(aChromeFlags, aAppShell, _retval); + return CreateNewChromeWindow(aChromeFlags, _retval); + return CreateNewContentWindow(aChromeFlags, _retval); } NS_IMETHODIMP nsXULWindow::CreateNewChromeWindow(PRInt32 aChromeFlags, - nsIAppShell* aAppShell, nsIXULWindow **_retval) + nsIXULWindow **_retval) { nsCOMPtr appShell(do_GetService(NS_APPSHELLSERVICE_CONTRACTID)); NS_ENSURE_TRUE(appShell, NS_ERROR_FAILURE); @@ -1759,7 +1759,7 @@ NS_IMETHODIMP nsXULWindow::CreateNewChromeWindow(PRInt32 aChromeFlags, appShell->CreateTopLevelWindow(this, nsnull, aChromeFlags, nsIAppShellService::SIZE_TO_CONTENT, nsIAppShellService::SIZE_TO_CONTENT, - aAppShell, getter_AddRefs(newWindow)); + getter_AddRefs(newWindow)); NS_ENSURE_TRUE(newWindow, NS_ERROR_FAILURE); @@ -1770,7 +1770,7 @@ NS_IMETHODIMP nsXULWindow::CreateNewChromeWindow(PRInt32 aChromeFlags, } NS_IMETHODIMP nsXULWindow::CreateNewContentWindow(PRInt32 aChromeFlags, - nsIAppShell* aAppShell, nsIXULWindow **_retval) + nsIXULWindow **_retval) { nsCOMPtr appShell(do_GetService(NS_APPSHELLSERVICE_CONTRACTID)); NS_ENSURE_TRUE(appShell, NS_ERROR_FAILURE); @@ -1795,7 +1795,7 @@ NS_IMETHODIMP nsXULWindow::CreateNewContentWindow(PRInt32 aChromeFlags, nsCOMPtr newWindow; appShell->CreateTopLevelWindow(this, uri, - aChromeFlags, 615, 480, aAppShell, + aChromeFlags, 615, 480, getter_AddRefs(newWindow)); NS_ENSURE_TRUE(newWindow, NS_ERROR_FAILURE); diff --git a/xpfe/appshell/src/nsXULWindow.h b/xpfe/appshell/src/nsXULWindow.h index 84e4e620f2f..68baf9b33b9 100644 --- a/xpfe/appshell/src/nsXULWindow.h +++ b/xpfe/appshell/src/nsXULWindow.h @@ -134,10 +134,8 @@ protected: NS_IMETHOD SizeShellTo(nsIDocShellTreeItem* aShellItem, PRInt32 aCX, PRInt32 aCY); NS_IMETHOD ExitModalLoop(nsresult aStatus); - NS_IMETHOD CreateNewChromeWindow(PRInt32 aChromeFlags, - nsIAppShell* aAppShell, nsIXULWindow **_retval); - NS_IMETHOD CreateNewContentWindow(PRInt32 aChromeFlags, - nsIAppShell* aAppShell, nsIXULWindow **_retval); + NS_IMETHOD CreateNewChromeWindow(PRInt32 aChromeFlags, nsIXULWindow **_retval); + NS_IMETHOD CreateNewContentWindow(PRInt32 aChromeFlags, nsIXULWindow **_retval); void EnableParent(bool aEnable); bool ConstrainToZLevel(bool aImmediate, nsWindowZ *aPlacement,