Bug 694224, remove appshell argument from various widget creation methods, r=roc

This commit is contained in:
Neil Deakin 2011-10-14 09:06:39 -04:00
Родитель 2c972e0ecb
Коммит 2a37cb4a1f
32 изменённых файлов: 45 добавлений и 97 удалений

Просмотреть файл

@ -1156,7 +1156,7 @@ NS_IMETHODIMP nsWebBrowser::Create()
mInternalWidget->SetClientData(static_cast<nsWebBrowser *>(this)); mInternalWidget->SetClientData(static_cast<nsWebBrowser *>(this));
mInternalWidget->Create(nsnull, mParentNativeWindow, bounds, nsWebBrowser::HandleEvent, mInternalWidget->Create(nsnull, mParentNativeWindow, bounds, nsWebBrowser::HandleEvent,
nsnull, nsnull, nsnull, &widgetInit); nsnull, nsnull, &widgetInit);
} }
nsCOMPtr<nsIDocShell> docShell(do_CreateInstance("@mozilla.org/docshell;1", &rv)); nsCOMPtr<nsIDocShell> docShell(do_CreateInstance("@mozilla.org/docshell;1", &rv));

Просмотреть файл

@ -468,7 +468,7 @@ nsObjectFrame::CreateWidget(nscoord aWidth,
// mWidget isn't the view's designated widget. // mWidget isn't the view's designated widget.
EVENT_CALLBACK eventHandler = mInnerView->AttachWidgetEventHandler(mWidget); EVENT_CALLBACK eventHandler = mInnerView->AttachWidgetEventHandler(mWidget);
rv = mWidget->Create(parentWidget, nsnull, nsIntRect(0,0,0,0), rv = mWidget->Create(parentWidget, nsnull, nsIntRect(0,0,0,0),
eventHandler, dx, nsnull, nsnull, &initData); eventHandler, dx, nsnull, &initData);
if (NS_FAILED(rv)) { if (NS_FAILED(rv)) {
mWidget->Destroy(); mWidget->Destroy();
mWidget = nsnull; mWidget = nsnull;

Просмотреть файл

@ -194,7 +194,7 @@ nsAppStartup::CreateHiddenWindow()
(do_GetService(NS_APPSHELLSERVICE_CONTRACTID)); (do_GetService(NS_APPSHELLSERVICE_CONTRACTID));
NS_ENSURE_TRUE(appShellService, NS_ERROR_FAILURE); 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."); NS_ASSERTION(xulParent, "window created using non-XUL parent. that's unexpected, but may work.");
if (xulParent) 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 // And if it fails, don't try again without a parent. It could fail
// intentionally (bug 115969). // intentionally (bug 115969).
} else { // try using basic methods: } else { // try using basic methods:
@ -529,7 +529,7 @@ nsAppStartup::CreateChromeWindow2(nsIWebBrowserChrome *aParent,
appShell->CreateTopLevelWindow(0, 0, aChromeFlags, appShell->CreateTopLevelWindow(0, 0, aChromeFlags,
nsIAppShellService::SIZE_TO_CONTENT, nsIAppShellService::SIZE_TO_CONTENT,
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 // if anybody gave us anything to work with, use it

Просмотреть файл

@ -747,7 +747,7 @@ nsresult nsView::CreateWidget(nsWidgetInitData *aWidgetInitData,
// XXX: using aForceUseIWidgetParent=true to preserve previous // XXX: using aForceUseIWidgetParent=true to preserve previous
// semantics. It's not clear that it's actually needed. // semantics. It's not clear that it's actually needed.
mWindow = parentWidget->CreateChild(trect, ::HandleEvent, mWindow = parentWidget->CreateChild(trect, ::HandleEvent,
dx, nsnull, nsnull, aWidgetInitData, dx, nsnull, aWidgetInitData,
PR_TRUE).get(); PR_TRUE).get();
if (!mWindow) { if (!mWindow) {
return NS_ERROR_FAILURE; return NS_ERROR_FAILURE;
@ -779,7 +779,7 @@ nsresult nsView::CreateWidgetForParent(nsIWidget* aParentWidget,
mWindow = mWindow =
aParentWidget->CreateChild(trect, ::HandleEvent, aParentWidget->CreateChild(trect, ::HandleEvent,
dx, nsnull, nsnull, aWidgetInitData).get(); dx, nsnull, aWidgetInitData).get();
if (!mWindow) { if (!mWindow) {
return NS_ERROR_FAILURE; return NS_ERROR_FAILURE;
} }
@ -812,7 +812,7 @@ nsresult nsView::CreateWidgetForPopup(nsWidgetInitData *aWidgetInitData,
// XXX: using aForceUseIWidgetParent=true to preserve previous // XXX: using aForceUseIWidgetParent=true to preserve previous
// semantics. It's not clear that it's actually needed. // semantics. It's not clear that it's actually needed.
mWindow = aParentWidget->CreateChild(trect, ::HandleEvent, mWindow = aParentWidget->CreateChild(trect, ::HandleEvent,
dx, nsnull, nsnull, aWidgetInitData, dx, nsnull, aWidgetInitData,
PR_TRUE).get(); PR_TRUE).get();
} }
else { else {
@ -826,7 +826,7 @@ nsresult nsView::CreateWidgetForPopup(nsWidgetInitData *aWidgetInitData,
mWindow = mWindow =
nearestParent->CreateChild(trect, ::HandleEvent, nearestParent->CreateChild(trect, ::HandleEvent,
dx, nsnull, nsnull, aWidgetInitData).get(); dx, nsnull, aWidgetInitData).get();
} }
if (!mWindow) { if (!mWindow) {
return NS_ERROR_FAILURE; return NS_ERROR_FAILURE;

Просмотреть файл

@ -57,7 +57,6 @@
#include "nsXULAppAPI.h" #include "nsXULAppAPI.h"
// forward declarations // forward declarations
class nsIAppShell;
class nsIToolkit; class nsIToolkit;
class nsFontMetrics; class nsFontMetrics;
class nsRenderingContext; class nsRenderingContext;
@ -121,8 +120,8 @@ typedef nsEventStatus (* EVENT_CALLBACK)(nsGUIEvent *event);
#endif #endif
#define NS_IWIDGET_IID \ #define NS_IWIDGET_IID \
{ 0xf43254ce, 0xd315, 0x458b, \ { 0x64e1ee3d, 0xe0f2, 0x4ace, \
{ 0xba, 0x72, 0xa8, 0xdf, 0x21, 0xcf, 0xa7, 0x2a } } { 0x91, 0xb7, 0xdc, 0xd1, 0xbe, 0x69, 0xb6, 0xe6 } }
/* /*
* Window shadow styles * Window shadow styles
@ -326,8 +325,6 @@ class nsIWidget : public nsISupports {
* @param aRect the widget dimension * @param aRect the widget dimension
* @param aHandleEventFunction the event handler callback function * @param aHandleEventFunction the event handler callback function
* @param aContext * @param aContext
* @param aAppShell the parent application shell. If nsnull,
* the parent window's application shell will be used.
* @param aToolkit * @param aToolkit
* @param aInitData data that is used for widget initialization * @param aInitData data that is used for widget initialization
* *
@ -337,7 +334,6 @@ class nsIWidget : public nsISupports {
const nsIntRect &aRect, const nsIntRect &aRect,
EVENT_CALLBACK aHandleEventFunction, EVENT_CALLBACK aHandleEventFunction,
nsDeviceContext *aContext, nsDeviceContext *aContext,
nsIAppShell *aAppShell = nsnull,
nsIToolkit *aToolkit = nsnull, nsIToolkit *aToolkit = nsnull,
nsWidgetInitData *aInitData = nsnull) = 0; nsWidgetInitData *aInitData = nsnull) = 0;
@ -361,7 +357,6 @@ class nsIWidget : public nsISupports {
CreateChild(const nsIntRect &aRect, CreateChild(const nsIntRect &aRect,
EVENT_CALLBACK aHandleEventFunction, EVENT_CALLBACK aHandleEventFunction,
nsDeviceContext *aContext, nsDeviceContext *aContext,
nsIAppShell *aAppShell = nsnull,
nsIToolkit *aToolkit = nsnull, nsIToolkit *aToolkit = nsnull,
nsWidgetInitData *aInitData = nsnull, nsWidgetInitData *aInitData = nsnull,
bool aForceUseIWidgetParent = false) = 0; bool aForceUseIWidgetParent = false) = 0;

Просмотреть файл

@ -202,7 +202,6 @@ nsWindow::Create(nsIWidget *aParent,
const nsIntRect &aRect, const nsIntRect &aRect,
EVENT_CALLBACK aHandleEventFunction, EVENT_CALLBACK aHandleEventFunction,
nsDeviceContext *aContext, nsDeviceContext *aContext,
nsIAppShell *aAppShell,
nsIToolkit *aToolkit, nsIToolkit *aToolkit,
nsWidgetInitData *aInitData) nsWidgetInitData *aInitData)
{ {
@ -232,7 +231,7 @@ nsWindow::Create(nsIWidget *aParent,
} }
BaseCreate(nsnull, mBounds, aHandleEventFunction, aContext, BaseCreate(nsnull, mBounds, aHandleEventFunction, aContext,
aAppShell, aToolkit, aInitData); aToolkit, aInitData);
NS_ASSERTION(IsTopLevel() || parent, "non top level windowdoesn't have a parent!"); NS_ASSERTION(IsTopLevel() || parent, "non top level windowdoesn't have a parent!");

Просмотреть файл

@ -87,7 +87,6 @@ public:
const nsIntRect &aRect, const nsIntRect &aRect,
EVENT_CALLBACK aHandleEventFunction, EVENT_CALLBACK aHandleEventFunction,
nsDeviceContext *aContext, nsDeviceContext *aContext,
nsIAppShell *aAppShell,
nsIToolkit *aToolkit, nsIToolkit *aToolkit,
nsWidgetInitData *aInitData); nsWidgetInitData *aInitData);
NS_IMETHOD Destroy(void); NS_IMETHOD Destroy(void);

Просмотреть файл

@ -55,8 +55,6 @@
#include "TextInputHandler.h" #include "TextInputHandler.h"
#include "nsCocoaUtils.h" #include "nsCocoaUtils.h"
#include "nsIAppShell.h"
#include "nsString.h" #include "nsString.h"
#include "nsIDragService.h" #include "nsIDragService.h"
@ -398,7 +396,6 @@ public:
const nsIntRect &aRect, const nsIntRect &aRect,
EVENT_CALLBACK aHandleEventFunction, EVENT_CALLBACK aHandleEventFunction,
nsDeviceContext *aContext, nsDeviceContext *aContext,
nsIAppShell *aAppShell = nsnull,
nsIToolkit *aToolkit = nsnull, nsIToolkit *aToolkit = nsnull,
nsWidgetInitData *aInitData = nsnull); nsWidgetInitData *aInitData = nsnull);

Просмотреть файл

@ -291,7 +291,6 @@ nsresult nsChildView::Create(nsIWidget *aParent,
const nsIntRect &aRect, const nsIntRect &aRect,
EVENT_CALLBACK aHandleEventFunction, EVENT_CALLBACK aHandleEventFunction,
nsDeviceContext *aContext, nsDeviceContext *aContext,
nsIAppShell *aAppShell,
nsIToolkit *aToolkit, nsIToolkit *aToolkit,
nsWidgetInitData *aInitData) nsWidgetInitData *aInitData)
{ {
@ -324,7 +323,7 @@ nsresult nsChildView::Create(nsIWidget *aParent,
mBounds = aRect; mBounds = aRect;
BaseCreate(aParent, aRect, aHandleEventFunction, BaseCreate(aParent, aRect, aHandleEventFunction,
aContext, aAppShell, aToolkit, aInitData); aContext, aToolkit, aInitData);
// inherit things from the parent view and create our parallel // inherit things from the parent view and create our parallel
// NSView in the Cocoa display system // NSView in the Cocoa display system

Просмотреть файл

@ -216,7 +216,6 @@ public:
const nsIntRect &aRect, const nsIntRect &aRect,
EVENT_CALLBACK aHandleEventFunction, EVENT_CALLBACK aHandleEventFunction,
nsDeviceContext *aContext, nsDeviceContext *aContext,
nsIAppShell *aAppShell = nsnull,
nsIToolkit *aToolkit = nsnull, nsIToolkit *aToolkit = nsnull,
nsWidgetInitData *aInitData = nsnull); nsWidgetInitData *aInitData = nsnull);
@ -309,7 +308,6 @@ protected:
nsresult CreatePopupContentView(const nsIntRect &aRect, nsresult CreatePopupContentView(const nsIntRect &aRect,
EVENT_CALLBACK aHandleEventFunction, EVENT_CALLBACK aHandleEventFunction,
nsDeviceContext *aContext, nsDeviceContext *aContext,
nsIAppShell *aAppShell,
nsIToolkit *aToolkit); nsIToolkit *aToolkit);
void DestroyNativeWindow(); void DestroyNativeWindow();
void AdjustWindowShadow(); void AdjustWindowShadow();

Просмотреть файл

@ -47,7 +47,6 @@
#include "nsChildView.h" #include "nsChildView.h"
#include "nsWindowMap.h" #include "nsWindowMap.h"
#include "nsAppShell.h" #include "nsAppShell.h"
#include "nsIAppShell.h"
#include "nsIAppShellService.h" #include "nsIAppShellService.h"
#include "nsIBaseWindow.h" #include "nsIBaseWindow.h"
#include "nsIInterfaceRequestorUtils.h" #include "nsIInterfaceRequestorUtils.h"
@ -247,7 +246,6 @@ nsresult nsCocoaWindow::Create(nsIWidget *aParent,
const nsIntRect &aRect, const nsIntRect &aRect,
EVENT_CALLBACK aHandleEventFunction, EVENT_CALLBACK aHandleEventFunction,
nsDeviceContext *aContext, nsDeviceContext *aContext,
nsIAppShell *aAppShell,
nsIToolkit *aToolkit, nsIToolkit *aToolkit,
nsWidgetInitData *aInitData) nsWidgetInitData *aInitData)
{ {
@ -285,7 +283,7 @@ nsresult nsCocoaWindow::Create(nsIWidget *aParent,
mWindowType = eWindowType_toplevel; mWindowType = eWindowType_toplevel;
mBorderStyle = eBorderStyle_default; mBorderStyle = eBorderStyle_default;
Inherited::BaseCreate(aParent, newBounds, aHandleEventFunction, aContext, aAppShell, Inherited::BaseCreate(aParent, newBounds, aHandleEventFunction, aContext,
aToolkit, aInitData); aToolkit, aInitData);
mParent = aParent; mParent = aParent;
@ -302,7 +300,7 @@ nsresult nsCocoaWindow::Create(nsIWidget *aParent,
if (aInitData->mIsDragPopup) { if (aInitData->mIsDragPopup) {
[mWindow setIgnoresMouseEvents:YES]; [mWindow setIgnoresMouseEvents:YES];
} }
return CreatePopupContentView(newBounds, aHandleEventFunction, aContext, aAppShell, aToolkit); return CreatePopupContentView(newBounds, aHandleEventFunction, aContext, aToolkit);
} }
return NS_OK; return NS_OK;
@ -480,7 +478,6 @@ nsresult nsCocoaWindow::CreateNativeWindow(const NSRect &aRect,
NS_IMETHODIMP nsCocoaWindow::CreatePopupContentView(const nsIntRect &aRect, NS_IMETHODIMP nsCocoaWindow::CreatePopupContentView(const nsIntRect &aRect,
EVENT_CALLBACK aHandleEventFunction, EVENT_CALLBACK aHandleEventFunction,
nsDeviceContext *aContext, nsDeviceContext *aContext,
nsIAppShell *aAppShell,
nsIToolkit *aToolkit) nsIToolkit *aToolkit)
{ {
NS_OBJC_BEGIN_TRY_ABORT_BLOCK_NSRESULT; NS_OBJC_BEGIN_TRY_ABORT_BLOCK_NSRESULT;
@ -494,7 +491,7 @@ NS_IMETHODIMP nsCocoaWindow::CreatePopupContentView(const nsIntRect &aRect,
nsIWidget* thisAsWidget = static_cast<nsIWidget*>(this); nsIWidget* thisAsWidget = static_cast<nsIWidget*>(this);
mPopupContentView->Create(thisAsWidget, nsnull, aRect, aHandleEventFunction, mPopupContentView->Create(thisAsWidget, nsnull, aRect, aHandleEventFunction,
aContext, aAppShell, aToolkit, nsnull); aContext, aToolkit, nsnull);
ChildView* newContentView = (ChildView*)mPopupContentView->GetNativeData(NS_NATIVE_WIDGET); ChildView* newContentView = (ChildView*)mPopupContentView->GetNativeData(NS_NATIVE_WIDGET);
[mWindow setContentView:newContentView]; [mWindow setContentView:newContentView];

Просмотреть файл

@ -3878,7 +3878,6 @@ nsWindow::Create(nsIWidget *aParent,
const nsIntRect &aRect, const nsIntRect &aRect,
EVENT_CALLBACK aHandleEventFunction, EVENT_CALLBACK aHandleEventFunction,
nsDeviceContext *aContext, nsDeviceContext *aContext,
nsIAppShell *aAppShell,
nsIToolkit *aToolkit, nsIToolkit *aToolkit,
nsWidgetInitData *aInitData) nsWidgetInitData *aInitData)
{ {
@ -3894,7 +3893,7 @@ nsWindow::Create(nsIWidget *aParent,
// initialize all the common bits of this class // initialize all the common bits of this class
BaseCreate(baseParent, aRect, aHandleEventFunction, aContext, BaseCreate(baseParent, aRect, aHandleEventFunction, aContext,
aAppShell, aToolkit, aInitData); aToolkit, aInitData);
// Do we need to listen for resizes? // Do we need to listen for resizes?
bool listenForResizes = false;; bool listenForResizes = false;;

Просмотреть файл

@ -138,7 +138,6 @@ public:
const nsIntRect &aRect, const nsIntRect &aRect,
EVENT_CALLBACK aHandleEventFunction, EVENT_CALLBACK aHandleEventFunction,
nsDeviceContext *aContext, nsDeviceContext *aContext,
nsIAppShell *aAppShell,
nsIToolkit *aToolkit, nsIToolkit *aToolkit,
nsWidgetInitData *aInitData); nsWidgetInitData *aInitData);
NS_IMETHOD Destroy(void); NS_IMETHOD Destroy(void);

Просмотреть файл

@ -336,7 +336,6 @@ NS_METHOD nsWindow::Create(nsIWidget* aParent,
const nsIntRect& aRect, const nsIntRect& aRect,
EVENT_CALLBACK aHandleEventFunction, EVENT_CALLBACK aHandleEventFunction,
nsDeviceContext* aContext, nsDeviceContext* aContext,
nsIAppShell* aAppShell,
nsIToolkit* aToolkit, nsIToolkit* aToolkit,
nsWidgetInitData* aInitData) nsWidgetInitData* aInitData)
{ {
@ -361,7 +360,7 @@ NS_METHOD nsWindow::Create(nsIWidget* aParent,
} }
BaseCreate(aParent, aRect, aHandleEventFunction, BaseCreate(aParent, aRect, aHandleEventFunction,
aContext, aAppShell, aToolkit, aInitData); aContext, aToolkit, aInitData);
#ifdef DEBUG_FOCUS #ifdef DEBUG_FOCUS

Просмотреть файл

@ -166,7 +166,6 @@ public:
const nsIntRect& aRect, const nsIntRect& aRect,
EVENT_CALLBACK aHandleEventFunction, EVENT_CALLBACK aHandleEventFunction,
nsDeviceContext* aContext, nsDeviceContext* aContext,
nsIAppShell* aAppShell = nsnull,
nsIToolkit* aToolkit = nsnull, nsIToolkit* aToolkit = nsnull,
nsWidgetInitData* aInitData = nsnull); nsWidgetInitData* aInitData = nsnull);
NS_IMETHOD Destroy(); NS_IMETHOD Destroy();

Просмотреть файл

@ -2253,7 +2253,6 @@ nsWindow::Create(nsIWidget *aParent,
const nsIntRect &aRect, const nsIntRect &aRect,
EVENT_CALLBACK aHandleEventFunction, EVENT_CALLBACK aHandleEventFunction,
nsDeviceContext *aContext, nsDeviceContext *aContext,
nsIAppShell *aAppShell,
nsIToolkit *aToolkit, nsIToolkit *aToolkit,
nsWidgetInitData *aInitData) nsWidgetInitData *aInitData)
{ {
@ -2273,7 +2272,7 @@ nsWindow::Create(nsIWidget *aParent,
// initialize all the common bits of this class // initialize all the common bits of this class
BaseCreate(baseParent, aRect, aHandleEventFunction, aContext, BaseCreate(baseParent, aRect, aHandleEventFunction, aContext,
aAppShell, aToolkit, aInitData); aToolkit, aInitData);
// and do our common creation // and do our common creation
mParent = aParent; mParent = aParent;
@ -2309,7 +2308,6 @@ already_AddRefed<nsIWidget>
nsWindow::CreateChild(const nsIntRect& aRect, nsWindow::CreateChild(const nsIntRect& aRect,
EVENT_CALLBACK aHandleEventFunction, EVENT_CALLBACK aHandleEventFunction,
nsDeviceContext* aContext, nsDeviceContext* aContext,
nsIAppShell* aAppShell,
nsIToolkit* aToolkit, nsIToolkit* aToolkit,
nsWidgetInitData* aInitData, nsWidgetInitData* aInitData,
bool /*aForceUseIWidgetParent*/) bool /*aForceUseIWidgetParent*/)
@ -2318,7 +2316,6 @@ nsWindow::CreateChild(const nsIntRect& aRect,
return nsBaseWidget::CreateChild(aRect, return nsBaseWidget::CreateChild(aRect,
aHandleEventFunction, aHandleEventFunction,
aContext, aContext,
aAppShell,
aToolkit, aToolkit,
aInitData, aInitData,
PR_TRUE); // Force parent PR_TRUE); // Force parent

Просмотреть файл

@ -128,7 +128,6 @@ public:
const nsIntRect &aRect, const nsIntRect &aRect,
EVENT_CALLBACK aHandleEventFunction, EVENT_CALLBACK aHandleEventFunction,
nsDeviceContext *aContext, nsDeviceContext *aContext,
nsIAppShell *aAppShell,
nsIToolkit *aToolkit, nsIToolkit *aToolkit,
nsWidgetInitData *aInitData); nsWidgetInitData *aInitData);
@ -136,7 +135,6 @@ public:
CreateChild(const nsIntRect& aRect, CreateChild(const nsIntRect& aRect,
EVENT_CALLBACK aHandleEventFunction, EVENT_CALLBACK aHandleEventFunction,
nsDeviceContext* aContext, nsDeviceContext* aContext,
nsIAppShell* aAppShell = nsnull,
nsIToolkit* aToolkit = nsnull, nsIToolkit* aToolkit = nsnull,
nsWidgetInitData* aInitData = nsnull, nsWidgetInitData* aInitData = nsnull,
bool aForceUseIWidgetParent = true); bool aForceUseIWidgetParent = true);

Просмотреть файл

@ -503,7 +503,6 @@ nsWindow::Create(nsIWidget *aParent,
const nsIntRect &aRect, const nsIntRect &aRect,
EVENT_CALLBACK aHandleEventFunction, EVENT_CALLBACK aHandleEventFunction,
nsDeviceContext *aContext, nsDeviceContext *aContext,
nsIAppShell *aAppShell,
nsIToolkit *aToolkit, nsIToolkit *aToolkit,
nsWidgetInitData *aInitData) nsWidgetInitData *aInitData)
{ {
@ -521,8 +520,7 @@ nsWindow::Create(nsIWidget *aParent,
mIsTopWidgetWindow = (nsnull == baseParent); mIsTopWidgetWindow = (nsnull == baseParent);
mBounds = aRect; mBounds = aRect;
BaseCreate(baseParent, aRect, aHandleEventFunction, aContext, BaseCreate(baseParent, aRect, aHandleEventFunction, aContext, aToolkit, aInitData);
aAppShell, aToolkit, aInitData);
HWND parent; HWND parent;
if (aParent) { // has a nsIWidget parent if (aParent) { // has a nsIWidget parent

Просмотреть файл

@ -114,7 +114,6 @@ public:
const nsIntRect &aRect, const nsIntRect &aRect,
EVENT_CALLBACK aHandleEventFunction, EVENT_CALLBACK aHandleEventFunction,
nsDeviceContext *aContext, nsDeviceContext *aContext,
nsIAppShell *aAppShell = nsnull,
nsIToolkit *aToolkit = nsnull, nsIToolkit *aToolkit = nsnull,
nsWidgetInitData *aInitData = nsnull); nsWidgetInitData *aInitData = nsnull);
NS_IMETHOD Destroy(); NS_IMETHOD Destroy();

Просмотреть файл

@ -112,14 +112,13 @@ PuppetWidget::Create(nsIWidget *aParent,
const nsIntRect &aRect, const nsIntRect &aRect,
EVENT_CALLBACK aHandleEventFunction, EVENT_CALLBACK aHandleEventFunction,
nsDeviceContext *aContext, nsDeviceContext *aContext,
nsIAppShell *aAppShell,
nsIToolkit *aToolkit, nsIToolkit *aToolkit,
nsWidgetInitData *aInitData) nsWidgetInitData *aInitData)
{ {
NS_ABORT_IF_FALSE(!aNativeParent, "got a non-Puppet native parent"); NS_ABORT_IF_FALSE(!aNativeParent, "got a non-Puppet native parent");
BaseCreate(nsnull, aRect, aHandleEventFunction, aContext, BaseCreate(nsnull, aRect, aHandleEventFunction, aContext,
aAppShell, aToolkit, aInitData); aToolkit, aInitData);
mBounds = aRect; mBounds = aRect;
mEnabled = PR_TRUE; mEnabled = PR_TRUE;
@ -152,7 +151,6 @@ already_AddRefed<nsIWidget>
PuppetWidget::CreateChild(const nsIntRect &aRect, PuppetWidget::CreateChild(const nsIntRect &aRect,
EVENT_CALLBACK aHandleEventFunction, EVENT_CALLBACK aHandleEventFunction,
nsDeviceContext *aContext, nsDeviceContext *aContext,
nsIAppShell *aAppShell,
nsIToolkit *aToolkit, nsIToolkit *aToolkit,
nsWidgetInitData *aInitData, nsWidgetInitData *aInitData,
bool aForceUseIWidgetParent) bool aForceUseIWidgetParent)
@ -162,7 +160,7 @@ PuppetWidget::CreateChild(const nsIntRect &aRect,
return ((widget && return ((widget &&
NS_SUCCEEDED(widget->Create(isPopup ? nsnull: this, nsnull, aRect, NS_SUCCEEDED(widget->Create(isPopup ? nsnull: this, nsnull, aRect,
aHandleEventFunction, aHandleEventFunction,
aContext, aAppShell, aToolkit, aContext, aToolkit,
aInitData))) ? aInitData))) ?
widget.forget() : nsnull); widget.forget() : nsnull);
} }

Просмотреть файл

@ -75,7 +75,6 @@ public:
const nsIntRect& aRect, const nsIntRect& aRect,
EVENT_CALLBACK aHandleEventFunction, EVENT_CALLBACK aHandleEventFunction,
nsDeviceContext* aContext, nsDeviceContext* aContext,
nsIAppShell* aAppShell = nsnull,
nsIToolkit* aToolkit = nsnull, nsIToolkit* aToolkit = nsnull,
nsWidgetInitData* aInitData = nsnull); nsWidgetInitData* aInitData = nsnull);
@ -83,7 +82,6 @@ public:
CreateChild(const nsIntRect &aRect, CreateChild(const nsIntRect &aRect,
EVENT_CALLBACK aHandleEventFunction, EVENT_CALLBACK aHandleEventFunction,
nsDeviceContext *aContext, nsDeviceContext *aContext,
nsIAppShell *aAppShell = nsnull,
nsIToolkit *aToolkit = nsnull, nsIToolkit *aToolkit = nsnull,
nsWidgetInitData *aInitData = nsnull, nsWidgetInitData *aInitData = nsnull,
bool aForceUseIWidgetParent = false); bool aForceUseIWidgetParent = false);

Просмотреть файл

@ -163,7 +163,6 @@ void nsBaseWidget::BaseCreate(nsIWidget *aParent,
const nsIntRect &aRect, const nsIntRect &aRect,
EVENT_CALLBACK aHandleEventFunction, EVENT_CALLBACK aHandleEventFunction,
nsDeviceContext *aContext, nsDeviceContext *aContext,
nsIAppShell *aAppShell,
nsIToolkit *aToolkit, nsIToolkit *aToolkit,
nsWidgetInitData *aInitData) nsWidgetInitData *aInitData)
{ {
@ -252,7 +251,6 @@ already_AddRefed<nsIWidget>
nsBaseWidget::CreateChild(const nsIntRect &aRect, nsBaseWidget::CreateChild(const nsIntRect &aRect,
EVENT_CALLBACK aHandleEventFunction, EVENT_CALLBACK aHandleEventFunction,
nsDeviceContext *aContext, nsDeviceContext *aContext,
nsIAppShell *aAppShell,
nsIToolkit *aToolkit, nsIToolkit *aToolkit,
nsWidgetInitData *aInitData, nsWidgetInitData *aInitData,
bool aForceUseIWidgetParent) bool aForceUseIWidgetParent)
@ -280,7 +278,7 @@ nsBaseWidget::CreateChild(const nsIntRect &aRect,
if (widget && if (widget &&
NS_SUCCEEDED(widget->Create(parent, nativeParent, aRect, NS_SUCCEEDED(widget->Create(parent, nativeParent, aRect,
aHandleEventFunction, aHandleEventFunction,
aContext, aAppShell, aToolkit, aContext, aToolkit,
aInitData))) { aInitData))) {
return widget.forget(); return widget.forget();
} }

Просмотреть файл

@ -41,7 +41,6 @@
#include "nsIWidget.h" #include "nsIWidget.h"
#include "nsWidgetsCID.h" #include "nsWidgetsCID.h"
#include "nsIToolkit.h" #include "nsIToolkit.h"
#include "nsIAppShell.h"
#include "nsILocalFile.h" #include "nsILocalFile.h"
#include "nsString.h" #include "nsString.h"
#include "nsCOMPtr.h" #include "nsCOMPtr.h"
@ -166,7 +165,6 @@ public:
CreateChild(const nsIntRect &aRect, CreateChild(const nsIntRect &aRect,
EVENT_CALLBACK aHandleEventFunction, EVENT_CALLBACK aHandleEventFunction,
nsDeviceContext *aContext, nsDeviceContext *aContext,
nsIAppShell *aAppShell = nsnull,
nsIToolkit *aToolkit = nsnull, nsIToolkit *aToolkit = nsnull,
nsWidgetInitData *aInitData = nsnull, nsWidgetInitData *aInitData = nsnull,
bool aForceUseIWidgetParent = false); bool aForceUseIWidgetParent = false);
@ -236,7 +234,6 @@ protected:
const nsIntRect &aRect, const nsIntRect &aRect,
EVENT_CALLBACK aHandleEventFunction, EVENT_CALLBACK aHandleEventFunction,
nsDeviceContext *aContext, nsDeviceContext *aContext,
nsIAppShell *aAppShell,
nsIToolkit *aToolkit, nsIToolkit *aToolkit,
nsWidgetInitData *aInitData); nsWidgetInitData *aInitData);

Просмотреть файл

@ -1468,7 +1468,7 @@ TestApp::Run(void)
nsIWebBrowserChrome::CHROME_DEFAULT, nsIWebBrowserChrome::CHROME_DEFAULT,
800 /*nsIAppShellService::SIZE_TO_CONTENT*/, 800 /*nsIAppShellService::SIZE_TO_CONTENT*/,
600 /*nsIAppShellService::SIZE_TO_CONTENT*/, 600 /*nsIAppShellService::SIZE_TO_CONTENT*/,
mAppShell, getter_AddRefs(mWindow)); getter_AddRefs(mWindow));
NS_ENSURE_SUCCESS(rv, rv); NS_ENSURE_SUCCESS(rv, rv);
nsCOMPtr<nsIDocShell> docShell; nsCOMPtr<nsIDocShell> docShell;

Просмотреть файл

@ -48,7 +48,7 @@ interface nsIAppShell;
struct JSContext; struct JSContext;
%} %}
[scriptable, uuid(361facd0-6e9a-4ff1-a0d4-450744cf0023)] [scriptable, uuid(EBCD34E2-2E43-45C0-AAC8-E6F1C692B371)]
interface nsIAppShellService : nsISupports interface nsIAppShellService : nsISupports
{ {
/** /**
@ -66,8 +66,6 @@ interface nsIAppShellService : nsISupports
* tag in the XUL. Set to NS_SIZETOCONTENT to force * tag in the XUL. Set to NS_SIZETOCONTENT to force
* the window to wrap to its contents. * the window to wrap to its contents.
* @param aInitialHeight like aInitialWidth, but subtly different. * @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. * @param aResult the newly created window is returned here.
*/ */
const long SIZE_TO_CONTENT = -1; const long SIZE_TO_CONTENT = -1;
@ -75,11 +73,10 @@ interface nsIAppShellService : nsISupports
in nsIURI aUrl, in nsIURI aUrl,
in PRUint32 aChromeMask, in PRUint32 aChromeMask,
in long aInitialWidth, in long aInitialWidth,
in long aInitialHeight, in long aInitialHeight);
in nsIAppShell aAppShell);
[noscript] [noscript]
void createHiddenWindow(in nsIAppShell aAppShell); void createHiddenWindow();
void destroyHiddenWindow(); void destroyHiddenWindow();

Просмотреть файл

@ -48,10 +48,9 @@
interface nsIDocShell; interface nsIDocShell;
interface nsIDocShellTreeItem; interface nsIDocShellTreeItem;
interface nsIAppShell;
interface nsIXULBrowserWindow; interface nsIXULBrowserWindow;
[scriptable, uuid(5869c5e5-743d-473c-bb71-41752146d373)] [scriptable, uuid(CCF9E98A-E442-4061-9F74-94539DD9FE9E)]
interface nsIXULWindow : nsISupports interface nsIXULWindow : nsISupports
{ {
/** /**
@ -144,8 +143,7 @@ interface nsIXULWindow : nsISupports
* @param aChromeFlags see nsIWebBrowserChrome * @param aChromeFlags see nsIWebBrowserChrome
* @return the newly minted window * @return the newly minted window
*/ */
nsIXULWindow createNewWindow(in PRInt32 aChromeFlags, nsIXULWindow createNewWindow(in PRInt32 aChromeFlags);
in nsIAppShell aAppShell);
attribute nsIXULBrowserWindow XULBrowserWindow; attribute nsIXULBrowserWindow XULBrowserWindow;

Просмотреть файл

@ -111,7 +111,7 @@ NS_IMPL_ISUPPORTS2(nsAppShellService,
nsIObserver) nsIObserver)
NS_IMETHODIMP NS_IMETHODIMP
nsAppShellService::CreateHiddenWindow(nsIAppShell* aAppShell) nsAppShellService::CreateHiddenWindow()
{ {
nsresult rv; nsresult rv;
PRInt32 initialHeight = 100, initialWidth = 100; PRInt32 initialHeight = 100, initialWidth = 100;
@ -134,7 +134,7 @@ nsAppShellService::CreateHiddenWindow(nsIAppShell* aAppShell)
nsRefPtr<nsWebShellWindow> newWindow; nsRefPtr<nsWebShellWindow> newWindow;
rv = JustCreateTopWindow(nsnull, url, rv = JustCreateTopWindow(nsnull, url,
chromeMask, initialWidth, initialHeight, chromeMask, initialWidth, initialHeight,
PR_TRUE, aAppShell, getter_AddRefs(newWindow)); PR_TRUE, getter_AddRefs(newWindow));
NS_ENSURE_SUCCESS(rv, rv); NS_ENSURE_SUCCESS(rv, rv);
mHiddenWindow.swap(newWindow); mHiddenWindow.swap(newWindow);
@ -167,7 +167,6 @@ nsAppShellService::CreateTopLevelWindow(nsIXULWindow *aParent,
PRUint32 aChromeMask, PRUint32 aChromeMask,
PRInt32 aInitialWidth, PRInt32 aInitialWidth,
PRInt32 aInitialHeight, PRInt32 aInitialHeight,
nsIAppShell* aAppShell,
nsIXULWindow **aResult) nsIXULWindow **aResult)
{ {
@ -179,7 +178,7 @@ nsAppShellService::CreateTopLevelWindow(nsIXULWindow *aParent,
nsWebShellWindow *newWindow = nsnull; nsWebShellWindow *newWindow = nsnull;
rv = JustCreateTopWindow(aParent, aUrl, rv = JustCreateTopWindow(aParent, aUrl,
aChromeMask, aInitialWidth, aInitialHeight, aChromeMask, aInitialWidth, aInitialHeight,
PR_FALSE, aAppShell, &newWindow); // addrefs PR_FALSE, &newWindow); // addrefs
*aResult = newWindow; // transfer ref *aResult = newWindow; // transfer ref
@ -280,7 +279,6 @@ nsAppShellService::JustCreateTopWindow(nsIXULWindow *aParent,
PRInt32 aInitialWidth, PRInt32 aInitialWidth,
PRInt32 aInitialHeight, PRInt32 aInitialHeight,
bool aIsHiddenWindow, bool aIsHiddenWindow,
nsIAppShell* aAppShell,
nsWebShellWindow **aResult) nsWebShellWindow **aResult)
{ {
*aResult = nsnull; *aResult = nsnull;
@ -381,8 +379,7 @@ nsAppShellService::JustCreateTopWindow(nsIXULWindow *aParent,
} }
nsresult rv = window->Initialize(parent, center ? aParent : nsnull, nsresult rv = window->Initialize(parent, center ? aParent : nsnull,
aAppShell, aUrl, aUrl, aInitialWidth, aInitialHeight,
aInitialWidth, aInitialHeight,
aIsHiddenWindow, widgetInitData); aIsHiddenWindow, widgetInitData);
NS_ENSURE_SUCCESS(rv, rv); NS_ENSURE_SUCCESS(rv, rv);

Просмотреть файл

@ -67,7 +67,7 @@ protected:
nsIURI *aUrl, nsIURI *aUrl,
PRUint32 aChromeMask, PRUint32 aChromeMask,
PRInt32 aInitialWidth, PRInt32 aInitialHeight, PRInt32 aInitialWidth, PRInt32 aInitialHeight,
bool aIsHiddenWindow, nsIAppShell* aAppShell, bool aIsHiddenWindow,
nsWebShellWindow **aResult); nsWebShellWindow **aResult);
PRUint32 CalculateWindowZLevel(nsIXULWindow *aParent, PRUint32 aChromeMask); PRUint32 CalculateWindowZLevel(nsIXULWindow *aParent, PRUint32 aChromeMask);

Просмотреть файл

@ -64,9 +64,6 @@
#include "nsGUIEvent.h" #include "nsGUIEvent.h"
#include "nsWidgetsCID.h" #include "nsWidgetsCID.h"
#include "nsIWidget.h" #include "nsIWidget.h"
#include "nsIAppShell.h"
#include "nsIAppShellService.h"
#include "nsIDOMCharacterData.h" #include "nsIDOMCharacterData.h"
#include "nsIDOMNodeList.h" #include "nsIDOMNodeList.h"
@ -149,7 +146,7 @@ NS_INTERFACE_MAP_END_INHERITING(nsXULWindow)
nsresult nsWebShellWindow::Initialize(nsIXULWindow* aParent, nsresult nsWebShellWindow::Initialize(nsIXULWindow* aParent,
nsIXULWindow* aOpener, nsIXULWindow* aOpener,
nsIAppShell* aShell, nsIURI* aUrl, nsIURI* aUrl,
PRInt32 aInitialWidth, PRInt32 aInitialWidth,
PRInt32 aInitialHeight, PRInt32 aInitialHeight,
bool aIsHiddenWindow, bool aIsHiddenWindow,
@ -209,7 +206,6 @@ nsresult nsWebShellWindow::Initialize(nsIXULWindow* aParent,
r, // Widget dimensions r, // Widget dimensions
nsWebShellWindow::HandleEvent, // Event handler function nsWebShellWindow::HandleEvent, // Event handler function
nsnull, // Device context nsnull, // Device context
aShell, // Application shell
nsnull, // nsIToolkit nsnull, // nsIToolkit
&widgetInitData); // Widget initialization data &widgetInitData); // Widget initialization data
mWindow->GetClientBounds(r); mWindow->GetClientBounds(r);

Просмотреть файл

@ -51,7 +51,6 @@
/* Forward declarations.... */ /* Forward declarations.... */
class nsIURI; class nsIURI;
class nsIAppShell;
class nsWebShellWindow : public nsXULWindow, class nsWebShellWindow : public nsXULWindow,
public nsIWebProgressListener public nsIWebProgressListener
@ -64,7 +63,7 @@ public:
// nsWebShellWindow methods... // nsWebShellWindow methods...
nsresult Initialize(nsIXULWindow * aParent, nsIXULWindow * aOpener, nsresult Initialize(nsIXULWindow * aParent, nsIXULWindow * aOpener,
nsIAppShell* aShell, nsIURI* aUrl, nsIURI* aUrl,
PRInt32 aInitialWidth, PRInt32 aInitialHeight, PRInt32 aInitialWidth, PRInt32 aInitialHeight,
bool aIsHiddenWindow, bool aIsHiddenWindow,
nsWidgetInitData& widgetInitData); nsWidgetInitData& widgetInitData);

Просмотреть файл

@ -1738,17 +1738,17 @@ NS_IMETHODIMP nsXULWindow::ExitModalLoop(nsresult aStatus)
// top-level function to create a new window // top-level function to create a new window
NS_IMETHODIMP nsXULWindow::CreateNewWindow(PRInt32 aChromeFlags, NS_IMETHODIMP nsXULWindow::CreateNewWindow(PRInt32 aChromeFlags,
nsIAppShell* aAppShell, nsIXULWindow **_retval) nsIXULWindow **_retval)
{ {
NS_ENSURE_ARG_POINTER(_retval); NS_ENSURE_ARG_POINTER(_retval);
if (aChromeFlags & nsIWebBrowserChrome::CHROME_OPENAS_CHROME) if (aChromeFlags & nsIWebBrowserChrome::CHROME_OPENAS_CHROME)
return CreateNewChromeWindow(aChromeFlags, aAppShell, _retval); return CreateNewChromeWindow(aChromeFlags, _retval);
return CreateNewContentWindow(aChromeFlags, aAppShell, _retval); return CreateNewContentWindow(aChromeFlags, _retval);
} }
NS_IMETHODIMP nsXULWindow::CreateNewChromeWindow(PRInt32 aChromeFlags, NS_IMETHODIMP nsXULWindow::CreateNewChromeWindow(PRInt32 aChromeFlags,
nsIAppShell* aAppShell, nsIXULWindow **_retval) nsIXULWindow **_retval)
{ {
nsCOMPtr<nsIAppShellService> appShell(do_GetService(NS_APPSHELLSERVICE_CONTRACTID)); nsCOMPtr<nsIAppShellService> appShell(do_GetService(NS_APPSHELLSERVICE_CONTRACTID));
NS_ENSURE_TRUE(appShell, NS_ERROR_FAILURE); NS_ENSURE_TRUE(appShell, NS_ERROR_FAILURE);
@ -1759,7 +1759,7 @@ NS_IMETHODIMP nsXULWindow::CreateNewChromeWindow(PRInt32 aChromeFlags,
appShell->CreateTopLevelWindow(this, nsnull, aChromeFlags, appShell->CreateTopLevelWindow(this, nsnull, aChromeFlags,
nsIAppShellService::SIZE_TO_CONTENT, nsIAppShellService::SIZE_TO_CONTENT,
nsIAppShellService::SIZE_TO_CONTENT, nsIAppShellService::SIZE_TO_CONTENT,
aAppShell, getter_AddRefs(newWindow)); getter_AddRefs(newWindow));
NS_ENSURE_TRUE(newWindow, NS_ERROR_FAILURE); NS_ENSURE_TRUE(newWindow, NS_ERROR_FAILURE);
@ -1770,7 +1770,7 @@ NS_IMETHODIMP nsXULWindow::CreateNewChromeWindow(PRInt32 aChromeFlags,
} }
NS_IMETHODIMP nsXULWindow::CreateNewContentWindow(PRInt32 aChromeFlags, NS_IMETHODIMP nsXULWindow::CreateNewContentWindow(PRInt32 aChromeFlags,
nsIAppShell* aAppShell, nsIXULWindow **_retval) nsIXULWindow **_retval)
{ {
nsCOMPtr<nsIAppShellService> appShell(do_GetService(NS_APPSHELLSERVICE_CONTRACTID)); nsCOMPtr<nsIAppShellService> appShell(do_GetService(NS_APPSHELLSERVICE_CONTRACTID));
NS_ENSURE_TRUE(appShell, NS_ERROR_FAILURE); NS_ENSURE_TRUE(appShell, NS_ERROR_FAILURE);
@ -1795,7 +1795,7 @@ NS_IMETHODIMP nsXULWindow::CreateNewContentWindow(PRInt32 aChromeFlags,
nsCOMPtr<nsIXULWindow> newWindow; nsCOMPtr<nsIXULWindow> newWindow;
appShell->CreateTopLevelWindow(this, uri, appShell->CreateTopLevelWindow(this, uri,
aChromeFlags, 615, 480, aAppShell, aChromeFlags, 615, 480,
getter_AddRefs(newWindow)); getter_AddRefs(newWindow));
NS_ENSURE_TRUE(newWindow, NS_ERROR_FAILURE); NS_ENSURE_TRUE(newWindow, NS_ERROR_FAILURE);

Просмотреть файл

@ -134,10 +134,8 @@ protected:
NS_IMETHOD SizeShellTo(nsIDocShellTreeItem* aShellItem, PRInt32 aCX, NS_IMETHOD SizeShellTo(nsIDocShellTreeItem* aShellItem, PRInt32 aCX,
PRInt32 aCY); PRInt32 aCY);
NS_IMETHOD ExitModalLoop(nsresult aStatus); NS_IMETHOD ExitModalLoop(nsresult aStatus);
NS_IMETHOD CreateNewChromeWindow(PRInt32 aChromeFlags, NS_IMETHOD CreateNewChromeWindow(PRInt32 aChromeFlags, nsIXULWindow **_retval);
nsIAppShell* aAppShell, nsIXULWindow **_retval); NS_IMETHOD CreateNewContentWindow(PRInt32 aChromeFlags, nsIXULWindow **_retval);
NS_IMETHOD CreateNewContentWindow(PRInt32 aChromeFlags,
nsIAppShell* aAppShell, nsIXULWindow **_retval);
void EnableParent(bool aEnable); void EnableParent(bool aEnable);
bool ConstrainToZLevel(bool aImmediate, nsWindowZ *aPlacement, bool ConstrainToZLevel(bool aImmediate, nsWindowZ *aPlacement,