Bug 1470510 - Rename nsXULWindow and nsIXULWindow to AppWindow and nsIAppWindow. r=smaug

nsXULWindow is no longer XUL specific and is somewhat confusing name.

Differential Revision: https://phabricator.services.mozilla.com/D51486
This commit is contained in:
Brendan Dahl
2019-11-05 17:56:28 +00:00
parent 695dbc125e
commit ef30c33394
74 changed files with 844 additions and 850 deletions

View File

@@ -45,7 +45,7 @@
#include "nsGlobalWindow.h" #include "nsGlobalWindow.h"
#ifdef MOZ_XUL #ifdef MOZ_XUL
# include "nsIXULWindow.h" # include "nsIAppWindow.h"
#endif #endif
using namespace mozilla; using namespace mozilla;
@@ -97,18 +97,18 @@ role RootAccessible::NativeRole() const {
uint32_t RootAccessible::GetChromeFlags() const { uint32_t RootAccessible::GetChromeFlags() const {
// Return the flag set for the top level window as defined // Return the flag set for the top level window as defined
// by nsIWebBrowserChrome::CHROME_WINDOW_[FLAGNAME] // by nsIWebBrowserChrome::CHROME_WINDOW_[FLAGNAME]
// Not simple: nsIXULWindow is not just a QI from nsIDOMWindow // Not simple: nsIAppWindow is not just a QI from nsIDOMWindow
nsCOMPtr<nsIDocShell> docShell = nsCoreUtils::GetDocShellFor(mDocumentNode); nsCOMPtr<nsIDocShell> docShell = nsCoreUtils::GetDocShellFor(mDocumentNode);
NS_ENSURE_TRUE(docShell, 0); NS_ENSURE_TRUE(docShell, 0);
nsCOMPtr<nsIDocShellTreeOwner> treeOwner; nsCOMPtr<nsIDocShellTreeOwner> treeOwner;
docShell->GetTreeOwner(getter_AddRefs(treeOwner)); docShell->GetTreeOwner(getter_AddRefs(treeOwner));
NS_ENSURE_TRUE(treeOwner, 0); NS_ENSURE_TRUE(treeOwner, 0);
nsCOMPtr<nsIXULWindow> xulWin(do_GetInterface(treeOwner)); nsCOMPtr<nsIAppWindow> appWin(do_GetInterface(treeOwner));
if (!xulWin) { if (!appWin) {
return 0; return 0;
} }
uint32_t chromeFlags; uint32_t chromeFlags;
xulWin->GetChromeFlags(&chromeFlags); appWin->GetChromeFlags(&chromeFlags);
return chromeFlags; return chromeFlags;
} }
#endif #endif

View File

@@ -1759,7 +1759,7 @@ var gBrowserInit = {
// This needs setting up before we create the first remote browser. // This needs setting up before we create the first remote browser.
window.docShell.treeOwner window.docShell.treeOwner
.QueryInterface(Ci.nsIInterfaceRequestor) .QueryInterface(Ci.nsIInterfaceRequestor)
.getInterface(Ci.nsIXULWindow).XULBrowserWindow = window.XULBrowserWindow; .getInterface(Ci.nsIAppWindow).XULBrowserWindow = window.XULBrowserWindow;
window.browserDOMWindow = new nsBrowserAccess(); window.browserDOMWindow = new nsBrowserAccess();
gBrowser = window._gBrowser; gBrowser = window._gBrowser;
@@ -2534,7 +2534,7 @@ var gBrowserInit = {
window.XULBrowserWindow = null; window.XULBrowserWindow = null;
window.docShell.treeOwner window.docShell.treeOwner
.QueryInterface(Ci.nsIInterfaceRequestor) .QueryInterface(Ci.nsIInterfaceRequestor)
.getInterface(Ci.nsIXULWindow).XULBrowserWindow = null; .getInterface(Ci.nsIAppWindow).XULBrowserWindow = null;
window.browserDOMWindow = null; window.browserDOMWindow = null;
}, },
}; };

View File

@@ -449,11 +449,11 @@ let LEGACY_ACTORS = {
// Set the size to use when the user leaves the maximized mode. // Set the size to use when the user leaves the maximized mode.
// The persisted size is the outer size, but the height/width // The persisted size is the outer size, but the height/width
// attributes set the inner size. // attributes set the inner size.
let xulWin = win.docShell.treeOwner let appWin = win.docShell.treeOwner
.QueryInterface(Ci.nsIInterfaceRequestor) .QueryInterface(Ci.nsIInterfaceRequestor)
.getInterface(Ci.nsIXULWindow); .getInterface(Ci.nsIAppWindow);
height -= xulWin.outerToInnerHeightDifferenceInCSSPixels; height -= appWin.outerToInnerHeightDifferenceInCSSPixels;
width -= xulWin.outerToInnerWidthDifferenceInCSSPixels; width -= appWin.outerToInnerWidthDifferenceInCSSPixels;
docElt.setAttribute("height", height); docElt.setAttribute("height", height);
docElt.setAttribute("width", width); docElt.setAttribute("width", width);
} else { } else {

View File

@@ -131,7 +131,7 @@ var DownloadsTaskbar = {
// Activate the indicator on the specified window. // Activate the indicator on the specified window.
let docShell = aWindow.docShell.treeOwner let docShell = aWindow.docShell.treeOwner
.QueryInterface(Ci.nsIInterfaceRequestor) .QueryInterface(Ci.nsIInterfaceRequestor)
.getInterface(Ci.nsIXULWindow).docShell; .getInterface(Ci.nsIAppWindow).docShell;
this._taskbarProgress = gWinTaskbar.getTaskbarProgress(docShell); this._taskbarProgress = gWinTaskbar.getTaskbarProgress(docShell);
// If the DownloadSummary object has already been created, we should update // If the DownloadSummary object has already been created, we should update

View File

@@ -1009,7 +1009,7 @@ class Window extends WindowBase {
} }
get alwaysOnTop() { get alwaysOnTop() {
return this.xulWindow.zLevel >= Ci.nsIXULWindow.raisedZ; return this.appWindow.zLevel >= Ci.nsIAppWindow.raisedZ;
} }
get isLastFocused() { get isLastFocused() {

View File

@@ -172,7 +172,7 @@ add_task(async function testWindowCreate() {
if (expected.chromeFlags) { if (expected.chromeFlags) {
let { chromeFlags } = latestWindow.docShell.treeOwner let { chromeFlags } = latestWindow.docShell.treeOwner
.QueryInterface(Ci.nsIInterfaceRequestor) .QueryInterface(Ci.nsIInterfaceRequestor)
.getInterface(Ci.nsIXULWindow); .getInterface(Ci.nsIAppWindow);
for (let flag of expected.chromeFlags) { for (let flag of expected.chromeFlags) {
ok( ok(
chromeFlags & Ci.nsIWebBrowserChrome[flag], chromeFlags & Ci.nsIWebBrowserChrome[flag],

View File

@@ -2,7 +2,7 @@
/** /**
* Given some window in the parent process, ensure that * Given some window in the parent process, ensure that
* the nsIXULWindow has the CHROME_PRIVATE_WINDOW chromeFlag, * the nsIAppWindow has the CHROME_PRIVATE_WINDOW chromeFlag,
* and that the usePrivateBrowsing property is set to true on * and that the usePrivateBrowsing property is set to true on
* both the window's nsILoadContext, as well as on the initial * both the window's nsILoadContext, as well as on the initial
* browser's content docShell nsILoadContext. * browser's content docShell nsILoadContext.
@@ -15,7 +15,7 @@ function assertWindowIsPrivate(win) {
let winDocShell = win.docShell; let winDocShell = win.docShell;
let chromeFlags = winDocShell.treeOwner let chromeFlags = winDocShell.treeOwner
.QueryInterface(Ci.nsIInterfaceRequestor) .QueryInterface(Ci.nsIInterfaceRequestor)
.getInterface(Ci.nsIXULWindow).chromeFlags; .getInterface(Ci.nsIAppWindow).chromeFlags;
if (!win.gBrowser.selectedBrowser.hasContentOpener) { if (!win.gBrowser.selectedBrowser.hasContentOpener) {
Assert.ok( Assert.ok(

View File

@@ -244,10 +244,10 @@ class TelemetryHandler {
* This is called when a new window is opened, and handles registration of * This is called when a new window is opened, and handles registration of
* that window if it is a browser window. * that window if it is a browser window.
* *
* @param {nsIXULWindow} xulWin The xul window that was opened. * @param {nsIAppWindow} appWin The xul window that was opened.
*/ */
onOpenWindow(xulWin) { onOpenWindow(appWin) {
let win = xulWin.docShell.domWindow; let win = appWin.docShell.domWindow;
win.addEventListener( win.addEventListener(
"load", "load",
() => { () => {
@@ -268,10 +268,10 @@ class TelemetryHandler {
* Listener that is called when a window is closed, and handles deregistration of * Listener that is called when a window is closed, and handles deregistration of
* that window if it is a browser window. * that window if it is a browser window.
* *
* @param {nsIXULWindow} xulWin The xul window that was closed. * @param {nsIAppWindow} appWin The xul window that was closed.
*/ */
onCloseWindow(xulWin) { onCloseWindow(appWin) {
let win = xulWin.docShell.domWindow; let win = appWin.docShell.domWindow;
if ( if (
win.document.documentElement.getAttribute("windowtype") != win.document.documentElement.getAttribute("windowtype") !=

View File

@@ -5259,7 +5259,7 @@ var SessionStoreInternal = {
}, },
/** /**
* on popup windows, the XULWindow's attributes seem not to be set correctly * on popup windows, the AppWindow's attributes seem not to be set correctly
* we use thus JSDOMWindow attributes for sizemode and normal window attributes * we use thus JSDOMWindow attributes for sizemode and normal window attributes
* (and hope for reasonable values when maximized/minimized - since then * (and hope for reasonable values when maximized/minimized - since then
* outerWidth/outerHeight aren't the dimensions of the restored window) * outerWidth/outerHeight aren't the dimensions of the restored window)
@@ -5298,13 +5298,13 @@ var SessionStoreInternal = {
} }
// Width and height attribute report the inner size, but we want // Width and height attribute report the inner size, but we want
// to store the outer size, so add the difference. // to store the outer size, so add the difference.
let xulWin = aWindow.docShell.treeOwner let appWin = aWindow.docShell.treeOwner
.QueryInterface(Ci.nsIInterfaceRequestor) .QueryInterface(Ci.nsIInterfaceRequestor)
.getInterface(Ci.nsIXULWindow); .getInterface(Ci.nsIAppWindow);
let diff = let diff =
aAttribute == "width" aAttribute == "width"
? xulWin.outerToInnerWidthDifferenceInCSSPixels ? appWin.outerToInnerWidthDifferenceInCSSPixels
: xulWin.outerToInnerHeightDifferenceInCSSPixels; : appWin.outerToInnerHeightDifferenceInCSSPixels;
return attr + diff; return attr + diff;
} }
} }

View File

@@ -123,8 +123,8 @@ startupRecorder.prototype = {
// not other types (for example, the gfx sanity test window) // not other types (for example, the gfx sanity test window)
if (topic == firstPaintNotification) { if (topic == firstPaintNotification) {
// In the case we're handling xul-window-visible, we'll have been handed // In the case we're handling xul-window-visible, we'll have been handed
// an nsIXULWindow instead of an nsIDOMWindow. // an nsIAppWindow instead of an nsIDOMWindow.
if (subject instanceof Ci.nsIXULWindow) { if (subject instanceof Ci.nsIAppWindow) {
subject = subject subject = subject
.QueryInterface(Ci.nsIInterfaceRequestor) .QueryInterface(Ci.nsIInterfaceRequestor)
.getInterface(Ci.nsIDOMWindow); .getInterface(Ci.nsIDOMWindow);

View File

@@ -289,12 +289,12 @@ BrowserTabList.prototype._getChildren = function(window) {
}; };
BrowserTabList.prototype.getList = function(browserActorOptions) { BrowserTabList.prototype.getList = function(browserActorOptions) {
const topXULWindow = Services.wm.getMostRecentWindow( const topAppWindow = Services.wm.getMostRecentWindow(
DebuggerServer.chromeWindowType DebuggerServer.chromeWindowType
); );
let selectedBrowser = null; let selectedBrowser = null;
if (topXULWindow) { if (topAppWindow) {
selectedBrowser = this._getSelectedBrowser(topXULWindow); selectedBrowser = this._getSelectedBrowser(topAppWindow);
} }
// As a sanity check, make sure all the actors presently in our map get // As a sanity check, make sure all the actors presently in our map get
@@ -416,11 +416,11 @@ BrowserTabList.prototype.getTab = function(
}); });
} }
const topXULWindow = Services.wm.getMostRecentWindow( const topAppWindow = Services.wm.getMostRecentWindow(
DebuggerServer.chromeWindowType DebuggerServer.chromeWindowType
); );
if (topXULWindow) { if (topAppWindow) {
const selectedBrowser = this._getSelectedBrowser(topXULWindow); const selectedBrowser = this._getSelectedBrowser(topAppWindow);
return this._getActorForBrowser(selectedBrowser, browserActorOptions); return this._getActorForBrowser(selectedBrowser, browserActorOptions);
} }
return Promise.reject({ return Promise.reject({
@@ -781,7 +781,7 @@ BrowserTabList.prototype.onOpenWindow = DevToolsUtils.makeInfallible(function(
BrowserTabList.prototype.onCloseWindow = DevToolsUtils.makeInfallible(function( BrowserTabList.prototype.onCloseWindow = DevToolsUtils.makeInfallible(function(
window window
) { ) {
if (window instanceof Ci.nsIXULWindow) { if (window instanceof Ci.nsIAppWindow) {
window = window.docShell.domWindow; window = window.docShell.domWindow;
} }

View File

@@ -4984,7 +4984,7 @@ nsDocShell::SetParentNativeWindow(nativeWindow aParentNativeWindow) {
NS_IMETHODIMP NS_IMETHODIMP
nsDocShell::GetNativeHandle(nsAString& aNativeHandle) { nsDocShell::GetNativeHandle(nsAString& aNativeHandle) {
// the nativeHandle should be accessed from nsIXULWindow // the nativeHandle should be accessed from nsIAppWindow
return NS_ERROR_NOT_IMPLEMENTED; return NS_ERROR_NOT_IMPLEMENTED;
} }

View File

@@ -360,7 +360,7 @@ nsDocShellTreeOwner::SizeShellTo(nsIDocShellTreeItem* aShellItem, int32_t aCX,
if (browserChild) { if (browserChild) {
// The XUL window to resize is in the parent process, but there we // The XUL window to resize is in the parent process, but there we
// won't be able to get aShellItem to do the hack in // won't be able to get aShellItem to do the hack in
// nsXULWindow::SizeShellTo, so let's send the width and height of // AppWindow::SizeShellTo, so let's send the width and height of
// aShellItem too. // aShellItem too.
nsCOMPtr<nsIBaseWindow> shellAsWin(do_QueryInterface(aShellItem)); nsCOMPtr<nsIBaseWindow> shellAsWin(do_QueryInterface(aShellItem));
NS_ENSURE_TRUE(shellAsWin, NS_ERROR_FAILURE); NS_ENSURE_TRUE(shellAsWin, NS_ERROR_FAILURE);
@@ -588,7 +588,7 @@ nsDocShellTreeOwner::SetParentNativeWindow(nativeWindow aParentNativeWindow) {
NS_IMETHODIMP NS_IMETHODIMP
nsDocShellTreeOwner::GetNativeHandle(nsAString& aNativeHandle) { nsDocShellTreeOwner::GetNativeHandle(nsAString& aNativeHandle) {
// the nativeHandle should be accessed from nsIXULWindow // the nativeHandle should be accessed from nsIAppWindow
return NS_ERROR_NOT_IMPLEMENTED; return NS_ERROR_NOT_IMPLEMENTED;
} }

View File

@@ -33,7 +33,7 @@ add_task(async function() {
let chromeFlags = win.docShell.treeOwner let chromeFlags = win.docShell.treeOwner
.QueryInterface(Ci.nsIInterfaceRequestor) .QueryInterface(Ci.nsIInterfaceRequestor)
.getInterface(Ci.nsIXULWindow).chromeFlags; .getInterface(Ci.nsIAppWindow).chromeFlags;
let expected = CHROME_ALL; let expected = CHROME_ALL;

View File

@@ -312,7 +312,7 @@
#ifdef MOZ_XUL #ifdef MOZ_XUL
# include "mozilla/dom/XULBroadcastManager.h" # include "mozilla/dom/XULBroadcastManager.h"
# include "mozilla/dom/XULPersist.h" # include "mozilla/dom/XULPersist.h"
# include "nsIXULWindow.h" # include "nsIAppWindow.h"
# include "nsIChromeRegistry.h" # include "nsIChromeRegistry.h"
# include "nsXULPrototypeDocument.h" # include "nsXULPrototypeDocument.h"
# include "nsXULCommandDispatcher.h" # include "nsXULCommandDispatcher.h"
@@ -8381,7 +8381,7 @@ void Document::SetMayStartLayout(bool aMayStartLayout) {
// Before starting layout, check whether we're a toplevel chrome // Before starting layout, check whether we're a toplevel chrome
// window. If we are, setup some state so that we don't have to restyle // window. If we are, setup some state so that we don't have to restyle
// the whole tree after StartLayout. // the whole tree after StartLayout.
if (nsCOMPtr<nsIXULWindow> win = GetXULWindowIfToplevelChrome()) { if (nsCOMPtr<nsIAppWindow> win = GetAppWindowIfToplevelChrome()) {
// We're the chrome document! // We're the chrome document!
win->BeforeStartLayout(); win->BeforeStartLayout();
} }
@@ -14275,23 +14275,23 @@ already_AddRefed<XPathResult> Document::Evaluate(
aType, aResult, rv); aType, aResult, rv);
} }
already_AddRefed<nsIXULWindow> Document::GetXULWindowIfToplevelChrome() const { already_AddRefed<nsIAppWindow> Document::GetAppWindowIfToplevelChrome() const {
nsCOMPtr<nsIDocShellTreeItem> item = GetDocShell(); nsCOMPtr<nsIDocShellTreeItem> item = GetDocShell();
if (!item) { if (!item) {
return nullptr; return nullptr;
} }
nsCOMPtr<nsIDocShellTreeOwner> owner; nsCOMPtr<nsIDocShellTreeOwner> owner;
item->GetTreeOwner(getter_AddRefs(owner)); item->GetTreeOwner(getter_AddRefs(owner));
nsCOMPtr<nsIXULWindow> xulWin = do_GetInterface(owner); nsCOMPtr<nsIAppWindow> appWin = do_GetInterface(owner);
if (!xulWin) { if (!appWin) {
return nullptr; return nullptr;
} }
nsCOMPtr<nsIDocShell> xulWinShell; nsCOMPtr<nsIDocShell> appWinShell;
xulWin->GetDocShell(getter_AddRefs(xulWinShell)); appWin->GetDocShell(getter_AddRefs(appWinShell));
if (!SameCOMIdentity(xulWinShell, item)) { if (!SameCOMIdentity(appWinShell, item)) {
return nullptr; return nullptr;
} }
return xulWin.forget(); return appWin.forget();
} }
Document* Document::GetTopLevelContentDocument() { Document* Document::GetTopLevelContentDocument() {

View File

@@ -133,7 +133,7 @@ class nsWindowSizes;
class nsDOMCaretPosition; class nsDOMCaretPosition;
class nsViewportInfo; class nsViewportInfo;
class nsIGlobalObject; class nsIGlobalObject;
class nsIXULWindow; class nsIAppWindow;
class nsXULPrototypeDocument; class nsXULPrototypeDocument;
class nsXULPrototypeElement; class nsXULPrototypeElement;
class PermissionDelegateHandler; class PermissionDelegateHandler;
@@ -3536,9 +3536,9 @@ class Document : public nsINode,
Document* GetTopLevelContentDocument(); Document* GetTopLevelContentDocument();
const Document* GetTopLevelContentDocument() const; const Document* GetTopLevelContentDocument() const;
// Returns the associated XUL window if this is a top-level chrome document, // Returns the associated app window if this is a top-level chrome document,
// null otherwise. // null otherwise.
already_AddRefed<nsIXULWindow> GetXULWindowIfToplevelChrome() const; already_AddRefed<nsIAppWindow> GetAppWindowIfToplevelChrome() const;
already_AddRefed<Element> CreateElement( already_AddRefed<Element> CreateElement(
const nsAString& aTagName, const ElementCreationOptionsOrString& aOptions, const nsAString& aTagName, const ElementCreationOptionsOrString& aOptions,

View File

@@ -18,7 +18,7 @@
#include "nsISHEntry.h" #include "nsISHEntry.h"
#include "nsIWindowWatcher.h" #include "nsIWindowWatcher.h"
#include "mozilla/Services.h" #include "mozilla/Services.h"
#include "nsIXULWindow.h" #include "nsIAppWindow.h"
#include "nsIAppShellService.h" #include "nsIAppShellService.h"
#include "nsAppShellCID.h" #include "nsAppShellCID.h"
#include "nsContentUtils.h" #include "nsContentUtils.h"
@@ -351,7 +351,7 @@ nsresult nsCCUncollectableMarker::Observe(nsISupports* aSubject,
bool hasHiddenWindow = false; bool hasHiddenWindow = false;
appShell->GetHasHiddenWindow(&hasHiddenWindow); appShell->GetHasHiddenWindow(&hasHiddenWindow);
if (hasHiddenWindow) { if (hasHiddenWindow) {
nsCOMPtr<nsIXULWindow> hw; nsCOMPtr<nsIAppWindow> hw;
appShell->GetHiddenWindow(getter_AddRefs(hw)); appShell->GetHiddenWindow(getter_AddRefs(hw));
nsCOMPtr<nsIDocShell> shell; nsCOMPtr<nsIDocShell> shell;
hw->GetDocShell(getter_AddRefs(shell)); hw->GetDocShell(getter_AddRefs(shell));

View File

@@ -24,7 +24,7 @@
#include "nsIWebNavigation.h" #include "nsIWebNavigation.h"
#include "nsCaret.h" #include "nsCaret.h"
#include "nsIBaseWindow.h" #include "nsIBaseWindow.h"
#include "nsIXULWindow.h" #include "nsIAppWindow.h"
#include "nsViewManager.h" #include "nsViewManager.h"
#include "nsFrameSelection.h" #include "nsFrameSelection.h"
#include "mozilla/dom/Document.h" #include "mozilla/dom/Document.h"
@@ -700,10 +700,10 @@ nsFocusManager::WindowRaised(mozIDOMWindowProxy* aWindow) {
NS_ASSERTION(currentWindow, "window raised with no window current"); NS_ASSERTION(currentWindow, "window raised with no window current");
if (!currentWindow) return NS_OK; if (!currentWindow) return NS_OK;
// If there is no nsIXULWindow, then this is an embedded or child process // If there is no nsIAppWindow, then this is an embedded or child process
// window. Pass false for aWindowRaised so that commands get updated. // window. Pass false for aWindowRaised so that commands get updated.
nsCOMPtr<nsIXULWindow> xulWin(do_GetInterface(baseWindow)); nsCOMPtr<nsIAppWindow> appWin(do_GetInterface(baseWindow));
Focus(currentWindow, currentFocus, 0, true, false, xulWin != nullptr, true); Focus(currentWindow, currentFocus, 0, true, false, appWin != nullptr, true);
return NS_OK; return NS_OK;
} }

View File

@@ -39,7 +39,7 @@
#include "nsSubDocumentFrame.h" #include "nsSubDocumentFrame.h"
#include "nsError.h" #include "nsError.h"
#include "nsISHistory.h" #include "nsISHistory.h"
#include "nsIXULWindow.h" #include "nsIAppWindow.h"
#include "nsIMozBrowserFrame.h" #include "nsIMozBrowserFrame.h"
#include "nsISHistory.h" #include "nsISHistory.h"
#include "nsIScriptError.h" #include "nsIScriptError.h"
@@ -2598,7 +2598,7 @@ bool nsFrameLoader::TryRemoteBrowserInternal() {
!parentOwner) { !parentOwner) {
return false; return false;
} }
nsCOMPtr<nsIXULWindow> window(do_GetInterface(parentOwner)); nsCOMPtr<nsIAppWindow> window(do_GetInterface(parentOwner));
if (window && NS_FAILED(window->GetChromeFlags(&chromeFlags))) { if (window && NS_FAILED(window->GetChromeFlags(&chromeFlags))) {
return false; return false;
} }

View File

@@ -160,7 +160,6 @@
#include "mozilla/EventStateManager.h" #include "mozilla/EventStateManager.h"
#include "nsIObserverService.h" #include "nsIObserverService.h"
#include "nsFocusManager.h" #include "nsFocusManager.h"
#include "nsIXULWindow.h"
#include "nsITimedChannel.h" #include "nsITimedChannel.h"
#include "nsServiceManagerUtils.h" #include "nsServiceManagerUtils.h"
#ifdef MOZ_XUL #ifdef MOZ_XUL

View File

@@ -154,7 +154,7 @@
#include "mozilla/EventStateManager.h" #include "mozilla/EventStateManager.h"
#include "nsIObserverService.h" #include "nsIObserverService.h"
#include "nsFocusManager.h" #include "nsFocusManager.h"
#include "nsIXULWindow.h" #include "nsIAppWindow.h"
#include "nsITimedChannel.h" #include "nsITimedChannel.h"
#include "nsServiceManagerUtils.h" #include "nsServiceManagerUtils.h"
#include "mozilla/dom/CustomEvent.h" #include "mozilla/dom/CustomEvent.h"
@@ -1546,7 +1546,7 @@ void nsGlobalWindowOuter::SetInitialPrincipalToSubject(
// We should never create windows with an expanded principal. // We should never create windows with an expanded principal.
// If we have a system principal, make sure we're not using it for a content // If we have a system principal, make sure we're not using it for a content
// docshell. // docshell.
// NOTE: Please keep this logic in sync with nsXULWindow::Initialize(). // NOTE: Please keep this logic in sync with AppWindow::Initialize().
if (nsContentUtils::IsExpandedPrincipal(newWindowPrincipal) || if (nsContentUtils::IsExpandedPrincipal(newWindowPrincipal) ||
(nsContentUtils::IsSystemPrincipal(newWindowPrincipal) && (nsContentUtils::IsSystemPrincipal(newWindowPrincipal) &&
GetDocShell()->ItemType() != nsIDocShellTreeItem::typeChrome)) { GetDocShell()->ItemType() != nsIDocShellTreeItem::typeChrome)) {
@@ -4404,9 +4404,9 @@ nsresult nsGlobalWindowOuter::SetFullscreenInternal(FullscreenReason aReason,
// Prevent chrome documents which are still loading from resizing // Prevent chrome documents which are still loading from resizing
// the window after we set fullscreen mode. // the window after we set fullscreen mode.
nsCOMPtr<nsIBaseWindow> treeOwnerAsWin = GetTreeOwnerWindow(); nsCOMPtr<nsIBaseWindow> treeOwnerAsWin = GetTreeOwnerWindow();
nsCOMPtr<nsIXULWindow> xulWin(do_GetInterface(treeOwnerAsWin)); nsCOMPtr<nsIAppWindow> appWin(do_GetInterface(treeOwnerAsWin));
if (aFullscreen && xulWin) { if (aFullscreen && appWin) {
xulWin->SetIntrinsicallySized(false); appWin->SetIntrinsicallySized(false);
} }
// Set this before so if widget sends an event indicating its // Set this before so if widget sends an event indicating its
@@ -6795,10 +6795,10 @@ void nsGlobalWindowOuter::ActivateOrDeactivate(bool aActivate) {
// Get the top level widget's nsGlobalWindowOuter // Get the top level widget's nsGlobalWindowOuter
nsCOMPtr<nsPIDOMWindowOuter> topLevelWindow; nsCOMPtr<nsPIDOMWindowOuter> topLevelWindow;
// widgetListener should be a nsXULWindow // widgetListener should be an AppWindow
nsIWidgetListener* listener = topLevelWidget->GetWidgetListener(); nsIWidgetListener* listener = topLevelWidget->GetWidgetListener();
if (listener) { if (listener) {
nsCOMPtr<nsIXULWindow> window = listener->GetXULWindow(); nsCOMPtr<nsIAppWindow> window = listener->GetAppWindow();
nsCOMPtr<nsIInterfaceRequestor> req(do_QueryInterface(window)); nsCOMPtr<nsIInterfaceRequestor> req(do_QueryInterface(window));
topLevelWindow = do_GetInterface(req); topLevelWindow = do_GetInterface(req);
} }

View File

@@ -56,6 +56,7 @@
#include "nsCheapSets.h" #include "nsCheapSets.h"
#include "mozilla/dom/ImageBitmapSource.h" #include "mozilla/dom/ImageBitmapSource.h"
#include "mozilla/UniquePtr.h" #include "mozilla/UniquePtr.h"
#include "mozilla/dom/BrowsingContext.h"
class nsDocShell; class nsDocShell;
class nsIArray; class nsIArray;
@@ -89,7 +90,6 @@ class DOMEventTargetHelper;
class ThrottledEventQueue; class ThrottledEventQueue;
namespace dom { namespace dom {
class BarProp; class BarProp;
class BrowsingContext;
struct ChannelPixelLayout; struct ChannelPixelLayout;
class Console; class Console;
class Crypto; class Crypto;

View File

@@ -72,7 +72,7 @@
#include "nsIWebBrowserChrome.h" #include "nsIWebBrowserChrome.h"
#include "nsIWebProtocolHandlerRegistrar.h" #include "nsIWebProtocolHandlerRegistrar.h"
#include "nsIXULBrowserWindow.h" #include "nsIXULBrowserWindow.h"
#include "nsIXULWindow.h" #include "nsIAppWindow.h"
#include "nsViewManager.h" #include "nsViewManager.h"
#include "nsVariant.h" #include "nsVariant.h"
#include "nsIWidget.h" #include "nsIWidget.h"
@@ -410,7 +410,7 @@ nsIXULBrowserWindow* BrowserParent::GetXULBrowserWindow() {
return nullptr; return nullptr;
} }
nsCOMPtr<nsIXULWindow> window = do_GetInterface(treeOwner); nsCOMPtr<nsIAppWindow> window = do_GetInterface(treeOwner);
if (!window) { if (!window) {
return nullptr; return nullptr;
} }
@@ -798,9 +798,9 @@ mozilla::ipc::IPCResult BrowserParent::RecvSizeShellTo(
height = mDimensions.height; height = mDimensions.height;
} }
nsCOMPtr<nsIXULWindow> xulWin(do_GetInterface(treeOwner)); nsCOMPtr<nsIAppWindow> appWin(do_GetInterface(treeOwner));
NS_ENSURE_TRUE(xulWin, IPC_OK()); NS_ENSURE_TRUE(appWin, IPC_OK());
xulWin->SizeShellToWithLimit(width, height, aShellItemWidth, appWin->SizeShellToWithLimit(width, height, aShellItemWidth,
aShellItemHeight); aShellItemHeight);
return IPC_OK(); return IPC_OK();

View File

@@ -178,7 +178,7 @@
#include "nsIURIFixup.h" #include "nsIURIFixup.h"
#include "nsIURL.h" #include "nsIURL.h"
#include "nsIDocShellTreeOwner.h" #include "nsIDocShellTreeOwner.h"
#include "nsIXULWindow.h" #include "nsIAppWindow.h"
#include "nsIDOMChromeWindow.h" #include "nsIDOMChromeWindow.h"
#include "nsIWindowWatcher.h" #include "nsIWindowWatcher.h"
#include "nsPIWindowWatcher.h" #include "nsPIWindowWatcher.h"

View File

@@ -2692,7 +2692,7 @@ static void CheckForDisabledWindows() {
if (!wm) return; if (!wm) return;
nsCOMPtr<nsISimpleEnumerator> windowList; nsCOMPtr<nsISimpleEnumerator> windowList;
wm->GetXULWindowEnumerator(nullptr, getter_AddRefs(windowList)); wm->GetAppWindowEnumerator(nullptr, getter_AddRefs(windowList));
if (!windowList) return; if (!windowList) return;
bool haveWindows; bool haveWindows;

View File

@@ -13,7 +13,7 @@
# include "nsIStringEnumerator.h" # include "nsIStringEnumerator.h"
#endif #endif
#include "nsIXULWindow.h" #include "nsIAppWindow.h"
namespace mozilla { namespace mozilla {
namespace dom { namespace dom {
@@ -25,12 +25,12 @@ static bool IsRootElement(Element* aElement) {
static bool ShouldPersistAttribute(Element* aElement, nsAtom* aAttribute) { static bool ShouldPersistAttribute(Element* aElement, nsAtom* aAttribute) {
if (IsRootElement(aElement)) { if (IsRootElement(aElement)) {
// This is not an element of the top document, its owner is // This is not an element of the top document, its owner is
// not an nsXULWindow. Persist it. // not an AppWindow. Persist it.
if (aElement->OwnerDoc()->GetInProcessParentDocument()) { if (aElement->OwnerDoc()->GetInProcessParentDocument()) {
return true; return true;
} }
// The following attributes of xul:window should be handled in // The following attributes of xul:window should be handled in
// nsXULWindow::SavePersistentAttributes instead of here. // AppWindow::SavePersistentAttributes instead of here.
if (aAttribute == nsGkAtoms::screenX || aAttribute == nsGkAtoms::screenY || if (aAttribute == nsGkAtoms::screenX || aAttribute == nsGkAtoms::screenY ||
aAttribute == nsGkAtoms::width || aAttribute == nsGkAtoms::height || aAttribute == nsGkAtoms::width || aAttribute == nsGkAtoms::height ||
aAttribute == nsGkAtoms::sizemode) { aAttribute == nsGkAtoms::sizemode) {
@@ -66,7 +66,7 @@ void XULPersist::AttributeChanged(dom::Element* aElement, int32_t aNameSpaceID,
// //
// XXX Namespace handling broken :-( // XXX Namespace handling broken :-(
nsAutoString persist; nsAutoString persist;
// Persistence of attributes of xul:window is handled in nsXULWindow. // Persistence of attributes of xul:window is handled in AppWindow.
if (aElement->GetAttr(kNameSpaceID_None, nsGkAtoms::persist, persist) && if (aElement->GetAttr(kNameSpaceID_None, nsGkAtoms::persist, persist) &&
ShouldPersistAttribute(aElement, aAttribute) && !persist.IsEmpty() && ShouldPersistAttribute(aElement, aAttribute) && !persist.IsEmpty() &&
// XXXldb This should check that it's a token, not just a substring. // XXXldb This should check that it's a token, not just a substring.
@@ -135,10 +135,10 @@ void XULPersist::Persist(Element* aElement, int32_t aNameSpaceID,
return; return;
} }
// Persisting attributes to top level windows is handled by nsXULWindow. // Persisting attributes to top level windows is handled by AppWindow.
if (IsRootElement(aElement)) { if (IsRootElement(aElement)) {
if (nsCOMPtr<nsIXULWindow> win = if (nsCOMPtr<nsIAppWindow> win =
mDocument->GetXULWindowIfToplevelChrome()) { mDocument->GetAppWindowIfToplevelChrome()) {
return; return;
} }
} }
@@ -300,10 +300,10 @@ nsresult XULPersist::ApplyPersistentAttributesToElements(
} }
// Applying persistent attributes to top level windows is handled // Applying persistent attributes to top level windows is handled
// by nsXULWindow. // by AppWindow.
if (IsRootElement(element)) { if (IsRootElement(element)) {
if (nsCOMPtr<nsIXULWindow> win = if (nsCOMPtr<nsIAppWindow> win =
mDocument->GetXULWindowIfToplevelChrome()) { mDocument->GetAppWindowIfToplevelChrome()) {
continue; continue;
} }
} }

View File

@@ -13,7 +13,7 @@ this.damp = class extends ExtensionAPI {
damp: { damp: {
startTest() { startTest() {
let { rootURI } = context.extension; let { rootURI } = context.extension;
let window = context.xulWindow; let window = context.appWindow;
if (!("Damp" in window)) { if (!("Damp" in window)) {
let script = rootURI.resolve("content/damp.js"); let script = rootURI.resolve("content/damp.js");
Services.scriptloader.loadSubScript(script, window); Services.scriptloader.loadSubScript(script, window);

View File

@@ -55,7 +55,7 @@ async function startTest(context) {
Cu.forceGC(); Cu.forceGC();
Cu.forceCC(); Cu.forceCC();
Cu.forceShrinkingGC(); Cu.forceShrinkingGC();
let win = context.xulWindow; let win = context.appWindow;
await openDelay(win); await openDelay(win);
let mozAfterPaint = waitForBrowserPaint(); let mozAfterPaint = waitForBrowserPaint();

View File

@@ -1079,7 +1079,7 @@ nsWebBrowser::SetParentNativeWindow(nativeWindow aParentNativeWindow) {
NS_IMETHODIMP NS_IMETHODIMP
nsWebBrowser::GetNativeHandle(nsAString& aNativeHandle) { nsWebBrowser::GetNativeHandle(nsAString& aNativeHandle) {
// the nativeHandle should be accessed from nsIXULWindow // the nativeHandle should be accessed from nsIAppWindow
return NS_ERROR_NOT_IMPLEMENTED; return NS_ERROR_NOT_IMPLEMENTED;
} }

View File

@@ -808,14 +808,14 @@ class ExtensionPageContextParent extends ProxyContextParent {
} }
// The window that contains this context. This may change due to moving tabs. // The window that contains this context. This may change due to moving tabs.
get xulWindow() { get appWindow() {
let win = this.xulBrowser.ownerGlobal; let win = this.xulBrowser.ownerGlobal;
return win.docShell.rootTreeItem.domWindow; return win.docShell.rootTreeItem.domWindow;
} }
get currentWindow() { get currentWindow() {
if (this.viewType !== "background") { if (this.viewType !== "background") {
return this.xulWindow; return this.appWindow;
} }
} }

View File

@@ -843,14 +843,14 @@ class WindowBase {
} }
/** /**
* @property {nsIXULWindow} xulWindow * @property {nsIAppWindow} appWindow
* The nsIXULWindow object for this browser window. * The nsIAppWindow object for this browser window.
* @readonly * @readonly
*/ */
get xulWindow() { get appWindow() {
return this.window.docShell.treeOwner return this.window.docShell.treeOwner
.QueryInterface(Ci.nsIInterfaceRequestor) .QueryInterface(Ci.nsIInterfaceRequestor)
.getInterface(Ci.nsIXULWindow); .getInterface(Ci.nsIAppWindow);
} }
/** /**
@@ -876,7 +876,7 @@ class WindowBase {
* @readonly * @readonly
*/ */
get type() { get type() {
let { chromeFlags } = this.xulWindow; let { chromeFlags } = this.appWindow;
if (chromeFlags & Ci.nsIWebBrowserChrome.CHROME_OPENAS_DIALOG) { if (chromeFlags & Ci.nsIWebBrowserChrome.CHROME_OPENAS_DIALOG) {
return "popup"; return "popup";

View File

@@ -11,7 +11,7 @@
#include "nsIDocShell.h" #include "nsIDocShell.h"
#include "nsIDocShellTreeOwner.h" #include "nsIDocShellTreeOwner.h"
#include "nsIInterfaceRequestorUtils.h" #include "nsIInterfaceRequestorUtils.h"
#include "nsIXULWindow.h" #include "nsIAppWindow.h"
#include "nsXPCOM.h" #include "nsXPCOM.h"
#include "nsISupportsPrimitives.h" #include "nsISupportsPrimitives.h"
#include "nsIComponentManager.h" #include "nsIComponentManager.h"
@@ -75,8 +75,8 @@ NS_IMETHODIMP nsPrintProgress::OpenProgressDialog(
nsCOMPtr<nsIDocShellTreeOwner> owner; nsCOMPtr<nsIDocShellTreeOwner> owner;
docShell->GetTreeOwner(getter_AddRefs(owner)); docShell->GetTreeOwner(getter_AddRefs(owner));
nsCOMPtr<nsIXULWindow> ownerXULWindow = do_GetInterface(owner); nsCOMPtr<nsIAppWindow> ownerAppWindow = do_GetInterface(owner);
nsCOMPtr<mozIDOMWindowProxy> ownerWindow = do_GetInterface(ownerXULWindow); nsCOMPtr<mozIDOMWindowProxy> ownerWindow = do_GetInterface(ownerAppWindow);
NS_ENSURE_STATE(ownerWindow); NS_ENSURE_STATE(ownerWindow);
nsCOMPtr<nsPIDOMWindowOuter> piOwnerWindow = nsCOMPtr<nsPIDOMWindowOuter> piOwnerWindow =

View File

@@ -138,7 +138,7 @@ function getPromptState(ui) {
// We can't just check window.opener because that'll be // We can't just check window.opener because that'll be
// a content window, which therefore isn't exposed (it'll lie and // a content window, which therefore isn't exposed (it'll lie and
// be null). // be null).
let flags = treeOwner.getInterface(Ci.nsIXULWindow).chromeFlags; let flags = treeOwner.getInterface(Ci.nsIAppWindow).chromeFlags;
state.chrome = (flags & Ci.nsIWebBrowserChrome.CHROME_OPENAS_CHROME) != 0; state.chrome = (flags & Ci.nsIWebBrowserChrome.CHROME_OPENAS_CHROME) != 0;
state.dialog = (flags & Ci.nsIWebBrowserChrome.CHROME_OPENAS_DIALOG) != 0; state.dialog = (flags & Ci.nsIWebBrowserChrome.CHROME_OPENAS_DIALOG) != 0;
state.chromeDependent = state.chromeDependent =

View File

@@ -17,7 +17,7 @@
#include "nsIPrefService.h" #include "nsIPrefService.h"
#include "nsIPrefBranch.h" #include "nsIPrefBranch.h"
#include "nsITimer.h" #include "nsITimer.h"
#include "nsIXULWindow.h" #include "nsIAppWindow.h"
#include "nsIWebProgress.h" #include "nsIWebProgress.h"
#include "nsPresContext.h" #include "nsPresContext.h"
#include "nsPrintfCString.h" #include "nsPrintfCString.h"
@@ -666,7 +666,7 @@ bool TabListener::UpdateSessionStore(uint32_t aFlushId, bool aIsFinal) {
if (!treeOwner) { if (!treeOwner) {
return false; return false;
} }
nsCOMPtr<nsIXULWindow> window(do_GetInterface(treeOwner)); nsCOMPtr<nsIAppWindow> window(do_GetInterface(treeOwner));
if (!window) { if (!window) {
return false; return false;
} }

View File

@@ -21,7 +21,7 @@
#include "nsIWindowMediator.h" #include "nsIWindowMediator.h"
#include "nsIWindowWatcher.h" #include "nsIWindowWatcher.h"
#include "nsIXULRuntime.h" #include "nsIXULRuntime.h"
#include "nsIXULWindow.h" #include "nsIAppWindow.h"
#include "nsNativeCharsetUtils.h" #include "nsNativeCharsetUtils.h"
#include "nsThreadUtils.h" #include "nsThreadUtils.h"
#include "nsAutoPtr.h" #include "nsAutoPtr.h"
@@ -318,7 +318,7 @@ nsAppStartup::Quit(uint32_t aMode) {
bool usefulHiddenWindow; bool usefulHiddenWindow;
appShell->GetApplicationProvidedHiddenWindow(&usefulHiddenWindow); appShell->GetApplicationProvidedHiddenWindow(&usefulHiddenWindow);
nsCOMPtr<nsIXULWindow> hiddenWindow; nsCOMPtr<nsIAppWindow> hiddenWindow;
appShell->GetHiddenWindow(getter_AddRefs(hiddenWindow)); appShell->GetHiddenWindow(getter_AddRefs(hiddenWindow));
// If the remaining windows are useful, we won't quit: // If the remaining windows are useful, we won't quit:
if (!hiddenWindow || usefulHiddenWindow) { if (!hiddenWindow || usefulHiddenWindow) {
@@ -597,16 +597,16 @@ nsAppStartup::CreateChromeWindow(nsIWebBrowserChrome* aParent,
return NS_ERROR_FAILURE; return NS_ERROR_FAILURE;
} }
nsCOMPtr<nsIXULWindow> newWindow; nsCOMPtr<nsIAppWindow> newWindow;
if (aParent) { if (aParent) {
nsCOMPtr<nsIXULWindow> xulParent(do_GetInterface(aParent)); nsCOMPtr<nsIAppWindow> appParent(do_GetInterface(aParent));
NS_ASSERTION(xulParent, NS_ASSERTION(appParent,
"window created using non-XUL parent. that's unexpected, but " "window created using non-app parent. that's unexpected, but "
"may work."); "may work.");
if (xulParent) if (appParent)
xulParent->CreateNewWindow(aChromeFlags, aOpeningTab, aOpener, appParent->CreateNewWindow(aChromeFlags, aOpeningTab, aOpener,
aNextRemoteTabId, getter_AddRefs(newWindow)); aNextRemoteTabId, 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).

View File

@@ -71,7 +71,7 @@
#include "mozilla/dom/BrowserHost.h" #include "mozilla/dom/BrowserHost.h"
#include "mozilla/dom/DocGroup.h" #include "mozilla/dom/DocGroup.h"
#include "mozilla/dom/TabGroup.h" #include "mozilla/dom/TabGroup.h"
#include "nsIXULWindow.h" #include "nsIAppWindow.h"
#include "nsIXULBrowserWindow.h" #include "nsIXULBrowserWindow.h"
#include "nsGlobalWindow.h" #include "nsGlobalWindow.h"
#include "ReferrerInfo.h" #include "ReferrerInfo.h"
@@ -911,17 +911,17 @@ nsresult nsWindowWatcher::OpenWindowInternal(
} }
if (newChrome) { if (newChrome) {
nsCOMPtr<nsIXULWindow> xulWin = do_GetInterface(newChrome); nsCOMPtr<nsIAppWindow> appWin = do_GetInterface(newChrome);
if (xulWin) { if (appWin) {
nsCOMPtr<nsIXULBrowserWindow> xulBrowserWin; nsCOMPtr<nsIXULBrowserWindow> xulBrowserWin;
xulWin->GetXULBrowserWindow(getter_AddRefs(xulBrowserWin)); appWin->GetXULBrowserWindow(getter_AddRefs(xulBrowserWin));
if (xulBrowserWin) { if (xulBrowserWin) {
nsPIDOMWindowOuter* openerWindow = nsPIDOMWindowOuter* openerWindow =
aForceNoOpener ? nullptr : parentWindow.get(); aForceNoOpener ? nullptr : parentWindow.get();
xulBrowserWin->ForceInitialBrowserNonRemote(openerWindow); xulBrowserWin->ForceInitialBrowserNonRemote(openerWindow);
} }
} }
/* It might be a chrome nsXULWindow, in which case it won't have /* It might be a chrome AppWindow, in which case it won't have
an nsIDOMWindow (primary content shell). But in that case, it'll an nsIDOMWindow (primary content shell). But in that case, it'll
be able to hand over an nsIDocShellTreeItem directly. */ be able to hand over an nsIDocShellTreeItem directly. */
nsCOMPtr<nsPIDOMWindowOuter> newWindow(do_GetInterface(newChrome)); nsCOMPtr<nsPIDOMWindowOuter> newWindow(do_GetInterface(newChrome));
@@ -2372,9 +2372,9 @@ void nsWindowWatcher::SizeOpenedWindow(nsIDocShellTreeOwner* aTreeOwner,
} }
if (aIsCallerChrome) { if (aIsCallerChrome) {
nsCOMPtr<nsIXULWindow> xulWin = do_GetInterface(treeOwnerAsWin); nsCOMPtr<nsIAppWindow> appWin = do_GetInterface(treeOwnerAsWin);
if (xulWin && aSizeSpec.mLockAspectRatio) { if (appWin && aSizeSpec.mLockAspectRatio) {
xulWin->LockAspectRatio(true); appWin->LockAspectRatio(true);
} }
} }

View File

@@ -152,7 +152,7 @@ registerCleanupFunction(() => {
function getParentChromeFlags(win) { function getParentChromeFlags(win) {
return win.docShell.treeOwner return win.docShell.treeOwner
.QueryInterface(Ci.nsIInterfaceRequestor) .QueryInterface(Ci.nsIInterfaceRequestor)
.getInterface(Ci.nsIXULWindow).chromeFlags; .getInterface(Ci.nsIAppWindow).chromeFlags;
} }
/** /**

View File

@@ -20,7 +20,7 @@ function assertFlags(win) {
let loadContext = docShell.QueryInterface(Ci.nsILoadContext); let loadContext = docShell.QueryInterface(Ci.nsILoadContext);
let chromeFlags = docShell.treeOwner let chromeFlags = docShell.treeOwner
.QueryInterface(Ci.nsIInterfaceRequestor) .QueryInterface(Ci.nsIInterfaceRequestor)
.getInterface(Ci.nsIXULWindow).chromeFlags; .getInterface(Ci.nsIAppWindow).chromeFlags;
Assert.ok( Assert.ok(
loadContext.useRemoteTabs, loadContext.useRemoteTabs,
"Should be using remote tabs on the load context" "Should be using remote tabs on the load context"

View File

@@ -20,7 +20,7 @@ Tests the alwaysOnTop window feature for the Windows OS.
let docShell = win.docShell; let docShell = win.docShell;
let chromeFlags = docShell.treeOwner let chromeFlags = docShell.treeOwner
.QueryInterface(Ci.nsIInterfaceRequestor) .QueryInterface(Ci.nsIInterfaceRequestor)
.getInterface(Ci.nsIXULWindow) .getInterface(Ci.nsIAppWindow)
.chromeFlags; .chromeFlags;
let hasFlag = !!(chromeFlags & Ci.nsIWebBrowserChrome.CHROME_ALWAYS_ON_TOP); let hasFlag = !!(chromeFlags & Ci.nsIWebBrowserChrome.CHROME_ALWAYS_ON_TOP);
is(hasFlag, expected, "Window should have CHROME_ALWAYS_ON_TOP flag."); is(hasFlag, expected, "Window should have CHROME_ALWAYS_ON_TOP flag.");

View File

@@ -20,7 +20,7 @@ that is opened reports itself as being modal.
BrowserTestUtils.domWindowOpened().then((win) => { BrowserTestUtils.domWindowOpened().then((win) => {
let treeOwner = win.docShell.treeOwner; let treeOwner = win.docShell.treeOwner;
let chromeFlags = treeOwner.QueryInterface(Ci.nsIInterfaceRequestor) let chromeFlags = treeOwner.QueryInterface(Ci.nsIInterfaceRequestor)
.getInterface(Ci.nsIXULWindow) .getInterface(Ci.nsIAppWindow)
.chromeFlags; .chromeFlags;
ok(chromeFlags & Ci.nsIWebBrowserChrome.CHROME_MODAL, ok(chromeFlags & Ci.nsIWebBrowserChrome.CHROME_MODAL,
"Should have the modal chrome flag"); "Should have the modal chrome flag");

View File

@@ -56,7 +56,7 @@ const XULStore = {
const value = node.getAttribute(attr); const value = node.getAttribute(attr);
if (node.localName == "window") { if (node.localName == "window") {
log("Persisting attributes to windows is handled by nsXULWindow."); log("Persisting attributes to windows is handled by AppWindow.");
return; return;
} }

View File

@@ -142,7 +142,7 @@ XULStore.prototype = {
const value = node.getAttribute(attr); const value = node.getAttribute(attr);
if (node.localName == "window") { if (node.localName == "window") {
this.log("Persisting attributes to windows is handled by nsXULWindow."); this.log("Persisting attributes to windows is handled by AppWindow.");
return; return;
} }

View File

@@ -66,7 +66,7 @@
window.docShell window.docShell
.treeOwner .treeOwner
.QueryInterface(Ci.nsIInterfaceRequestor) .QueryInterface(Ci.nsIInterfaceRequestor)
.getInterface(Ci.nsIXULWindow) .getInterface(Ci.nsIAppWindow)
.XULBrowserWindow = gXULBrowserWindow; .XULBrowserWindow = gXULBrowserWindow;
gFindBar = document.getElementById("FindToolbar"); gFindBar = document.getElementById("FindToolbar");

View File

@@ -746,7 +746,7 @@
try { try {
this._xulBrowserWindow = window.docShell.treeOwner this._xulBrowserWindow = window.docShell.treeOwner
.QueryInterface(Ci.nsIInterfaceRequestor) .QueryInterface(Ci.nsIInterfaceRequestor)
.getInterface(Ci.nsIXULWindow).XULBrowserWindow; .getInterface(Ci.nsIAppWindow).XULBrowserWindow;
} catch (ex) {} } catch (ex) {}
if (!this._xulBrowserWindow) { if (!this._xulBrowserWindow) {
return false; return false;

View File

@@ -44,8 +44,6 @@
* "soft" shutdown, passwords are flushed. * "soft" shutdown, passwords are flushed.
*/ */
interface nsIXULWindow;
[scriptable, uuid(5fdf8480-1f98-11d4-8077-00600811a9c3)] [scriptable, uuid(5fdf8480-1f98-11d4-8077-00600811a9c3)]
interface nsINativeAppSupport : nsISupports { interface nsINativeAppSupport : nsISupports {
// Startup/shutdown. // Startup/shutdown.

View File

@@ -280,7 +280,7 @@ nsNativeAppSupportCocoa::ReOpen() {
return NS_ERROR_FAILURE; return NS_ERROR_FAILURE;
} else { } else {
nsCOMPtr<nsISimpleEnumerator> windowList; nsCOMPtr<nsISimpleEnumerator> windowList;
wm->GetXULWindowEnumerator(nullptr, getter_AddRefs(windowList)); wm->GetAppWindowEnumerator(nullptr, getter_AddRefs(windowList));
bool more; bool more;
windowList->HasMoreElements(&more); windowList->HasMoreElements(&more);
while (more) { while (more) {

View File

@@ -50,7 +50,7 @@ using mozilla::dom::ContentParent;
#include "nsISupportsPrimitives.h" #include "nsISupportsPrimitives.h"
#include "nsIWidgetListener.h" #include "nsIWidgetListener.h"
#include "nsIWindowWatcher.h" #include "nsIWindowWatcher.h"
#include "nsIXULWindow.h" #include "nsIAppWindow.h"
#include "nsAppShell.h" #include "nsAppShell.h"
#include "nsFocusManager.h" #include "nsFocusManager.h"
@@ -1315,11 +1315,11 @@ void nsWindow::GeckoViewSupport::Open(
aInitData); aInitData);
if (window->mWidgetListener) { if (window->mWidgetListener) {
nsCOMPtr<nsIXULWindow> xulWindow(window->mWidgetListener->GetXULWindow()); nsCOMPtr<nsIAppWindow> appWindow(window->mWidgetListener->GetAppWindow());
if (xulWindow) { if (appWindow) {
// Our window is not intrinsically sized, so tell nsXULWindow to // Our window is not intrinsically sized, so tell AppWindow to
// not set a size for us. // not set a size for us.
xulWindow->SetIntrinsicallySized(false); appWindow->SetIntrinsicallySized(false);
} }
} }
} }

View File

@@ -523,7 +523,7 @@ class nsChildView final : public nsBaseWidget {
NSView<mozView>* GetEditorView(); NSView<mozView>* GetEditorView();
nsCocoaWindow* GetXULWindowWidget() const; nsCocoaWindow* GetAppWindowWidget() const;
virtual void ReparentNativeWidget(nsIWidget* aNewParent) override; virtual void ReparentNativeWidget(nsIWidget* aNewParent) override;

View File

@@ -492,7 +492,7 @@ void nsChildView::TearDownView() {
NS_OBJC_END_TRY_ABORT_BLOCK; NS_OBJC_END_TRY_ABORT_BLOCK;
} }
nsCocoaWindow* nsChildView::GetXULWindowWidget() const { nsCocoaWindow* nsChildView::GetAppWindowWidget() const {
id windowDelegate = [[mView window] delegate]; id windowDelegate = [[mView window] delegate];
if (windowDelegate && [windowDelegate isKindOfClass:[WindowDelegate class]]) { if (windowDelegate && [windowDelegate isKindOfClass:[WindowDelegate class]]) {
return [(WindowDelegate*)windowDelegate geckoWidget]; return [(WindowDelegate*)windowDelegate geckoWidget];
@@ -594,7 +594,7 @@ void* nsChildView::GetNativeData(uint32_t aDataType) {
nsTransparencyMode nsChildView::GetTransparencyMode() { nsTransparencyMode nsChildView::GetTransparencyMode() {
NS_OBJC_BEGIN_TRY_ABORT_BLOCK_RETURN; NS_OBJC_BEGIN_TRY_ABORT_BLOCK_RETURN;
nsCocoaWindow* windowWidget = GetXULWindowWidget(); nsCocoaWindow* windowWidget = GetAppWindowWidget();
return windowWidget ? windowWidget->GetTransparencyMode() : eTransparencyOpaque; return windowWidget ? windowWidget->GetTransparencyMode() : eTransparencyOpaque;
NS_OBJC_END_TRY_ABORT_BLOCK_RETURN(eTransparencyOpaque); NS_OBJC_END_TRY_ABORT_BLOCK_RETURN(eTransparencyOpaque);
@@ -605,7 +605,7 @@ nsTransparencyMode nsChildView::GetTransparencyMode() {
void nsChildView::SetTransparencyMode(nsTransparencyMode aMode) { void nsChildView::SetTransparencyMode(nsTransparencyMode aMode) {
NS_OBJC_BEGIN_TRY_ABORT_BLOCK; NS_OBJC_BEGIN_TRY_ABORT_BLOCK;
nsCocoaWindow* windowWidget = GetXULWindowWidget(); nsCocoaWindow* windowWidget = GetAppWindowWidget();
if (windowWidget) { if (windowWidget) {
windowWidget->SetTransparencyMode(aMode); windowWidget->SetTransparencyMode(aMode);
} }
@@ -616,7 +616,7 @@ void nsChildView::SetTransparencyMode(nsTransparencyMode aMode) {
} }
void nsChildView::SuppressAnimation(bool aSuppress) { void nsChildView::SuppressAnimation(bool aSuppress) {
GetXULWindowWidget()->SuppressAnimation(aSuppress); GetAppWindowWidget()->SuppressAnimation(aSuppress);
} }
bool nsChildView::IsVisible() const { bool nsChildView::IsVisible() const {
@@ -626,7 +626,7 @@ bool nsChildView::IsVisible() const {
return mVisible; return mVisible;
} }
if (!GetXULWindowWidget()->IsVisible()) { if (!GetAppWindowWidget()->IsVisible()) {
return false; return false;
} }
@@ -833,7 +833,7 @@ void nsChildView::BackingScaleFactorChanged() {
mNativeLayerRoot->SetBackingScale(mBackingScaleFactor); mNativeLayerRoot->SetBackingScale(mBackingScaleFactor);
} }
if (mWidgetListener && !mWidgetListener->GetXULWindow()) { if (mWidgetListener && !mWidgetListener->GetAppWindow()) {
if (PresShell* presShell = mWidgetListener->GetPresShell()) { if (PresShell* presShell = mWidgetListener->GetPresShell()) {
presShell->BackingScaleFactorChanged(); presShell->BackingScaleFactorChanged();
} }
@@ -1167,7 +1167,7 @@ static NSMenuItem* NativeMenuItemWithLocation(NSMenu* menubar, NSString* locatio
bool nsChildView::SendEventToNativeMenuSystem(NSEvent* aEvent) { bool nsChildView::SendEventToNativeMenuSystem(NSEvent* aEvent) {
bool handled = false; bool handled = false;
nsCocoaWindow* widget = GetXULWindowWidget(); nsCocoaWindow* widget = GetAppWindowWidget();
if (widget) { if (widget) {
nsMenuBarX* mb = widget->GetMenuBar(); nsMenuBarX* mb = widget->GetMenuBar();
if (mb) { if (mb) {
@@ -1232,7 +1232,7 @@ nsresult nsChildView::ActivateNativeMenuItemAt(const nsAString& indexString) {
nsresult nsChildView::ForceUpdateNativeMenuAt(const nsAString& indexString) { nsresult nsChildView::ForceUpdateNativeMenuAt(const nsAString& indexString) {
NS_OBJC_BEGIN_TRY_ABORT_BLOCK_NSRESULT; NS_OBJC_BEGIN_TRY_ABORT_BLOCK_NSRESULT;
nsCocoaWindow* widget = GetXULWindowWidget(); nsCocoaWindow* widget = GetAppWindowWidget();
if (widget) { if (widget) {
nsMenuBarX* mb = widget->GetMenuBar(); nsMenuBarX* mb = widget->GetMenuBar();
if (mb) { if (mb) {
@@ -1912,7 +1912,7 @@ void nsChildView::PrepareWindowEffects() {
mIsCoveringTitlebar = [mView isCoveringTitlebar]; mIsCoveringTitlebar = [mView isCoveringTitlebar];
NSInteger styleMask = [[mView window] styleMask]; NSInteger styleMask = [[mView window] styleMask];
bool wasFullscreen = mIsFullscreen; bool wasFullscreen = mIsFullscreen;
nsCocoaWindow* windowWidget = GetXULWindowWidget(); nsCocoaWindow* windowWidget = GetAppWindowWidget();
mIsFullscreen = mIsFullscreen =
(styleMask & NSFullScreenWindowMask) || (windowWidget && windowWidget->InFullScreenMode()); (styleMask & NSFullScreenWindowMask) || (windowWidget && windowWidget->InFullScreenMode());
@@ -3438,7 +3438,7 @@ NSEvent* gLastDragMouseDownEvent = nil; // [strong]
} }
- (void)viewWillStartLiveResize { - (void)viewWillStartLiveResize {
nsCocoaWindow* windowWidget = mGeckoChild ? mGeckoChild->GetXULWindowWidget() : nullptr; nsCocoaWindow* windowWidget = mGeckoChild ? mGeckoChild->GetAppWindowWidget() : nullptr;
if (windowWidget) { if (windowWidget) {
windowWidget->NotifyLiveResizeStarted(); windowWidget->NotifyLiveResizeStarted();
} }
@@ -3451,7 +3451,7 @@ NSEvent* gLastDragMouseDownEvent = nil; // [strong]
// is null here, that might be problematic because we might get stuck with // is null here, that might be problematic because we might get stuck with
// a content process that has the displayport suppressed. If that scenario // a content process that has the displayport suppressed. If that scenario
// arises (I'm not sure that it does) we will need to handle it gracefully. // arises (I'm not sure that it does) we will need to handle it gracefully.
nsCocoaWindow* windowWidget = mGeckoChild ? mGeckoChild->GetXULWindowWidget() : nullptr; nsCocoaWindow* windowWidget = mGeckoChild ? mGeckoChild->GetAppWindowWidget() : nullptr;
if (windowWidget) { if (windowWidget) {
windowWidget->NotifyLiveResizeStopped(); windowWidget->NotifyLiveResizeStopped();
} }

View File

@@ -22,7 +22,7 @@
#include "nsIAppShellService.h" #include "nsIAppShellService.h"
#include "nsIOSPermissionRequest.h" #include "nsIOSPermissionRequest.h"
#include "nsIRunnable.h" #include "nsIRunnable.h"
#include "nsIXULWindow.h" #include "nsIAppWindow.h"
#include "nsIBaseWindow.h" #include "nsIBaseWindow.h"
#include "nsIServiceManager.h" #include "nsIServiceManager.h"
#include "nsMenuUtilsX.h" #include "nsMenuUtilsX.h"
@@ -274,7 +274,7 @@ nsIWidget* nsCocoaUtils::GetHiddenWindowWidget() {
return nullptr; return nullptr;
} }
nsCOMPtr<nsIXULWindow> hiddenWindow; nsCOMPtr<nsIAppWindow> hiddenWindow;
appShell->GetHiddenWindow(getter_AddRefs(hiddenWindow)); appShell->GetHiddenWindow(getter_AddRefs(hiddenWindow));
if (!hiddenWindow) { if (!hiddenWindow) {
// Don't warn, this happens during shutdown, bug 358607. // Don't warn, this happens during shutdown, bug 358607.
@@ -284,7 +284,7 @@ nsIWidget* nsCocoaUtils::GetHiddenWindowWidget() {
nsCOMPtr<nsIBaseWindow> baseHiddenWindow; nsCOMPtr<nsIBaseWindow> baseHiddenWindow;
baseHiddenWindow = do_GetInterface(hiddenWindow); baseHiddenWindow = do_GetInterface(hiddenWindow);
if (!baseHiddenWindow) { if (!baseHiddenWindow) {
NS_WARNING("Couldn't get nsIBaseWindow from hidden window (nsIXULWindow)"); NS_WARNING("Couldn't get nsIBaseWindow from hidden window (nsIAppWindow)");
return nullptr; return nullptr;
} }

View File

@@ -19,7 +19,7 @@
#include "nsIAppShellService.h" #include "nsIAppShellService.h"
#include "nsIBaseWindow.h" #include "nsIBaseWindow.h"
#include "nsIInterfaceRequestorUtils.h" #include "nsIInterfaceRequestorUtils.h"
#include "nsIXULWindow.h" #include "nsIAppWindow.h"
#include "nsToolkit.h" #include "nsToolkit.h"
#include "nsTouchBarNativeAPIDefines.h" #include "nsTouchBarNativeAPIDefines.h"
#include "nsPIDOMWindow.h" #include "nsPIDOMWindow.h"
@@ -665,7 +665,7 @@ void nsCocoaWindow::SetModal(bool aState) {
// appears over behave as they should. We can't rely on native methods to // appears over behave as they should. We can't rely on native methods to
// do this, for the following reason: The OS runs modal non-sheet windows // do this, for the following reason: The OS runs modal non-sheet windows
// in an event loop (using [NSApplication runModalForWindow:] or similar // in an event loop (using [NSApplication runModalForWindow:] or similar
// methods) that's incompatible with the modal event loop in nsXULWindow:: // methods) that's incompatible with the modal event loop in AppWindow::
// ShowModal() (each of these event loops is "exclusive", and can't run at // ShowModal() (each of these event loops is "exclusive", and can't run at
// the same time as other (similar) event loops). // the same time as other (similar) event loops).
if (mWindowType != eWindowType_sheet) { if (mWindowType != eWindowType_sheet) {
@@ -1655,7 +1655,7 @@ void nsCocoaWindow::BackingScaleFactorChanged() {
mBackingScaleFactor = newScale; mBackingScaleFactor = newScale;
if (!mWidgetListener || mWidgetListener->GetXULWindow()) { if (!mWidgetListener || mWidgetListener->GetAppWindow()) {
return; return;
} }

View File

@@ -34,7 +34,7 @@
#include "ClientLayerManager.h" #include "ClientLayerManager.h"
#include "mozilla/layers/Compositor.h" #include "mozilla/layers/Compositor.h"
#include "nsIXULRuntime.h" #include "nsIXULRuntime.h"
#include "nsIXULWindow.h" #include "nsIAppWindow.h"
#include "nsIBaseWindow.h" #include "nsIBaseWindow.h"
#include "nsXULPopupManager.h" #include "nsXULPopupManager.h"
#include "nsIWidgetListener.h" #include "nsIWidgetListener.h"
@@ -1642,10 +1642,10 @@ nsIRollupListener* nsBaseWidget::GetActiveRollupListener() {
void nsBaseWidget::NotifyWindowDestroyed() { void nsBaseWidget::NotifyWindowDestroyed() {
if (!mWidgetListener) return; if (!mWidgetListener) return;
nsCOMPtr<nsIXULWindow> window = mWidgetListener->GetXULWindow(); nsCOMPtr<nsIAppWindow> window = mWidgetListener->GetAppWindow();
nsCOMPtr<nsIBaseWindow> xulWindow(do_QueryInterface(window)); nsCOMPtr<nsIBaseWindow> appWindow(do_QueryInterface(window));
if (xulWindow) { if (appWindow) {
xulWindow->Destroy(); appWindow->Destroy();
} }
} }
@@ -2028,11 +2028,11 @@ void nsBaseWidget::NotifyLiveResizeStarted() {
if (!mWidgetListener) { if (!mWidgetListener) {
return; return;
} }
nsCOMPtr<nsIXULWindow> xulWindow = mWidgetListener->GetXULWindow(); nsCOMPtr<nsIAppWindow> appWindow = mWidgetListener->GetAppWindow();
if (!xulWindow) { if (!appWindow) {
return; return;
} }
mLiveResizeListeners = xulWindow->GetLiveResizeListeners(); mLiveResizeListeners = appWindow->GetLiveResizeListeners();
for (uint32_t i = 0; i < mLiveResizeListeners.Length(); i++) { for (uint32_t i = 0; i < mLiveResizeListeners.Length(); i++) {
mLiveResizeListeners[i]->LiveResizeStarted(); mLiveResizeListeners[i]->LiveResizeStarted();
} }

View File

@@ -8,14 +8,14 @@
#include "nsRegion.h" #include "nsRegion.h"
#include "nsView.h" #include "nsView.h"
#include "nsIWidget.h" #include "nsIWidget.h"
#include "nsIXULWindow.h" #include "nsIAppWindow.h"
#include "mozilla/BasicEvents.h" #include "mozilla/BasicEvents.h"
#include "mozilla/PresShell.h" #include "mozilla/PresShell.h"
using namespace mozilla; using namespace mozilla;
nsIXULWindow* nsIWidgetListener::GetXULWindow() { return nullptr; } nsIAppWindow* nsIWidgetListener::GetAppWindow() { return nullptr; }
nsView* nsIWidgetListener::GetView() { return nullptr; } nsView* nsIWidgetListener::GetView() { return nullptr; }

View File

@@ -16,7 +16,7 @@
class nsView; class nsView;
class nsIWidget; class nsIWidget;
class nsIXULWindow; class nsIAppWindow;
namespace mozilla { namespace mozilla {
class PresShell; class PresShell;
@@ -45,11 +45,11 @@ enum nsWindowZ {
class nsIWidgetListener { class nsIWidgetListener {
public: public:
/** /**
* If this listener is for an nsIXULWindow, return it. If this is null, then * If this listener is for an nsIAppWindow, return it. If this is null, then
* this is likely a listener for a view, which can be determined using * this is likely a listener for a view, which can be determined using
* GetView. If both methods return null, this will be an nsWebBrowser. * GetView. If both methods return null, this will be an nsWebBrowser.
*/ */
virtual nsIXULWindow* GetXULWindow(); virtual nsIAppWindow* GetAppWindow();
/** /**
* If this listener is for an nsView, return it. * If this listener is for an nsView, return it.

View File

@@ -16,7 +16,7 @@
#include "nsIRunnable.h" #include "nsIRunnable.h"
#include "nsIURI.h" #include "nsIURI.h"
#include "nsIWebBrowserChrome.h" #include "nsIWebBrowserChrome.h"
#include "nsIXULWindow.h" #include "nsIAppWindow.h"
#include "nsAppShellCID.h" #include "nsAppShellCID.h"
#include "nsIInterfaceRequestorUtils.h" #include "nsIInterfaceRequestorUtils.h"
@@ -361,14 +361,14 @@ bool Test4Internal(nsIAppShell* aAppShell) {
uint32_t flags = nsIWebBrowserChrome::CHROME_DEFAULT; uint32_t flags = nsIWebBrowserChrome::CHROME_DEFAULT;
nsCOMPtr<nsIXULWindow> xulWindow; nsCOMPtr<nsIAppWindow> appWindow;
if (NS_FAILED(appService->CreateTopLevelWindow( if (NS_FAILED(appService->CreateTopLevelWindow(
nullptr, uri, flags, 100, 100, nullptr, getter_AddRefs(xulWindow)))) { nullptr, uri, flags, 100, 100, nullptr, getter_AddRefs(appWindow)))) {
fail("Failed to create new window"); fail("Failed to create new window");
return false; return false;
} }
nsCOMPtr<nsIDOMWindow> window = do_GetInterface(xulWindow); nsCOMPtr<nsIDOMWindow> window = do_GetInterface(appWindow);
if (!window) { if (!window) {
fail("Can't get dom window!"); fail("Can't get dom window!");
return false; return false;

View File

@@ -20,7 +20,7 @@
#include "nsIDocShell.h" #include "nsIDocShell.h"
#include "nsISupportsImpl.h" #include "nsISupportsImpl.h"
#include "nsIWidget.h" #include "nsIWidget.h"
#include "nsIXULWindow.h" #include "nsIAppWindow.h"
#include "nsServiceManagerUtils.h" #include "nsServiceManagerUtils.h"
#include "nsThreadUtils.h" #include "nsThreadUtils.h"
#include "nsWindowDefs.h" #include "nsWindowDefs.h"
@@ -42,7 +42,7 @@ class HWNDGetter : public mozilla::Runnable {
// Jump through some hoops to locate the hidden window. // Jump through some hoops to locate the hidden window.
nsCOMPtr<nsIAppShellService> appShell( nsCOMPtr<nsIAppShellService> appShell(
do_GetService(NS_APPSHELLSERVICE_CONTRACTID)); do_GetService(NS_APPSHELLSERVICE_CONTRACTID));
nsCOMPtr<nsIXULWindow> hiddenWindow; nsCOMPtr<nsIAppWindow> hiddenWindow;
nsresult rv = appShell->GetHiddenWindow(getter_AddRefs(hiddenWindow)); nsresult rv = appShell->GetHiddenWindow(getter_AddRefs(hiddenWindow));
if (NS_FAILED(rv)) { if (NS_FAILED(rv)) {

View File

@@ -16,7 +16,6 @@
#include "nsIDocShell.h" #include "nsIDocShell.h"
#include "nsIAppShellService.h" #include "nsIAppShellService.h"
#include "nsAppShellCID.h" #include "nsAppShellCID.h"
#include "nsIXULWindow.h"
#include "mozilla/Services.h" #include "mozilla/Services.h"
#include "mozilla/WidgetUtils.h" #include "mozilla/WidgetUtils.h"
#include "mozilla/WindowsVersion.h" #include "mozilla/WindowsVersion.h"

File diff suppressed because it is too large Load Diff

View File

@@ -4,8 +4,8 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this * License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
#ifndef nsXULWindow_h__ #ifndef mozilla_AppWindow_h__
#define nsXULWindow_h__ #define mozilla_AppWindow_h__
// Local Includes // Local Includes
#include "nsChromeTreeOwner.h" #include "nsChromeTreeOwner.h"
@@ -27,7 +27,7 @@
#include "nsIDocShellTreeItem.h" #include "nsIDocShellTreeItem.h"
#include "nsIInterfaceRequestor.h" #include "nsIInterfaceRequestor.h"
#include "nsIInterfaceRequestorUtils.h" #include "nsIInterfaceRequestorUtils.h"
#include "nsIXULWindow.h" #include "nsIAppWindow.h"
#include "nsIPrompt.h" #include "nsIPrompt.h"
#include "nsIAuthPrompt.h" #include "nsIAuthPrompt.h"
#include "nsIXULBrowserWindow.h" #include "nsIXULBrowserWindow.h"
@@ -52,12 +52,12 @@ struct nsWidgetInitData;
namespace mozilla { namespace mozilla {
class PresShell; class PresShell;
class nsXULWindowTimerCallback; class AppWindowTimerCallback;
} // namespace mozilla } // namespace mozilla
// nsXULWindow // AppWindow
#define NS_XULWINDOW_IMPL_CID \ #define NS_APPWINDOW_IMPL_CID \
{ /* 8eaec2f3-ed02-4be2-8e0f-342798477298 */ \ { /* 8eaec2f3-ed02-4be2-8e0f-342798477298 */ \
0x8eaec2f3, 0xed02, 0x4be2, { \ 0x8eaec2f3, 0xed02, 0x4be2, { \
0x8e, 0x0f, 0x34, 0x27, 0x98, 0x47, 0x72, 0x98 \ 0x8e, 0x0f, 0x34, 0x27, 0x98, 0x47, 0x72, 0x98 \
@@ -66,25 +66,27 @@ class nsXULWindowTimerCallback;
class nsContentShellInfo; class nsContentShellInfo;
class nsXULWindow final : public nsIBaseWindow, namespace mozilla {
public nsIInterfaceRequestor,
public nsIXULWindow, class AppWindow final : public nsIBaseWindow,
public nsSupportsWeakReference, public nsIInterfaceRequestor,
public nsIWebProgressListener { public nsIAppWindow,
friend class nsChromeTreeOwner; public nsSupportsWeakReference,
friend class nsContentTreeOwner; public nsIWebProgressListener {
friend class ::nsChromeTreeOwner;
friend class ::nsContentTreeOwner;
public: public:
// The implementation of non-refcounted nsIWidgetListener, which would hold a // The implementation of non-refcounted nsIWidgetListener, which would hold a
// strong reference on stack before calling nsXULWindow's // strong reference on stack before calling AppWindow's
// MOZ_CAN_RUN_SCRIPT methods. // MOZ_CAN_RUN_SCRIPT methods.
class WidgetListenerDelegate : public nsIWidgetListener { class WidgetListenerDelegate : public nsIWidgetListener {
public: public:
explicit WidgetListenerDelegate(nsXULWindow* aXULWindow) explicit WidgetListenerDelegate(AppWindow* aAppWindow)
: mXULWindow(aXULWindow) {} : mAppWindow(aAppWindow) {}
MOZ_CAN_RUN_SCRIPT_BOUNDARY MOZ_CAN_RUN_SCRIPT_BOUNDARY
virtual nsIXULWindow* GetXULWindow() override; virtual nsIAppWindow* GetAppWindow() override;
MOZ_CAN_RUN_SCRIPT_BOUNDARY MOZ_CAN_RUN_SCRIPT_BOUNDARY
virtual mozilla::PresShell* GetPresShell() override; virtual mozilla::PresShell* GetPresShell() override;
MOZ_CAN_RUN_SCRIPT_BOUNDARY MOZ_CAN_RUN_SCRIPT_BOUNDARY
@@ -116,26 +118,26 @@ class nsXULWindow final : public nsIBaseWindow,
virtual void WindowDeactivated() override; virtual void WindowDeactivated() override;
private: private:
// The lifetime of WidgetListenerDelegate is bound to nsXULWindow so // The lifetime of WidgetListenerDelegate is bound to AppWindow so
// we just use a raw pointer here. // we just use a raw pointer here.
nsXULWindow* mXULWindow; AppWindow* mAppWindow;
}; };
NS_DECL_THREADSAFE_ISUPPORTS NS_DECL_THREADSAFE_ISUPPORTS
NS_DECL_NSIINTERFACEREQUESTOR NS_DECL_NSIINTERFACEREQUESTOR
NS_DECL_NSIXULWINDOW NS_DECL_NSIAPPWINDOW
NS_DECL_NSIBASEWINDOW NS_DECL_NSIBASEWINDOW
NS_DECLARE_STATIC_IID_ACCESSOR(NS_XULWINDOW_IMPL_CID) NS_DECLARE_STATIC_IID_ACCESSOR(NS_APPWINDOW_IMPL_CID)
void LockUntilChromeLoad() { mLockedUntilChromeLoad = true; } void LockUntilChromeLoad() { mLockedUntilChromeLoad = true; }
bool IsLocked() const { return mLockedUntilChromeLoad; } bool IsLocked() const { return mLockedUntilChromeLoad; }
void IgnoreXULSizeMode(bool aEnable) { mIgnoreXULSizeMode = aEnable; } void IgnoreXULSizeMode(bool aEnable) { mIgnoreXULSizeMode = aEnable; }
void WasRegistered() { mRegistered = true; } void WasRegistered() { mRegistered = true; }
// nsXULWindow methods... // AppWindow methods...
nsresult Initialize(nsIXULWindow* aParent, nsIXULWindow* aOpener, nsresult Initialize(nsIAppWindow* aParent, nsIAppWindow* aOpener,
nsIURI* aUrl, int32_t aInitialWidth, nsIURI* aUrl, int32_t aInitialWidth,
int32_t aInitialHeight, bool aIsHiddenWindow, int32_t aInitialHeight, bool aIsHiddenWindow,
nsIRemoteTab* aOpeningTab, nsIRemoteTab* aOpeningTab,
@@ -148,7 +150,7 @@ class nsXULWindow final : public nsIBaseWindow,
NS_DECL_NSIWEBPROGRESSLISTENER NS_DECL_NSIWEBPROGRESSLISTENER
// nsIWidgetListener methods for WidgetListenerDelegate. // nsIWidgetListener methods for WidgetListenerDelegate.
nsIXULWindow* GetXULWindow() { return this; } nsIAppWindow* GetAppWindow() { return this; }
mozilla::PresShell* GetPresShell(); mozilla::PresShell* GetPresShell();
MOZ_CAN_RUN_SCRIPT MOZ_CAN_RUN_SCRIPT
bool WindowMoved(nsIWidget* aWidget, int32_t aX, int32_t aY); bool WindowMoved(nsIWidget* aWidget, int32_t aX, int32_t aY);
@@ -167,7 +169,7 @@ class nsXULWindow final : public nsIBaseWindow,
MOZ_CAN_RUN_SCRIPT void WindowActivated(); MOZ_CAN_RUN_SCRIPT void WindowActivated();
MOZ_CAN_RUN_SCRIPT void WindowDeactivated(); MOZ_CAN_RUN_SCRIPT void WindowDeactivated();
explicit nsXULWindow(uint32_t aChromeFlags); explicit AppWindow(uint32_t aChromeFlags);
protected: protected:
enum persistentAttributes { enum persistentAttributes {
@@ -176,9 +178,9 @@ class nsXULWindow final : public nsIBaseWindow,
PAD_SIZE = 0x4 PAD_SIZE = 0x4
}; };
virtual ~nsXULWindow(); virtual ~AppWindow();
friend class mozilla::nsXULWindowTimerCallback; friend class mozilla::AppWindowTimerCallback;
bool ExecuteCloseHandler(); bool ExecuteCloseHandler();
void ConstrainToOpenerScreen(int32_t* aX, int32_t* aY); void ConstrainToOpenerScreen(int32_t* aX, int32_t* aY);
@@ -227,19 +229,19 @@ class nsXULWindow final : public nsIBaseWindow,
NS_IMETHOD CreateNewChromeWindow(int32_t aChromeFlags, NS_IMETHOD CreateNewChromeWindow(int32_t aChromeFlags,
nsIRemoteTab* aOpeningTab, nsIRemoteTab* aOpeningTab,
mozIDOMWindowProxy* aOpenerWindow, mozIDOMWindowProxy* aOpenerWindow,
nsIXULWindow** _retval); nsIAppWindow** _retval);
NS_IMETHOD CreateNewContentWindow(int32_t aChromeFlags, NS_IMETHOD CreateNewContentWindow(int32_t aChromeFlags,
nsIRemoteTab* aOpeningTab, nsIRemoteTab* aOpeningTab,
mozIDOMWindowProxy* aOpenerWindow, mozIDOMWindowProxy* aOpenerWindow,
uint64_t aNextRemoteTabId, uint64_t aNextRemoteTabId,
nsIXULWindow** _retval); nsIAppWindow** _retval);
NS_IMETHOD GetHasPrimaryContent(bool* aResult); NS_IMETHOD GetHasPrimaryContent(bool* aResult);
void EnableParent(bool aEnable); void EnableParent(bool aEnable);
bool ConstrainToZLevel(bool aImmediate, nsWindowZ* aPlacement, bool ConstrainToZLevel(bool aImmediate, nsWindowZ* aPlacement,
nsIWidget* aReqBelow, nsIWidget** aActualBelow); nsIWidget* aReqBelow, nsIWidget** aActualBelow);
void PlaceWindowLayersBehind(uint32_t aLowLevel, uint32_t aHighLevel, void PlaceWindowLayersBehind(uint32_t aLowLevel, uint32_t aHighLevel,
nsIXULWindow* aBehind); nsIAppWindow* aBehind);
void SetContentScrollbarVisibility(bool aVisible); void SetContentScrollbarVisibility(bool aVisible);
bool GetContentScrollbarVisibility(); bool GetContentScrollbarVisibility();
void PersistentAttributesDirty(uint32_t aDirtyFlags); void PersistentAttributesDirty(uint32_t aDirtyFlags);
@@ -304,5 +306,8 @@ class nsXULWindow final : public nsIBaseWindow,
#endif #endif
}; };
NS_DEFINE_STATIC_IID_ACCESSOR(nsXULWindow, NS_XULWINDOW_IMPL_CID) NS_DEFINE_STATIC_IID_ACCESSOR(AppWindow, NS_APPWINDOW_IMPL_CID)
#endif /* nsXULWindow_h__ */
} // namespace mozilla
#endif /* mozilla_AppWindow_h__ */

View File

@@ -11,11 +11,11 @@ MOCHITEST_CHROME_MANIFESTS += ['test/chrome.ini']
XPIDL_SOURCES += [ XPIDL_SOURCES += [
'nsIAppShellService.idl', 'nsIAppShellService.idl',
'nsIAppWindow.idl',
'nsIWindowlessBrowser.idl', 'nsIWindowlessBrowser.idl',
'nsIWindowMediator.idl', 'nsIWindowMediator.idl',
'nsIWindowMediatorListener.idl', 'nsIWindowMediatorListener.idl',
'nsIXULBrowserWindow.idl', 'nsIXULBrowserWindow.idl',
'nsIXULWindow.idl',
] ]
XPIDL_MODULE = 'appshell' XPIDL_MODULE = 'appshell'
@@ -26,12 +26,12 @@ EXPORTS += [
] ]
UNIFIED_SOURCES += [ UNIFIED_SOURCES += [
'AppWindow.cpp',
'nsAppShellService.cpp', 'nsAppShellService.cpp',
'nsAppShellWindowEnumerator.cpp', 'nsAppShellWindowEnumerator.cpp',
'nsChromeTreeOwner.cpp', 'nsChromeTreeOwner.cpp',
'nsContentTreeOwner.cpp', 'nsContentTreeOwner.cpp',
'nsWindowMediator.cpp', 'nsWindowMediator.cpp',
'nsXULWindow.cpp',
] ]
XPCOM_MANIFESTS += [ XPCOM_MANIFESTS += [

View File

@@ -17,7 +17,7 @@
#include "nsIWindowWatcher.h" #include "nsIWindowWatcher.h"
#include "nsPIWindowWatcher.h" #include "nsPIWindowWatcher.h"
#include "nsPIDOMWindow.h" #include "nsPIDOMWindow.h"
#include "nsXULWindow.h" #include "AppWindow.h"
#include "nsWidgetInitData.h" #include "nsWidgetInitData.h"
#include "nsWidgetsCID.h" #include "nsWidgetsCID.h"
@@ -133,7 +133,7 @@ nsAppShellService::CreateHiddenWindow() {
rv = NS_NewURI(getter_AddRefs(url), hiddenWindowURL); rv = NS_NewURI(getter_AddRefs(url), hiddenWindowURL);
NS_ENSURE_SUCCESS(rv, rv); NS_ENSURE_SUCCESS(rv, rv);
RefPtr<nsXULWindow> newWindow; RefPtr<AppWindow> newWindow;
rv = rv =
JustCreateTopWindow(nullptr, url, chromeMask, initialWidth, initialHeight, JustCreateTopWindow(nullptr, url, chromeMask, initialWidth, initialHeight,
true, nullptr, nullptr, getter_AddRefs(newWindow)); true, nullptr, nullptr, getter_AddRefs(newWindow));
@@ -166,16 +166,16 @@ nsAppShellService::DestroyHiddenWindow() {
*/ */
NS_IMETHODIMP NS_IMETHODIMP
nsAppShellService::CreateTopLevelWindow( nsAppShellService::CreateTopLevelWindow(
nsIXULWindow* aParent, nsIURI* aUrl, uint32_t aChromeMask, nsIAppWindow* aParent, nsIURI* aUrl, uint32_t aChromeMask,
int32_t aInitialWidth, int32_t aInitialHeight, nsIRemoteTab* aOpeningTab, int32_t aInitialWidth, int32_t aInitialHeight, nsIRemoteTab* aOpeningTab,
mozIDOMWindowProxy* aOpenerWindow, nsIXULWindow** aResult) mozIDOMWindowProxy* aOpenerWindow, nsIAppWindow** aResult)
{ {
nsresult rv; nsresult rv;
StartupTimeline::RecordOnce(StartupTimeline::CREATE_TOP_LEVEL_WINDOW); StartupTimeline::RecordOnce(StartupTimeline::CREATE_TOP_LEVEL_WINDOW);
RefPtr<nsXULWindow> newWindow; RefPtr<AppWindow> newWindow;
rv = JustCreateTopWindow(aParent, aUrl, aChromeMask, aInitialWidth, rv = JustCreateTopWindow(aParent, aUrl, aChromeMask, aInitialWidth,
aInitialHeight, false, aOpeningTab, aOpenerWindow, aInitialHeight, false, aOpeningTab, aOpenerWindow,
getter_AddRefs(newWindow)); getter_AddRefs(newWindow));
@@ -184,7 +184,7 @@ nsAppShellService::CreateTopLevelWindow(
if (NS_SUCCEEDED(rv)) { if (NS_SUCCEEDED(rv)) {
// the addref resulting from this is the owning addref for this window // the addref resulting from this is the owning addref for this window
RegisterTopLevelWindow(*aResult); RegisterTopLevelWindow(*aResult);
nsCOMPtr<nsIXULWindow> parent; nsCOMPtr<nsIAppWindow> parent;
if (aChromeMask & nsIWebBrowserChrome::CHROME_DEPENDENT) parent = aParent; if (aChromeMask & nsIWebBrowserChrome::CHROME_DEPENDENT) parent = aParent;
(*aResult)->SetZLevel(CalculateWindowZLevel(parent, aChromeMask)); (*aResult)->SetZLevel(CalculateWindowZLevel(parent, aChromeMask));
} }
@@ -485,15 +485,15 @@ nsAppShellService::CreateWindowlessBrowser(bool aIsChrome,
return NS_OK; return NS_OK;
} }
uint32_t nsAppShellService::CalculateWindowZLevel(nsIXULWindow* aParent, uint32_t nsAppShellService::CalculateWindowZLevel(nsIAppWindow* aParent,
uint32_t aChromeMask) { uint32_t aChromeMask) {
uint32_t zLevel; uint32_t zLevel;
zLevel = nsIXULWindow::normalZ; zLevel = nsIAppWindow::normalZ;
if (aChromeMask & nsIWebBrowserChrome::CHROME_WINDOW_RAISED) if (aChromeMask & nsIWebBrowserChrome::CHROME_WINDOW_RAISED)
zLevel = nsIXULWindow::raisedZ; zLevel = nsIAppWindow::raisedZ;
else if (aChromeMask & nsIWebBrowserChrome::CHROME_WINDOW_LOWERED) else if (aChromeMask & nsIWebBrowserChrome::CHROME_WINDOW_LOWERED)
zLevel = nsIXULWindow::loweredZ; zLevel = nsIAppWindow::loweredZ;
#ifdef XP_MACOSX #ifdef XP_MACOSX
/* Platforms on which modal windows are always application-modal, not /* Platforms on which modal windows are always application-modal, not
@@ -528,7 +528,7 @@ static bool CheckForFullscreenWindow() {
if (!wm) return false; if (!wm) return false;
nsCOMPtr<nsISimpleEnumerator> windowList; nsCOMPtr<nsISimpleEnumerator> windowList;
wm->GetXULWindowEnumerator(nullptr, getter_AddRefs(windowList)); wm->GetAppWindowEnumerator(nullptr, getter_AddRefs(windowList));
if (!windowList) return false; if (!windowList) return false;
for (;;) { for (;;) {
@@ -555,17 +555,17 @@ static bool CheckForFullscreenWindow() {
* Just do the window-making part of CreateTopLevelWindow * Just do the window-making part of CreateTopLevelWindow
*/ */
nsresult nsAppShellService::JustCreateTopWindow( nsresult nsAppShellService::JustCreateTopWindow(
nsIXULWindow* aParent, nsIURI* aUrl, uint32_t aChromeMask, nsIAppWindow* aParent, nsIURI* aUrl, uint32_t aChromeMask,
int32_t aInitialWidth, int32_t aInitialHeight, bool aIsHiddenWindow, int32_t aInitialWidth, int32_t aInitialHeight, bool aIsHiddenWindow,
nsIRemoteTab* aOpeningTab, mozIDOMWindowProxy* aOpenerWindow, nsIRemoteTab* aOpeningTab, mozIDOMWindowProxy* aOpenerWindow,
nsXULWindow** aResult) { AppWindow** aResult) {
*aResult = nullptr; *aResult = nullptr;
NS_ENSURE_STATE(!mXPCOMWillShutDown); NS_ENSURE_STATE(!mXPCOMWillShutDown);
nsCOMPtr<nsIXULWindow> parent; nsCOMPtr<nsIAppWindow> parent;
if (aChromeMask & nsIWebBrowserChrome::CHROME_DEPENDENT) parent = aParent; if (aChromeMask & nsIWebBrowserChrome::CHROME_DEPENDENT) parent = aParent;
RefPtr<nsXULWindow> window = new nsXULWindow(aChromeMask); RefPtr<AppWindow> window = new AppWindow(aChromeMask);
#ifdef XP_WIN #ifdef XP_WIN
// If the parent is currently fullscreen, tell the child to ignore persisted // If the parent is currently fullscreen, tell the child to ignore persisted
@@ -737,7 +737,7 @@ nsresult nsAppShellService::JustCreateTopWindow(
} }
NS_IMETHODIMP NS_IMETHODIMP
nsAppShellService::GetHiddenWindow(nsIXULWindow** aWindow) { nsAppShellService::GetHiddenWindow(nsIAppWindow** aWindow) {
NS_ENSURE_ARG_POINTER(aWindow); NS_ENSURE_ARG_POINTER(aWindow);
EnsureHiddenWindow(); EnsureHiddenWindow();
@@ -784,7 +784,7 @@ nsAppShellService::GetApplicationProvidedHiddenWindow(bool* aAPHW) {
* Register a new top level window (created elsewhere) * Register a new top level window (created elsewhere)
*/ */
NS_IMETHODIMP NS_IMETHODIMP
nsAppShellService::RegisterTopLevelWindow(nsIXULWindow* aWindow) { nsAppShellService::RegisterTopLevelWindow(nsIAppWindow* aWindow) {
NS_ENSURE_ARG_POINTER(aWindow); NS_ENSURE_ARG_POINTER(aWindow);
nsCOMPtr<nsIDocShell> docShell; nsCOMPtr<nsIDocShell> docShell;
@@ -816,15 +816,15 @@ nsAppShellService::RegisterTopLevelWindow(nsIXULWindow* aWindow) {
if (obssvc) { if (obssvc) {
obssvc->NotifyObservers(aWindow, "xul-window-registered", nullptr); obssvc->NotifyObservers(aWindow, "xul-window-registered", nullptr);
nsXULWindow* xulWindow = static_cast<nsXULWindow*>(aWindow); AppWindow* appWindow = static_cast<AppWindow*>(aWindow);
xulWindow->WasRegistered(); appWindow->WasRegistered();
} }
return NS_OK; return NS_OK;
} }
NS_IMETHODIMP NS_IMETHODIMP
nsAppShellService::UnregisterTopLevelWindow(nsIXULWindow* aWindow) { nsAppShellService::UnregisterTopLevelWindow(nsIAppWindow* aWindow) {
if (mXPCOMShuttingDown) { if (mXPCOMShuttingDown) {
/* return an error code in order to: /* return an error code in order to:
- avoid doing anything with other member variables while we are in - avoid doing anything with other member variables while we are in

View File

@@ -10,7 +10,7 @@
#include "nsIObserver.h" #include "nsIObserver.h"
// Interfaces Needed // Interfaces Needed
#include "nsXULWindow.h" #include "AppWindow.h"
#include "nsStringFwd.h" #include "nsStringFwd.h"
#include "nsAutoPtr.h" #include "nsAutoPtr.h"
#include "nsIRemoteTab.h" #include "nsIRemoteTab.h"
@@ -37,15 +37,15 @@ class nsAppShellService final : public nsIAppShellService, public nsIObserver {
void EnsureHiddenWindow(); void EnsureHiddenWindow();
nsresult JustCreateTopWindow(nsIXULWindow* aParent, nsIURI* aUrl, nsresult JustCreateTopWindow(nsIAppWindow* aParent, nsIURI* aUrl,
uint32_t aChromeMask, int32_t aInitialWidth, uint32_t aChromeMask, int32_t aInitialWidth,
int32_t aInitialHeight, bool aIsHiddenWindow, int32_t aInitialHeight, bool aIsHiddenWindow,
nsIRemoteTab* aOpeningTab, nsIRemoteTab* aOpeningTab,
mozIDOMWindowProxy* aOpenerWindow, mozIDOMWindowProxy* aOpenerWindow,
nsXULWindow** aResult); mozilla::AppWindow** aResult);
uint32_t CalculateWindowZLevel(nsIXULWindow* aParent, uint32_t aChromeMask); uint32_t CalculateWindowZLevel(nsIAppWindow* aParent, uint32_t aChromeMask);
RefPtr<nsXULWindow> mHiddenWindow; RefPtr<mozilla::AppWindow> mHiddenWindow;
bool mXPCOMWillShutDown; bool mXPCOMWillShutDown;
bool mXPCOMShuttingDown; bool mXPCOMShuttingDown;
uint16_t mModalWindowCount; uint16_t mModalWindowCount;

View File

@@ -11,7 +11,7 @@
#include "nsIFactory.h" #include "nsIFactory.h"
#include "nsIInterfaceRequestor.h" #include "nsIInterfaceRequestor.h"
#include "nsIInterfaceRequestorUtils.h" #include "nsIInterfaceRequestorUtils.h"
#include "nsIXULWindow.h" #include "nsIAppWindow.h"
#include "mozilla/dom/Element.h" #include "mozilla/dom/Element.h"
#include "nsWindowMediator.h" #include "nsWindowMediator.h"
@@ -23,9 +23,9 @@ using mozilla::dom::Element;
// static helper functions // static helper functions
// //
static void GetAttribute(nsIXULWindow* inWindow, const nsAString& inAttribute, static void GetAttribute(nsIAppWindow* inWindow, const nsAString& inAttribute,
nsAString& outValue); nsAString& outValue);
static void GetWindowType(nsIXULWindow* inWindow, nsString& outType); static void GetWindowType(nsIAppWindow* inWindow, nsString& outType);
static Element* GetElementFromDocShell(nsIDocShell* aShell) { static Element* GetElementFromDocShell(nsIDocShell* aShell) {
nsCOMPtr<nsIContentViewer> cv; nsCOMPtr<nsIContentViewer> cv;
@@ -41,7 +41,7 @@ static Element* GetElementFromDocShell(nsIDocShell* aShell) {
} }
// generic "retrieve the value of a XUL attribute" function // generic "retrieve the value of a XUL attribute" function
void GetAttribute(nsIXULWindow* inWindow, const nsAString& inAttribute, void GetAttribute(nsIAppWindow* inWindow, const nsAString& inAttribute,
nsAString& outValue) { nsAString& outValue) {
nsCOMPtr<nsIDocShell> shell; nsCOMPtr<nsIDocShell> shell;
if (inWindow && NS_SUCCEEDED(inWindow->GetDocShell(getter_AddRefs(shell)))) { if (inWindow && NS_SUCCEEDED(inWindow->GetDocShell(getter_AddRefs(shell)))) {
@@ -54,7 +54,7 @@ void GetAttribute(nsIXULWindow* inWindow, const nsAString& inAttribute,
// retrieve the window type, stored as the value of a particular // retrieve the window type, stored as the value of a particular
// attribute in its XUL window tag // attribute in its XUL window tag
void GetWindowType(nsIXULWindow* aWindow, nsString& outType) { void GetWindowType(nsIAppWindow* aWindow, nsString& outType) {
GetAttribute(aWindow, NS_LITERAL_STRING("windowtype"), outType); GetAttribute(aWindow, NS_LITERAL_STRING("windowtype"), outType);
} }
@@ -62,10 +62,10 @@ void GetWindowType(nsIXULWindow* aWindow, nsString& outType) {
// nsWindowInfo // nsWindowInfo
// //
nsWindowInfo::nsWindowInfo(nsIXULWindow* inWindow, int32_t inTimeStamp) nsWindowInfo::nsWindowInfo(nsIAppWindow* inWindow, int32_t inTimeStamp)
: mWindow(inWindow), : mWindow(inWindow),
mTimeStamp(inTimeStamp), mTimeStamp(inTimeStamp),
mZLevel(nsIXULWindow::normalZ) { mZLevel(nsIAppWindow::normalZ) {
ReferenceSelf(true, true); ReferenceSelf(true, true);
} }
@@ -187,16 +187,16 @@ NS_IMETHODIMP nsASDOMWindowEnumerator::GetNext(nsISupports** retval) {
} }
// //
// nsASXULWindowEnumerator // nsASAppWindowEnumerator
// //
nsASXULWindowEnumerator::nsASXULWindowEnumerator(const char16_t* aTypeString, nsASAppWindowEnumerator::nsASAppWindowEnumerator(const char16_t* aTypeString,
nsWindowMediator& aMediator) nsWindowMediator& aMediator)
: nsAppShellWindowEnumerator(aTypeString, aMediator) {} : nsAppShellWindowEnumerator(aTypeString, aMediator) {}
nsASXULWindowEnumerator::~nsASXULWindowEnumerator() {} nsASAppWindowEnumerator::~nsASAppWindowEnumerator() {}
NS_IMETHODIMP nsASXULWindowEnumerator::GetNext(nsISupports** retval) { NS_IMETHODIMP nsASAppWindowEnumerator::GetNext(nsISupports** retval) {
if (!retval) return NS_ERROR_INVALID_ARG; if (!retval) return NS_ERROR_INVALID_ARG;
*retval = nullptr; *retval = nullptr;
@@ -225,7 +225,7 @@ nsWindowInfo* nsASDOMWindowEarlyToLateEnumerator::FindNext() {
nsWindowInfo *info, *listEnd; nsWindowInfo *info, *listEnd;
bool allWindows = mType.IsEmpty(); bool allWindows = mType.IsEmpty();
// see nsXULWindowEarlyToLateEnumerator::FindNext // see AppWindowEarlyToLateEnumerator::FindNext
if (!mCurrentPosition) return nullptr; if (!mCurrentPosition) return nullptr;
info = mCurrentPosition->mYounger; info = mCurrentPosition->mYounger;
@@ -240,19 +240,19 @@ nsWindowInfo* nsASDOMWindowEarlyToLateEnumerator::FindNext() {
} }
// //
// nsASXULWindowEarlyToLateEnumerator // nsASAppWindowEarlyToLateEnumerator
// //
nsASXULWindowEarlyToLateEnumerator::nsASXULWindowEarlyToLateEnumerator( nsASAppWindowEarlyToLateEnumerator::nsASAppWindowEarlyToLateEnumerator(
const char16_t* aTypeString, nsWindowMediator& aMediator) const char16_t* aTypeString, nsWindowMediator& aMediator)
: nsASXULWindowEnumerator(aTypeString, aMediator) { : nsASAppWindowEnumerator(aTypeString, aMediator) {
mCurrentPosition = aMediator.mOldestWindow; mCurrentPosition = aMediator.mOldestWindow;
AdjustInitialPosition(); AdjustInitialPosition();
} }
nsASXULWindowEarlyToLateEnumerator::~nsASXULWindowEarlyToLateEnumerator() {} nsASAppWindowEarlyToLateEnumerator::~nsASAppWindowEarlyToLateEnumerator() {}
nsWindowInfo* nsASXULWindowEarlyToLateEnumerator::FindNext() { nsWindowInfo* nsASAppWindowEarlyToLateEnumerator::FindNext() {
nsWindowInfo *info, *listEnd; nsWindowInfo *info, *listEnd;
bool allWindows = mType.IsEmpty(); bool allWindows = mType.IsEmpty();
@@ -277,23 +277,23 @@ nsWindowInfo* nsASXULWindowEarlyToLateEnumerator::FindNext() {
} }
// //
// nsASXULWindowFrontToBackEnumerator // nsASAppWindowFrontToBackEnumerator
// //
nsASXULWindowFrontToBackEnumerator::nsASXULWindowFrontToBackEnumerator( nsASAppWindowFrontToBackEnumerator::nsASAppWindowFrontToBackEnumerator(
const char16_t* aTypeString, nsWindowMediator& aMediator) const char16_t* aTypeString, nsWindowMediator& aMediator)
: nsASXULWindowEnumerator(aTypeString, aMediator) { : nsASAppWindowEnumerator(aTypeString, aMediator) {
mCurrentPosition = aMediator.mTopmostWindow; mCurrentPosition = aMediator.mTopmostWindow;
AdjustInitialPosition(); AdjustInitialPosition();
} }
nsASXULWindowFrontToBackEnumerator::~nsASXULWindowFrontToBackEnumerator() {} nsASAppWindowFrontToBackEnumerator::~nsASAppWindowFrontToBackEnumerator() {}
nsWindowInfo* nsASXULWindowFrontToBackEnumerator::FindNext() { nsWindowInfo* nsASAppWindowFrontToBackEnumerator::FindNext() {
nsWindowInfo *info, *listEnd; nsWindowInfo *info, *listEnd;
bool allWindows = mType.IsEmpty(); bool allWindows = mType.IsEmpty();
// see nsXULWindowEarlyToLateEnumerator::FindNext // see AppWindowEarlyToLateEnumerator::FindNext
if (!mCurrentPosition) return nullptr; if (!mCurrentPosition) return nullptr;
info = mCurrentPosition->mLower; info = mCurrentPosition->mLower;
@@ -308,24 +308,24 @@ nsWindowInfo* nsASXULWindowFrontToBackEnumerator::FindNext() {
} }
// //
// nsASXULWindowBackToFrontEnumerator // nsASAppWindowBackToFrontEnumerator
// //
nsASXULWindowBackToFrontEnumerator::nsASXULWindowBackToFrontEnumerator( nsASAppWindowBackToFrontEnumerator::nsASAppWindowBackToFrontEnumerator(
const char16_t* aTypeString, nsWindowMediator& aMediator) const char16_t* aTypeString, nsWindowMediator& aMediator)
: nsASXULWindowEnumerator(aTypeString, aMediator) { : nsASAppWindowEnumerator(aTypeString, aMediator) {
mCurrentPosition = mCurrentPosition =
aMediator.mTopmostWindow ? aMediator.mTopmostWindow->mHigher : nullptr; aMediator.mTopmostWindow ? aMediator.mTopmostWindow->mHigher : nullptr;
AdjustInitialPosition(); AdjustInitialPosition();
} }
nsASXULWindowBackToFrontEnumerator::~nsASXULWindowBackToFrontEnumerator() {} nsASAppWindowBackToFrontEnumerator::~nsASAppWindowBackToFrontEnumerator() {}
nsWindowInfo* nsASXULWindowBackToFrontEnumerator::FindNext() { nsWindowInfo* nsASAppWindowBackToFrontEnumerator::FindNext() {
nsWindowInfo *info, *listEnd; nsWindowInfo *info, *listEnd;
bool allWindows = mType.IsEmpty(); bool allWindows = mType.IsEmpty();
// see nsXULWindowEarlyToLateEnumerator::FindNext // see AppWindowEarlyToLateEnumerator::FindNext
if (!mCurrentPosition) return nullptr; if (!mCurrentPosition) return nullptr;
info = mCurrentPosition->mHigher; info = mCurrentPosition->mHigher;

View File

@@ -10,7 +10,7 @@
#include "nsString.h" #include "nsString.h"
#include "nsSimpleEnumerator.h" #include "nsSimpleEnumerator.h"
#include "nsIXULWindow.h" #include "nsIAppWindow.h"
class nsWindowMediator; class nsWindowMediator;
@@ -19,10 +19,10 @@ class nsWindowMediator;
// //
struct nsWindowInfo { struct nsWindowInfo {
nsWindowInfo(nsIXULWindow* inWindow, int32_t inTimeStamp); nsWindowInfo(nsIAppWindow* inWindow, int32_t inTimeStamp);
~nsWindowInfo(); ~nsWindowInfo();
nsCOMPtr<nsIXULWindow> mWindow; nsCOMPtr<nsIAppWindow> mWindow;
int32_t mTimeStamp; int32_t mTimeStamp;
uint32_t mZLevel; uint32_t mZLevel;
@@ -72,14 +72,14 @@ class nsASDOMWindowEnumerator : public nsAppShellWindowEnumerator {
NS_IMETHOD GetNext(nsISupports** retval) override; NS_IMETHOD GetNext(nsISupports** retval) override;
}; };
class nsASXULWindowEnumerator : public nsAppShellWindowEnumerator { class nsASAppWindowEnumerator : public nsAppShellWindowEnumerator {
public: public:
nsASXULWindowEnumerator(const char16_t* aTypeString, nsASAppWindowEnumerator(const char16_t* aTypeString,
nsWindowMediator& inMediator); nsWindowMediator& inMediator);
virtual ~nsASXULWindowEnumerator(); virtual ~nsASAppWindowEnumerator();
NS_IMETHOD GetNext(nsISupports** retval) override; NS_IMETHOD GetNext(nsISupports** retval) override;
const nsID& DefaultInterface() override { return NS_GET_IID(nsIXULWindow); } const nsID& DefaultInterface() override { return NS_GET_IID(nsIAppWindow); }
}; };
// //
@@ -97,34 +97,34 @@ class nsASDOMWindowEarlyToLateEnumerator : public nsASDOMWindowEnumerator {
virtual nsWindowInfo* FindNext() override; virtual nsWindowInfo* FindNext() override;
}; };
class nsASXULWindowEarlyToLateEnumerator : public nsASXULWindowEnumerator { class nsASAppWindowEarlyToLateEnumerator : public nsASAppWindowEnumerator {
public: public:
nsASXULWindowEarlyToLateEnumerator(const char16_t* aTypeString, nsASAppWindowEarlyToLateEnumerator(const char16_t* aTypeString,
nsWindowMediator& inMediator); nsWindowMediator& inMediator);
virtual ~nsASXULWindowEarlyToLateEnumerator(); virtual ~nsASAppWindowEarlyToLateEnumerator();
protected: protected:
virtual nsWindowInfo* FindNext() override; virtual nsWindowInfo* FindNext() override;
}; };
class nsASXULWindowFrontToBackEnumerator : public nsASXULWindowEnumerator { class nsASAppWindowFrontToBackEnumerator : public nsASAppWindowEnumerator {
public: public:
nsASXULWindowFrontToBackEnumerator(const char16_t* aTypeString, nsASAppWindowFrontToBackEnumerator(const char16_t* aTypeString,
nsWindowMediator& inMediator); nsWindowMediator& inMediator);
virtual ~nsASXULWindowFrontToBackEnumerator(); virtual ~nsASAppWindowFrontToBackEnumerator();
protected: protected:
virtual nsWindowInfo* FindNext() override; virtual nsWindowInfo* FindNext() override;
}; };
class nsASXULWindowBackToFrontEnumerator : public nsASXULWindowEnumerator { class nsASAppWindowBackToFrontEnumerator : public nsASAppWindowEnumerator {
public: public:
nsASXULWindowBackToFrontEnumerator(const char16_t* aTypeString, nsASAppWindowBackToFrontEnumerator(const char16_t* aTypeString,
nsWindowMediator& inMediator); nsWindowMediator& inMediator);
virtual ~nsASXULWindowBackToFrontEnumerator(); virtual ~nsASAppWindowBackToFrontEnumerator();
protected: protected:
virtual nsWindowInfo* FindNext() override; virtual nsWindowInfo* FindNext() override;

View File

@@ -6,7 +6,7 @@
// Local Includes // Local Includes
#include "nsChromeTreeOwner.h" #include "nsChromeTreeOwner.h"
#include "nsXULWindow.h" #include "AppWindow.h"
// Helper Classes // Helper Classes
#include "nsString.h" #include "nsString.h"
@@ -43,7 +43,7 @@ const nsLiteralString kSpace(u" ");
//*** nsChromeTreeOwner: Object Management //*** nsChromeTreeOwner: Object Management
//***************************************************************************** //*****************************************************************************
nsChromeTreeOwner::nsChromeTreeOwner() : mXULWindow(nullptr) {} nsChromeTreeOwner::nsChromeTreeOwner() : mAppWindow(nullptr) {}
nsChromeTreeOwner::~nsChromeTreeOwner() {} nsChromeTreeOwner::~nsChromeTreeOwner() {}
@@ -71,24 +71,24 @@ NS_IMETHODIMP nsChromeTreeOwner::GetInterface(const nsIID& aIID, void** aSink) {
NS_ENSURE_ARG_POINTER(aSink); NS_ENSURE_ARG_POINTER(aSink);
if (aIID.Equals(NS_GET_IID(nsIPrompt))) { if (aIID.Equals(NS_GET_IID(nsIPrompt))) {
NS_ENSURE_STATE(mXULWindow); NS_ENSURE_STATE(mAppWindow);
return mXULWindow->GetInterface(aIID, aSink); return mAppWindow->GetInterface(aIID, aSink);
} }
if (aIID.Equals(NS_GET_IID(nsIAuthPrompt))) { if (aIID.Equals(NS_GET_IID(nsIAuthPrompt))) {
NS_ENSURE_STATE(mXULWindow); NS_ENSURE_STATE(mAppWindow);
return mXULWindow->GetInterface(aIID, aSink); return mAppWindow->GetInterface(aIID, aSink);
} }
if (aIID.Equals(NS_GET_IID(nsIWebBrowserChrome))) { if (aIID.Equals(NS_GET_IID(nsIWebBrowserChrome))) {
NS_ENSURE_STATE(mXULWindow); NS_ENSURE_STATE(mAppWindow);
return mXULWindow->GetInterface(aIID, aSink); return mAppWindow->GetInterface(aIID, aSink);
} }
if (aIID.Equals(NS_GET_IID(nsIEmbeddingSiteWindow))) { if (aIID.Equals(NS_GET_IID(nsIEmbeddingSiteWindow))) {
NS_ENSURE_STATE(mXULWindow); NS_ENSURE_STATE(mAppWindow);
return mXULWindow->GetInterface(aIID, aSink); return mAppWindow->GetInterface(aIID, aSink);
} }
if (aIID.Equals(NS_GET_IID(nsIXULWindow))) { if (aIID.Equals(NS_GET_IID(nsIAppWindow))) {
NS_ENSURE_STATE(mXULWindow); NS_ENSURE_STATE(mAppWindow);
return mXULWindow->QueryInterface(aIID, aSink); return mAppWindow->QueryInterface(aIID, aSink);
} }
return QueryInterface(aIID, aSink); return QueryInterface(aIID, aSink);
@@ -101,75 +101,75 @@ NS_IMETHODIMP nsChromeTreeOwner::GetInterface(const nsIID& aIID, void** aSink) {
NS_IMETHODIMP NS_IMETHODIMP
nsChromeTreeOwner::ContentShellAdded(nsIDocShellTreeItem* aContentShell, nsChromeTreeOwner::ContentShellAdded(nsIDocShellTreeItem* aContentShell,
bool aPrimary) { bool aPrimary) {
NS_ENSURE_STATE(mXULWindow); NS_ENSURE_STATE(mAppWindow);
return mXULWindow->ContentShellAdded(aContentShell, aPrimary); return mAppWindow->ContentShellAdded(aContentShell, aPrimary);
} }
NS_IMETHODIMP NS_IMETHODIMP
nsChromeTreeOwner::ContentShellRemoved(nsIDocShellTreeItem* aContentShell) { nsChromeTreeOwner::ContentShellRemoved(nsIDocShellTreeItem* aContentShell) {
NS_ENSURE_STATE(mXULWindow); NS_ENSURE_STATE(mAppWindow);
return mXULWindow->ContentShellRemoved(aContentShell); return mAppWindow->ContentShellRemoved(aContentShell);
} }
NS_IMETHODIMP nsChromeTreeOwner::GetPrimaryContentShell( NS_IMETHODIMP nsChromeTreeOwner::GetPrimaryContentShell(
nsIDocShellTreeItem** aShell) { nsIDocShellTreeItem** aShell) {
NS_ENSURE_STATE(mXULWindow); NS_ENSURE_STATE(mAppWindow);
return mXULWindow->GetPrimaryContentShell(aShell); return mAppWindow->GetPrimaryContentShell(aShell);
} }
NS_IMETHODIMP NS_IMETHODIMP
nsChromeTreeOwner::RemoteTabAdded(nsIRemoteTab* aTab, bool aPrimary) { nsChromeTreeOwner::RemoteTabAdded(nsIRemoteTab* aTab, bool aPrimary) {
NS_ENSURE_STATE(mXULWindow); NS_ENSURE_STATE(mAppWindow);
return mXULWindow->RemoteTabAdded(aTab, aPrimary); return mAppWindow->RemoteTabAdded(aTab, aPrimary);
} }
NS_IMETHODIMP NS_IMETHODIMP
nsChromeTreeOwner::RemoteTabRemoved(nsIRemoteTab* aTab) { nsChromeTreeOwner::RemoteTabRemoved(nsIRemoteTab* aTab) {
NS_ENSURE_STATE(mXULWindow); NS_ENSURE_STATE(mAppWindow);
return mXULWindow->RemoteTabRemoved(aTab); return mAppWindow->RemoteTabRemoved(aTab);
} }
NS_IMETHODIMP NS_IMETHODIMP
nsChromeTreeOwner::GetPrimaryRemoteTab(nsIRemoteTab** aTab) { nsChromeTreeOwner::GetPrimaryRemoteTab(nsIRemoteTab** aTab) {
NS_ENSURE_STATE(mXULWindow); NS_ENSURE_STATE(mAppWindow);
return mXULWindow->GetPrimaryRemoteTab(aTab); return mAppWindow->GetPrimaryRemoteTab(aTab);
} }
NS_IMETHODIMP NS_IMETHODIMP
nsChromeTreeOwner::GetPrimaryContentSize(int32_t* aWidth, int32_t* aHeight) { nsChromeTreeOwner::GetPrimaryContentSize(int32_t* aWidth, int32_t* aHeight) {
NS_ENSURE_STATE(mXULWindow); NS_ENSURE_STATE(mAppWindow);
return mXULWindow->GetPrimaryContentSize(aWidth, aHeight); return mAppWindow->GetPrimaryContentSize(aWidth, aHeight);
} }
NS_IMETHODIMP NS_IMETHODIMP
nsChromeTreeOwner::SetPrimaryContentSize(int32_t aWidth, int32_t aHeight) { nsChromeTreeOwner::SetPrimaryContentSize(int32_t aWidth, int32_t aHeight) {
NS_ENSURE_STATE(mXULWindow); NS_ENSURE_STATE(mAppWindow);
return mXULWindow->SetPrimaryContentSize(aWidth, aHeight); return mAppWindow->SetPrimaryContentSize(aWidth, aHeight);
} }
NS_IMETHODIMP NS_IMETHODIMP
nsChromeTreeOwner::GetRootShellSize(int32_t* aWidth, int32_t* aHeight) { nsChromeTreeOwner::GetRootShellSize(int32_t* aWidth, int32_t* aHeight) {
NS_ENSURE_STATE(mXULWindow); NS_ENSURE_STATE(mAppWindow);
return mXULWindow->GetRootShellSize(aWidth, aHeight); return mAppWindow->GetRootShellSize(aWidth, aHeight);
} }
NS_IMETHODIMP NS_IMETHODIMP
nsChromeTreeOwner::SetRootShellSize(int32_t aWidth, int32_t aHeight) { nsChromeTreeOwner::SetRootShellSize(int32_t aWidth, int32_t aHeight) {
NS_ENSURE_STATE(mXULWindow); NS_ENSURE_STATE(mAppWindow);
return mXULWindow->SetRootShellSize(aWidth, aHeight); return mAppWindow->SetRootShellSize(aWidth, aHeight);
} }
NS_IMETHODIMP nsChromeTreeOwner::SizeShellTo(nsIDocShellTreeItem* aShellItem, NS_IMETHODIMP nsChromeTreeOwner::SizeShellTo(nsIDocShellTreeItem* aShellItem,
int32_t aCX, int32_t aCY) { int32_t aCX, int32_t aCY) {
NS_ENSURE_STATE(mXULWindow); NS_ENSURE_STATE(mAppWindow);
return mXULWindow->SizeShellTo(aShellItem, aCX, aCY); return mAppWindow->SizeShellTo(aShellItem, aCX, aCY);
} }
NS_IMETHODIMP NS_IMETHODIMP
nsChromeTreeOwner::SetPersistence(bool aPersistPosition, bool aPersistSize, nsChromeTreeOwner::SetPersistence(bool aPersistPosition, bool aPersistSize,
bool aPersistSizeMode) { bool aPersistSizeMode) {
NS_ENSURE_STATE(mXULWindow); NS_ENSURE_STATE(mAppWindow);
nsCOMPtr<dom::Element> docShellElement = mXULWindow->GetWindowDOMElement(); nsCOMPtr<dom::Element> docShellElement = mAppWindow->GetWindowDOMElement();
if (!docShellElement) return NS_ERROR_FAILURE; if (!docShellElement) return NS_ERROR_FAILURE;
nsAutoString persistString; nsAutoString persistString;
@@ -204,8 +204,8 @@ nsChromeTreeOwner::SetPersistence(bool aPersistPosition, bool aPersistSize,
NS_IMETHODIMP NS_IMETHODIMP
nsChromeTreeOwner::GetPersistence(bool* aPersistPosition, bool* aPersistSize, nsChromeTreeOwner::GetPersistence(bool* aPersistPosition, bool* aPersistSize,
bool* aPersistSizeMode) { bool* aPersistSizeMode) {
NS_ENSURE_STATE(mXULWindow); NS_ENSURE_STATE(mAppWindow);
nsCOMPtr<dom::Element> docShellElement = mXULWindow->GetWindowDOMElement(); nsCOMPtr<dom::Element> docShellElement = mAppWindow->GetWindowDOMElement();
if (!docShellElement) return NS_ERROR_FAILURE; if (!docShellElement) return NS_ERROR_FAILURE;
nsAutoString persistString; nsAutoString persistString;
@@ -227,8 +227,8 @@ nsChromeTreeOwner::GetPersistence(bool* aPersistPosition, bool* aPersistSize,
NS_IMETHODIMP NS_IMETHODIMP
nsChromeTreeOwner::GetTabCount(uint32_t* aResult) { nsChromeTreeOwner::GetTabCount(uint32_t* aResult) {
if (mXULWindow) { if (mAppWindow) {
return mXULWindow->GetTabCount(aResult); return mAppWindow->GetTabCount(aResult);
} }
*aResult = 0; *aResult = 0;
@@ -237,8 +237,8 @@ nsChromeTreeOwner::GetTabCount(uint32_t* aResult) {
NS_IMETHODIMP NS_IMETHODIMP
nsChromeTreeOwner::GetHasPrimaryContent(bool* aResult) { nsChromeTreeOwner::GetHasPrimaryContent(bool* aResult) {
NS_ENSURE_STATE(mXULWindow); NS_ENSURE_STATE(mAppWindow);
return mXULWindow->GetHasPrimaryContent(aResult); return mAppWindow->GetHasPrimaryContent(aResult);
} }
//***************************************************************************** //*****************************************************************************
@@ -261,69 +261,69 @@ NS_IMETHODIMP nsChromeTreeOwner::Create() {
} }
NS_IMETHODIMP nsChromeTreeOwner::Destroy() { NS_IMETHODIMP nsChromeTreeOwner::Destroy() {
NS_ENSURE_STATE(mXULWindow); NS_ENSURE_STATE(mAppWindow);
return mXULWindow->Destroy(); return mAppWindow->Destroy();
} }
NS_IMETHODIMP nsChromeTreeOwner::GetUnscaledDevicePixelsPerCSSPixel( NS_IMETHODIMP nsChromeTreeOwner::GetUnscaledDevicePixelsPerCSSPixel(
double* aScale) { double* aScale) {
NS_ENSURE_STATE(mXULWindow); NS_ENSURE_STATE(mAppWindow);
return mXULWindow->GetUnscaledDevicePixelsPerCSSPixel(aScale); return mAppWindow->GetUnscaledDevicePixelsPerCSSPixel(aScale);
} }
NS_IMETHODIMP nsChromeTreeOwner::GetDevicePixelsPerDesktopPixel( NS_IMETHODIMP nsChromeTreeOwner::GetDevicePixelsPerDesktopPixel(
double* aScale) { double* aScale) {
NS_ENSURE_STATE(mXULWindow); NS_ENSURE_STATE(mAppWindow);
return mXULWindow->GetDevicePixelsPerDesktopPixel(aScale); return mAppWindow->GetDevicePixelsPerDesktopPixel(aScale);
} }
NS_IMETHODIMP nsChromeTreeOwner::SetPositionDesktopPix(int32_t x, int32_t y) { NS_IMETHODIMP nsChromeTreeOwner::SetPositionDesktopPix(int32_t x, int32_t y) {
NS_ENSURE_STATE(mXULWindow); NS_ENSURE_STATE(mAppWindow);
return mXULWindow->SetPositionDesktopPix(x, y); return mAppWindow->SetPositionDesktopPix(x, y);
} }
NS_IMETHODIMP nsChromeTreeOwner::SetPosition(int32_t x, int32_t y) { NS_IMETHODIMP nsChromeTreeOwner::SetPosition(int32_t x, int32_t y) {
NS_ENSURE_STATE(mXULWindow); NS_ENSURE_STATE(mAppWindow);
return mXULWindow->SetPosition(x, y); return mAppWindow->SetPosition(x, y);
} }
NS_IMETHODIMP nsChromeTreeOwner::GetPosition(int32_t* x, int32_t* y) { NS_IMETHODIMP nsChromeTreeOwner::GetPosition(int32_t* x, int32_t* y) {
NS_ENSURE_STATE(mXULWindow); NS_ENSURE_STATE(mAppWindow);
return mXULWindow->GetPosition(x, y); return mAppWindow->GetPosition(x, y);
} }
NS_IMETHODIMP nsChromeTreeOwner::SetSize(int32_t cx, int32_t cy, NS_IMETHODIMP nsChromeTreeOwner::SetSize(int32_t cx, int32_t cy,
bool fRepaint) { bool fRepaint) {
NS_ENSURE_STATE(mXULWindow); NS_ENSURE_STATE(mAppWindow);
return mXULWindow->SetSize(cx, cy, fRepaint); return mAppWindow->SetSize(cx, cy, fRepaint);
} }
NS_IMETHODIMP nsChromeTreeOwner::GetSize(int32_t* cx, int32_t* cy) { NS_IMETHODIMP nsChromeTreeOwner::GetSize(int32_t* cx, int32_t* cy) {
NS_ENSURE_STATE(mXULWindow); NS_ENSURE_STATE(mAppWindow);
return mXULWindow->GetSize(cx, cy); return mAppWindow->GetSize(cx, cy);
} }
NS_IMETHODIMP nsChromeTreeOwner::SetPositionAndSize(int32_t x, int32_t y, NS_IMETHODIMP nsChromeTreeOwner::SetPositionAndSize(int32_t x, int32_t y,
int32_t cx, int32_t cy, int32_t cx, int32_t cy,
uint32_t aFlags) { uint32_t aFlags) {
NS_ENSURE_STATE(mXULWindow); NS_ENSURE_STATE(mAppWindow);
return mXULWindow->SetPositionAndSize(x, y, cx, cy, aFlags); return mAppWindow->SetPositionAndSize(x, y, cx, cy, aFlags);
} }
NS_IMETHODIMP nsChromeTreeOwner::GetPositionAndSize(int32_t* x, int32_t* y, NS_IMETHODIMP nsChromeTreeOwner::GetPositionAndSize(int32_t* x, int32_t* y,
int32_t* cx, int32_t* cy) { int32_t* cx, int32_t* cy) {
NS_ENSURE_STATE(mXULWindow); NS_ENSURE_STATE(mAppWindow);
return mXULWindow->GetPositionAndSize(x, y, cx, cy); return mAppWindow->GetPositionAndSize(x, y, cx, cy);
} }
NS_IMETHODIMP nsChromeTreeOwner::Repaint(bool aForce) { NS_IMETHODIMP nsChromeTreeOwner::Repaint(bool aForce) {
NS_ENSURE_STATE(mXULWindow); NS_ENSURE_STATE(mAppWindow);
return mXULWindow->Repaint(aForce); return mAppWindow->Repaint(aForce);
} }
NS_IMETHODIMP nsChromeTreeOwner::GetParentWidget(nsIWidget** aParentWidget) { NS_IMETHODIMP nsChromeTreeOwner::GetParentWidget(nsIWidget** aParentWidget) {
NS_ENSURE_STATE(mXULWindow); NS_ENSURE_STATE(mAppWindow);
return mXULWindow->GetParentWidget(aParentWidget); return mAppWindow->GetParentWidget(aParentWidget);
} }
NS_IMETHODIMP nsChromeTreeOwner::SetParentWidget(nsIWidget* aParentWidget) { NS_IMETHODIMP nsChromeTreeOwner::SetParentWidget(nsIWidget* aParentWidget) {
@@ -333,8 +333,8 @@ NS_IMETHODIMP nsChromeTreeOwner::SetParentWidget(nsIWidget* aParentWidget) {
NS_IMETHODIMP nsChromeTreeOwner::GetParentNativeWindow( NS_IMETHODIMP nsChromeTreeOwner::GetParentNativeWindow(
nativeWindow* aParentNativeWindow) { nativeWindow* aParentNativeWindow) {
NS_ENSURE_STATE(mXULWindow); NS_ENSURE_STATE(mAppWindow);
return mXULWindow->GetParentNativeWindow(aParentNativeWindow); return mAppWindow->GetParentNativeWindow(aParentNativeWindow);
} }
NS_IMETHODIMP nsChromeTreeOwner::SetParentNativeWindow( NS_IMETHODIMP nsChromeTreeOwner::SetParentNativeWindow(
@@ -344,53 +344,53 @@ NS_IMETHODIMP nsChromeTreeOwner::SetParentNativeWindow(
} }
NS_IMETHODIMP nsChromeTreeOwner::GetNativeHandle(nsAString& aNativeHandle) { NS_IMETHODIMP nsChromeTreeOwner::GetNativeHandle(nsAString& aNativeHandle) {
NS_ENSURE_STATE(mXULWindow); NS_ENSURE_STATE(mAppWindow);
return mXULWindow->GetNativeHandle(aNativeHandle); return mAppWindow->GetNativeHandle(aNativeHandle);
} }
NS_IMETHODIMP nsChromeTreeOwner::GetVisibility(bool* aVisibility) { NS_IMETHODIMP nsChromeTreeOwner::GetVisibility(bool* aVisibility) {
NS_ENSURE_STATE(mXULWindow); NS_ENSURE_STATE(mAppWindow);
return mXULWindow->GetVisibility(aVisibility); return mAppWindow->GetVisibility(aVisibility);
} }
NS_IMETHODIMP nsChromeTreeOwner::SetVisibility(bool aVisibility) { NS_IMETHODIMP nsChromeTreeOwner::SetVisibility(bool aVisibility) {
NS_ENSURE_STATE(mXULWindow); NS_ENSURE_STATE(mAppWindow);
return mXULWindow->SetVisibility(aVisibility); return mAppWindow->SetVisibility(aVisibility);
} }
NS_IMETHODIMP nsChromeTreeOwner::GetEnabled(bool* aEnabled) { NS_IMETHODIMP nsChromeTreeOwner::GetEnabled(bool* aEnabled) {
NS_ENSURE_STATE(mXULWindow); NS_ENSURE_STATE(mAppWindow);
return mXULWindow->GetEnabled(aEnabled); return mAppWindow->GetEnabled(aEnabled);
} }
NS_IMETHODIMP nsChromeTreeOwner::SetEnabled(bool aEnable) { NS_IMETHODIMP nsChromeTreeOwner::SetEnabled(bool aEnable) {
NS_ENSURE_STATE(mXULWindow); NS_ENSURE_STATE(mAppWindow);
return mXULWindow->SetEnabled(aEnable); return mAppWindow->SetEnabled(aEnable);
} }
NS_IMETHODIMP nsChromeTreeOwner::GetMainWidget(nsIWidget** aMainWidget) { NS_IMETHODIMP nsChromeTreeOwner::GetMainWidget(nsIWidget** aMainWidget) {
NS_ENSURE_ARG_POINTER(aMainWidget); NS_ENSURE_ARG_POINTER(aMainWidget);
NS_ENSURE_STATE(mXULWindow); NS_ENSURE_STATE(mAppWindow);
*aMainWidget = mXULWindow->mWindow; *aMainWidget = mAppWindow->mWindow;
NS_IF_ADDREF(*aMainWidget); NS_IF_ADDREF(*aMainWidget);
return NS_OK; return NS_OK;
} }
NS_IMETHODIMP nsChromeTreeOwner::SetFocus() { NS_IMETHODIMP nsChromeTreeOwner::SetFocus() {
NS_ENSURE_STATE(mXULWindow); NS_ENSURE_STATE(mAppWindow);
return mXULWindow->SetFocus(); return mAppWindow->SetFocus();
} }
NS_IMETHODIMP nsChromeTreeOwner::GetTitle(nsAString& aTitle) { NS_IMETHODIMP nsChromeTreeOwner::GetTitle(nsAString& aTitle) {
NS_ENSURE_STATE(mXULWindow); NS_ENSURE_STATE(mAppWindow);
return mXULWindow->GetTitle(aTitle); return mAppWindow->GetTitle(aTitle);
} }
NS_IMETHODIMP nsChromeTreeOwner::SetTitle(const nsAString& aTitle) { NS_IMETHODIMP nsChromeTreeOwner::SetTitle(const nsAString& aTitle) {
NS_ENSURE_STATE(mXULWindow); NS_ENSURE_STATE(mAppWindow);
return mXULWindow->SetTitle(aTitle); return mAppWindow->SetTitle(aTitle);
} }
//***************************************************************************** //*****************************************************************************
@@ -419,12 +419,12 @@ NS_IMETHODIMP
nsChromeTreeOwner::OnLocationChange(nsIWebProgress* aWebProgress, nsChromeTreeOwner::OnLocationChange(nsIWebProgress* aWebProgress,
nsIRequest* aRequest, nsIURI* aLocation, nsIRequest* aRequest, nsIURI* aLocation,
uint32_t aFlags) { uint32_t aFlags) {
NS_ENSURE_STATE(mXULWindow); NS_ENSURE_STATE(mAppWindow);
// If loading a new root .xul document, then redo chrome. // If loading a new root .xul document, then redo chrome.
if (aWebProgress) { if (aWebProgress) {
nsCOMPtr<nsIDocShell> docshell; nsCOMPtr<nsIDocShell> docshell;
mXULWindow->GetDocShell(getter_AddRefs(docshell)); mAppWindow->GetDocShell(getter_AddRefs(docshell));
nsCOMPtr<nsIWebProgress> webProgress(do_QueryInterface(docshell)); nsCOMPtr<nsIWebProgress> webProgress(do_QueryInterface(docshell));
if (webProgress != aWebProgress) { if (webProgress != aWebProgress) {
@@ -432,7 +432,7 @@ nsChromeTreeOwner::OnLocationChange(nsIWebProgress* aWebProgress,
} }
} }
mXULWindow->mChromeLoaded = false; mAppWindow->mChromeLoaded = false;
return NS_OK; return NS_OK;
} }
@@ -464,8 +464,8 @@ nsChromeTreeOwner::OnContentBlockingEvent(nsIWebProgress* aWebProgress,
// nsChromeTreeOwner: Accessors // nsChromeTreeOwner: Accessors
//***************************************************************************** //*****************************************************************************
void nsChromeTreeOwner::XULWindow(nsXULWindow* aXULWindow) { void nsChromeTreeOwner::AppWindow(mozilla::AppWindow* aAppWindow) {
mXULWindow = aXULWindow; mAppWindow = aAppWindow;
} }
nsXULWindow* nsChromeTreeOwner::XULWindow() { return mXULWindow; } mozilla::AppWindow* nsChromeTreeOwner::AppWindow() { return mAppWindow; }

View File

@@ -18,14 +18,16 @@
#include "nsIWebProgressListener.h" #include "nsIWebProgressListener.h"
#include "nsWeakReference.h" #include "nsWeakReference.h"
class nsXULWindow; namespace mozilla {
class AppWindow;
}
class nsChromeTreeOwner : public nsIDocShellTreeOwner, class nsChromeTreeOwner : public nsIDocShellTreeOwner,
public nsIBaseWindow, public nsIBaseWindow,
public nsIInterfaceRequestor, public nsIInterfaceRequestor,
public nsIWebProgressListener, public nsIWebProgressListener,
public nsSupportsWeakReference { public nsSupportsWeakReference {
friend class nsXULWindow; friend class mozilla::AppWindow;
public: public:
NS_DECL_ISUPPORTS NS_DECL_ISUPPORTS
@@ -39,11 +41,11 @@ class nsChromeTreeOwner : public nsIDocShellTreeOwner,
nsChromeTreeOwner(); nsChromeTreeOwner();
virtual ~nsChromeTreeOwner(); virtual ~nsChromeTreeOwner();
void XULWindow(nsXULWindow* aXULWindow); void AppWindow(mozilla::AppWindow* aAppWindow);
nsXULWindow* XULWindow(); mozilla::AppWindow* AppWindow();
protected: protected:
nsXULWindow* mXULWindow; mozilla::AppWindow* mAppWindow;
}; };
#endif /* nsChromeTreeOwner_h__ */ #endif /* nsChromeTreeOwner_h__ */

View File

@@ -7,7 +7,7 @@
// Local Includes // Local Includes
#include "nsContentTreeOwner.h" #include "nsContentTreeOwner.h"
#include "nsXULWindow.h" #include "AppWindow.h"
// Helper Classes // Helper Classes
#include "nsIServiceManager.h" #include "nsIServiceManager.h"
@@ -78,7 +78,7 @@ class nsSiteWindow : public nsIEmbeddingSiteWindow {
//***************************************************************************** //*****************************************************************************
nsContentTreeOwner::nsContentTreeOwner(bool fPrimary) nsContentTreeOwner::nsContentTreeOwner(bool fPrimary)
: mXULWindow(nullptr), mPrimary(fPrimary) { : mAppWindow(nullptr), mPrimary(fPrimary) {
// note if this fails, QI on nsIEmbeddingSiteWindow(2) will simply fail // note if this fails, QI on nsIEmbeddingSiteWindow(2) will simply fail
mSiteWindow = new nsSiteWindow(this); mSiteWindow = new nsSiteWindow(this);
} }
@@ -122,26 +122,26 @@ NS_IMETHODIMP nsContentTreeOwner::GetInterface(const nsIID& aIID,
*aSink = 0; *aSink = 0;
if (aIID.Equals(NS_GET_IID(nsIPrompt))) { if (aIID.Equals(NS_GET_IID(nsIPrompt))) {
NS_ENSURE_STATE(mXULWindow); NS_ENSURE_STATE(mAppWindow);
return mXULWindow->GetInterface(aIID, aSink); return mAppWindow->GetInterface(aIID, aSink);
} }
if (aIID.Equals(NS_GET_IID(nsIAuthPrompt))) { if (aIID.Equals(NS_GET_IID(nsIAuthPrompt))) {
NS_ENSURE_STATE(mXULWindow); NS_ENSURE_STATE(mAppWindow);
return mXULWindow->GetInterface(aIID, aSink); return mAppWindow->GetInterface(aIID, aSink);
} }
if (aIID.Equals(NS_GET_IID(nsIDocShellTreeItem))) { if (aIID.Equals(NS_GET_IID(nsIDocShellTreeItem))) {
NS_ENSURE_STATE(mXULWindow); NS_ENSURE_STATE(mAppWindow);
nsCOMPtr<nsIDocShell> shell; nsCOMPtr<nsIDocShell> shell;
mXULWindow->GetDocShell(getter_AddRefs(shell)); mAppWindow->GetDocShell(getter_AddRefs(shell));
if (shell) return shell->QueryInterface(aIID, aSink); if (shell) return shell->QueryInterface(aIID, aSink);
return NS_ERROR_FAILURE; return NS_ERROR_FAILURE;
} }
if (aIID.Equals(NS_GET_IID(nsIDOMWindow)) || if (aIID.Equals(NS_GET_IID(nsIDOMWindow)) ||
aIID.Equals(NS_GET_IID(nsPIDOMWindowOuter))) { aIID.Equals(NS_GET_IID(nsPIDOMWindowOuter))) {
NS_ENSURE_STATE(mXULWindow); NS_ENSURE_STATE(mAppWindow);
nsCOMPtr<nsIDocShellTreeItem> shell; nsCOMPtr<nsIDocShellTreeItem> shell;
mXULWindow->GetPrimaryContentShell(getter_AddRefs(shell)); mAppWindow->GetPrimaryContentShell(getter_AddRefs(shell));
if (shell) { if (shell) {
nsCOMPtr<nsIInterfaceRequestor> thing(do_QueryInterface(shell)); nsCOMPtr<nsIInterfaceRequestor> thing(do_QueryInterface(shell));
if (thing) return thing->GetInterface(aIID, aSink); if (thing) return thing->GetInterface(aIID, aSink);
@@ -149,9 +149,9 @@ NS_IMETHODIMP nsContentTreeOwner::GetInterface(const nsIID& aIID,
return NS_ERROR_FAILURE; return NS_ERROR_FAILURE;
} }
if (aIID.Equals(NS_GET_IID(nsIXULWindow))) { if (aIID.Equals(NS_GET_IID(nsIAppWindow))) {
NS_ENSURE_STATE(mXULWindow); NS_ENSURE_STATE(mAppWindow);
return mXULWindow->QueryInterface(aIID, aSink); return mAppWindow->QueryInterface(aIID, aSink);
} }
return QueryInterface(aIID, aSink); return QueryInterface(aIID, aSink);
@@ -164,75 +164,75 @@ NS_IMETHODIMP nsContentTreeOwner::GetInterface(const nsIID& aIID,
NS_IMETHODIMP NS_IMETHODIMP
nsContentTreeOwner::ContentShellAdded(nsIDocShellTreeItem* aContentShell, nsContentTreeOwner::ContentShellAdded(nsIDocShellTreeItem* aContentShell,
bool aPrimary) { bool aPrimary) {
NS_ENSURE_STATE(mXULWindow); NS_ENSURE_STATE(mAppWindow);
return mXULWindow->ContentShellAdded(aContentShell, aPrimary); return mAppWindow->ContentShellAdded(aContentShell, aPrimary);
} }
NS_IMETHODIMP NS_IMETHODIMP
nsContentTreeOwner::ContentShellRemoved(nsIDocShellTreeItem* aContentShell) { nsContentTreeOwner::ContentShellRemoved(nsIDocShellTreeItem* aContentShell) {
NS_ENSURE_STATE(mXULWindow); NS_ENSURE_STATE(mAppWindow);
return mXULWindow->ContentShellRemoved(aContentShell); return mAppWindow->ContentShellRemoved(aContentShell);
} }
NS_IMETHODIMP NS_IMETHODIMP
nsContentTreeOwner::GetPrimaryContentShell(nsIDocShellTreeItem** aShell) { nsContentTreeOwner::GetPrimaryContentShell(nsIDocShellTreeItem** aShell) {
NS_ENSURE_STATE(mXULWindow); NS_ENSURE_STATE(mAppWindow);
return mXULWindow->GetPrimaryContentShell(aShell); return mAppWindow->GetPrimaryContentShell(aShell);
} }
NS_IMETHODIMP NS_IMETHODIMP
nsContentTreeOwner::RemoteTabAdded(nsIRemoteTab* aTab, bool aPrimary) { nsContentTreeOwner::RemoteTabAdded(nsIRemoteTab* aTab, bool aPrimary) {
NS_ENSURE_STATE(mXULWindow); NS_ENSURE_STATE(mAppWindow);
return mXULWindow->RemoteTabAdded(aTab, aPrimary); return mAppWindow->RemoteTabAdded(aTab, aPrimary);
} }
NS_IMETHODIMP NS_IMETHODIMP
nsContentTreeOwner::RemoteTabRemoved(nsIRemoteTab* aTab) { nsContentTreeOwner::RemoteTabRemoved(nsIRemoteTab* aTab) {
NS_ENSURE_STATE(mXULWindow); NS_ENSURE_STATE(mAppWindow);
return mXULWindow->RemoteTabRemoved(aTab); return mAppWindow->RemoteTabRemoved(aTab);
} }
NS_IMETHODIMP NS_IMETHODIMP
nsContentTreeOwner::GetPrimaryRemoteTab(nsIRemoteTab** aTab) { nsContentTreeOwner::GetPrimaryRemoteTab(nsIRemoteTab** aTab) {
NS_ENSURE_STATE(mXULWindow); NS_ENSURE_STATE(mAppWindow);
return mXULWindow->GetPrimaryRemoteTab(aTab); return mAppWindow->GetPrimaryRemoteTab(aTab);
} }
NS_IMETHODIMP NS_IMETHODIMP
nsContentTreeOwner::GetPrimaryContentSize(int32_t* aWidth, int32_t* aHeight) { nsContentTreeOwner::GetPrimaryContentSize(int32_t* aWidth, int32_t* aHeight) {
NS_ENSURE_STATE(mXULWindow); NS_ENSURE_STATE(mAppWindow);
return mXULWindow->GetPrimaryContentSize(aWidth, aHeight); return mAppWindow->GetPrimaryContentSize(aWidth, aHeight);
} }
NS_IMETHODIMP NS_IMETHODIMP
nsContentTreeOwner::SetPrimaryContentSize(int32_t aWidth, int32_t aHeight) { nsContentTreeOwner::SetPrimaryContentSize(int32_t aWidth, int32_t aHeight) {
NS_ENSURE_STATE(mXULWindow); NS_ENSURE_STATE(mAppWindow);
return mXULWindow->SetPrimaryContentSize(aWidth, aHeight); return mAppWindow->SetPrimaryContentSize(aWidth, aHeight);
} }
NS_IMETHODIMP NS_IMETHODIMP
nsContentTreeOwner::GetRootShellSize(int32_t* aWidth, int32_t* aHeight) { nsContentTreeOwner::GetRootShellSize(int32_t* aWidth, int32_t* aHeight) {
NS_ENSURE_STATE(mXULWindow); NS_ENSURE_STATE(mAppWindow);
return mXULWindow->GetRootShellSize(aWidth, aHeight); return mAppWindow->GetRootShellSize(aWidth, aHeight);
} }
NS_IMETHODIMP NS_IMETHODIMP
nsContentTreeOwner::SetRootShellSize(int32_t aWidth, int32_t aHeight) { nsContentTreeOwner::SetRootShellSize(int32_t aWidth, int32_t aHeight) {
NS_ENSURE_STATE(mXULWindow); NS_ENSURE_STATE(mAppWindow);
return mXULWindow->SetRootShellSize(aWidth, aHeight); return mAppWindow->SetRootShellSize(aWidth, aHeight);
} }
NS_IMETHODIMP nsContentTreeOwner::SizeShellTo(nsIDocShellTreeItem* aShellItem, NS_IMETHODIMP nsContentTreeOwner::SizeShellTo(nsIDocShellTreeItem* aShellItem,
int32_t aCX, int32_t aCY) { int32_t aCX, int32_t aCY) {
NS_ENSURE_STATE(mXULWindow); NS_ENSURE_STATE(mAppWindow);
return mXULWindow->SizeShellTo(aShellItem, aCX, aCY); return mAppWindow->SizeShellTo(aShellItem, aCX, aCY);
} }
NS_IMETHODIMP NS_IMETHODIMP
nsContentTreeOwner::SetPersistence(bool aPersistPosition, bool aPersistSize, nsContentTreeOwner::SetPersistence(bool aPersistPosition, bool aPersistSize,
bool aPersistSizeMode) { bool aPersistSizeMode) {
NS_ENSURE_STATE(mXULWindow); NS_ENSURE_STATE(mAppWindow);
nsCOMPtr<dom::Element> docShellElement = mXULWindow->GetWindowDOMElement(); nsCOMPtr<dom::Element> docShellElement = mAppWindow->GetWindowDOMElement();
if (!docShellElement) return NS_ERROR_FAILURE; if (!docShellElement) return NS_ERROR_FAILURE;
nsAutoString persistString; nsAutoString persistString;
@@ -299,8 +299,8 @@ nsContentTreeOwner::SetPersistence(bool aPersistPosition, bool aPersistSize,
NS_IMETHODIMP NS_IMETHODIMP
nsContentTreeOwner::GetPersistence(bool* aPersistPosition, bool* aPersistSize, nsContentTreeOwner::GetPersistence(bool* aPersistPosition, bool* aPersistSize,
bool* aPersistSizeMode) { bool* aPersistSizeMode) {
NS_ENSURE_STATE(mXULWindow); NS_ENSURE_STATE(mAppWindow);
nsCOMPtr<dom::Element> docShellElement = mXULWindow->GetWindowDOMElement(); nsCOMPtr<dom::Element> docShellElement = mAppWindow->GetWindowDOMElement();
if (!docShellElement) return NS_ERROR_FAILURE; if (!docShellElement) return NS_ERROR_FAILURE;
nsAutoString persistString; nsAutoString persistString;
@@ -326,8 +326,8 @@ nsContentTreeOwner::GetPersistence(bool* aPersistPosition, bool* aPersistSize,
NS_IMETHODIMP NS_IMETHODIMP
nsContentTreeOwner::GetTabCount(uint32_t* aResult) { nsContentTreeOwner::GetTabCount(uint32_t* aResult) {
if (mXULWindow) { if (mAppWindow) {
return mXULWindow->GetTabCount(aResult); return mAppWindow->GetTabCount(aResult);
} }
*aResult = 0; *aResult = 0;
@@ -336,8 +336,8 @@ nsContentTreeOwner::GetTabCount(uint32_t* aResult) {
NS_IMETHODIMP NS_IMETHODIMP
nsContentTreeOwner::GetHasPrimaryContent(bool* aResult) { nsContentTreeOwner::GetHasPrimaryContent(bool* aResult) {
NS_ENSURE_STATE(mXULWindow); NS_ENSURE_STATE(mAppWindow);
return mXULWindow->GetHasPrimaryContent(aResult); return mAppWindow->GetHasPrimaryContent(aResult);
} }
//***************************************************************************** //*****************************************************************************
@@ -347,10 +347,10 @@ nsContentTreeOwner::GetHasPrimaryContent(bool* aResult) {
NS_IMETHODIMP nsContentTreeOwner::OnBeforeLinkTraversal( NS_IMETHODIMP nsContentTreeOwner::OnBeforeLinkTraversal(
const nsAString& originalTarget, nsIURI* linkURI, nsINode* linkNode, const nsAString& originalTarget, nsIURI* linkURI, nsINode* linkNode,
bool isAppTab, nsAString& _retval) { bool isAppTab, nsAString& _retval) {
NS_ENSURE_STATE(mXULWindow); NS_ENSURE_STATE(mAppWindow);
nsCOMPtr<nsIXULBrowserWindow> xulBrowserWindow; nsCOMPtr<nsIXULBrowserWindow> xulBrowserWindow;
mXULWindow->GetXULBrowserWindow(getter_AddRefs(xulBrowserWindow)); mAppWindow->GetXULBrowserWindow(getter_AddRefs(xulBrowserWindow));
if (xulBrowserWindow) if (xulBrowserWindow)
return xulBrowserWindow->OnBeforeLinkTraversal(originalTarget, linkURI, return xulBrowserWindow->OnBeforeLinkTraversal(originalTarget, linkURI,
@@ -364,10 +364,10 @@ NS_IMETHODIMP nsContentTreeOwner::ShouldLoadURI(
nsIDocShell* aDocShell, nsIURI* aURI, nsIReferrerInfo* aReferrerInfo, nsIDocShell* aDocShell, nsIURI* aURI, nsIReferrerInfo* aReferrerInfo,
bool aHasPostData, nsIPrincipal* aTriggeringPrincipal, bool aHasPostData, nsIPrincipal* aTriggeringPrincipal,
nsIContentSecurityPolicy* aCsp, bool* _retval) { nsIContentSecurityPolicy* aCsp, bool* _retval) {
NS_ENSURE_STATE(mXULWindow); NS_ENSURE_STATE(mAppWindow);
nsCOMPtr<nsIXULBrowserWindow> xulBrowserWindow; nsCOMPtr<nsIXULBrowserWindow> xulBrowserWindow;
mXULWindow->GetXULBrowserWindow(getter_AddRefs(xulBrowserWindow)); mAppWindow->GetXULBrowserWindow(getter_AddRefs(xulBrowserWindow));
if (xulBrowserWindow) if (xulBrowserWindow)
return xulBrowserWindow->ShouldLoadURI(aDocShell, aURI, aReferrerInfo, return xulBrowserWindow->ShouldLoadURI(aDocShell, aURI, aReferrerInfo,
@@ -404,10 +404,10 @@ NS_IMETHODIMP nsContentTreeOwner::SetStatusWithContext(
// We only allow the status to be set from the primary content shell // We only allow the status to be set from the primary content shell
if (!mPrimary && aStatusType != STATUS_LINK) return NS_OK; if (!mPrimary && aStatusType != STATUS_LINK) return NS_OK;
NS_ENSURE_STATE(mXULWindow); NS_ENSURE_STATE(mAppWindow);
nsCOMPtr<nsIXULBrowserWindow> xulBrowserWindow; nsCOMPtr<nsIXULBrowserWindow> xulBrowserWindow;
mXULWindow->GetXULBrowserWindow(getter_AddRefs(xulBrowserWindow)); mAppWindow->GetXULBrowserWindow(getter_AddRefs(xulBrowserWindow));
if (xulBrowserWindow) { if (xulBrowserWindow) {
switch (aStatusType) { switch (aStatusType) {
@@ -436,23 +436,23 @@ NS_IMETHODIMP nsContentTreeOwner::SetStatus(uint32_t aStatusType,
} }
NS_IMETHODIMP nsContentTreeOwner::SetChromeFlags(uint32_t aChromeFlags) { NS_IMETHODIMP nsContentTreeOwner::SetChromeFlags(uint32_t aChromeFlags) {
NS_ENSURE_STATE(mXULWindow); NS_ENSURE_STATE(mAppWindow);
return mXULWindow->SetChromeFlags(aChromeFlags); return mAppWindow->SetChromeFlags(aChromeFlags);
} }
NS_IMETHODIMP nsContentTreeOwner::GetChromeFlags(uint32_t* aChromeFlags) { NS_IMETHODIMP nsContentTreeOwner::GetChromeFlags(uint32_t* aChromeFlags) {
NS_ENSURE_STATE(mXULWindow); NS_ENSURE_STATE(mAppWindow);
return mXULWindow->GetChromeFlags(aChromeFlags); return mAppWindow->GetChromeFlags(aChromeFlags);
} }
NS_IMETHODIMP nsContentTreeOwner::ShowAsModal() { NS_IMETHODIMP nsContentTreeOwner::ShowAsModal() {
NS_ENSURE_STATE(mXULWindow); NS_ENSURE_STATE(mAppWindow);
return mXULWindow->ShowModal(); return mAppWindow->ShowModal();
} }
NS_IMETHODIMP nsContentTreeOwner::IsWindowModal(bool* _retval) { NS_IMETHODIMP nsContentTreeOwner::IsWindowModal(bool* _retval) {
NS_ENSURE_STATE(mXULWindow); NS_ENSURE_STATE(mAppWindow);
*_retval = mXULWindow->mContinueModalLoop; *_retval = mAppWindow->mContinueModalLoop;
return NS_OK; return NS_OK;
} }
@@ -477,71 +477,71 @@ NS_IMETHODIMP nsContentTreeOwner::Create() {
} }
NS_IMETHODIMP nsContentTreeOwner::Destroy() { NS_IMETHODIMP nsContentTreeOwner::Destroy() {
NS_ENSURE_STATE(mXULWindow); NS_ENSURE_STATE(mAppWindow);
return mXULWindow->Destroy(); return mAppWindow->Destroy();
} }
NS_IMETHODIMP nsContentTreeOwner::GetUnscaledDevicePixelsPerCSSPixel( NS_IMETHODIMP nsContentTreeOwner::GetUnscaledDevicePixelsPerCSSPixel(
double* aScale) { double* aScale) {
NS_ENSURE_STATE(mXULWindow); NS_ENSURE_STATE(mAppWindow);
return mXULWindow->GetUnscaledDevicePixelsPerCSSPixel(aScale); return mAppWindow->GetUnscaledDevicePixelsPerCSSPixel(aScale);
} }
NS_IMETHODIMP nsContentTreeOwner::GetDevicePixelsPerDesktopPixel( NS_IMETHODIMP nsContentTreeOwner::GetDevicePixelsPerDesktopPixel(
double* aScale) { double* aScale) {
NS_ENSURE_STATE(mXULWindow); NS_ENSURE_STATE(mAppWindow);
return mXULWindow->GetDevicePixelsPerDesktopPixel(aScale); return mAppWindow->GetDevicePixelsPerDesktopPixel(aScale);
} }
NS_IMETHODIMP nsContentTreeOwner::SetPositionDesktopPix(int32_t aX, NS_IMETHODIMP nsContentTreeOwner::SetPositionDesktopPix(int32_t aX,
int32_t aY) { int32_t aY) {
NS_ENSURE_STATE(mXULWindow); NS_ENSURE_STATE(mAppWindow);
return mXULWindow->SetPositionDesktopPix(aX, aY); return mAppWindow->SetPositionDesktopPix(aX, aY);
} }
NS_IMETHODIMP nsContentTreeOwner::SetPosition(int32_t aX, int32_t aY) { NS_IMETHODIMP nsContentTreeOwner::SetPosition(int32_t aX, int32_t aY) {
NS_ENSURE_STATE(mXULWindow); NS_ENSURE_STATE(mAppWindow);
return mXULWindow->SetPosition(aX, aY); return mAppWindow->SetPosition(aX, aY);
} }
NS_IMETHODIMP nsContentTreeOwner::GetPosition(int32_t* aX, int32_t* aY) { NS_IMETHODIMP nsContentTreeOwner::GetPosition(int32_t* aX, int32_t* aY) {
NS_ENSURE_STATE(mXULWindow); NS_ENSURE_STATE(mAppWindow);
return mXULWindow->GetPosition(aX, aY); return mAppWindow->GetPosition(aX, aY);
} }
NS_IMETHODIMP nsContentTreeOwner::SetSize(int32_t aCX, int32_t aCY, NS_IMETHODIMP nsContentTreeOwner::SetSize(int32_t aCX, int32_t aCY,
bool aRepaint) { bool aRepaint) {
NS_ENSURE_STATE(mXULWindow); NS_ENSURE_STATE(mAppWindow);
return mXULWindow->SetSize(aCX, aCY, aRepaint); return mAppWindow->SetSize(aCX, aCY, aRepaint);
} }
NS_IMETHODIMP nsContentTreeOwner::GetSize(int32_t* aCX, int32_t* aCY) { NS_IMETHODIMP nsContentTreeOwner::GetSize(int32_t* aCX, int32_t* aCY) {
NS_ENSURE_STATE(mXULWindow); NS_ENSURE_STATE(mAppWindow);
return mXULWindow->GetSize(aCX, aCY); return mAppWindow->GetSize(aCX, aCY);
} }
NS_IMETHODIMP nsContentTreeOwner::SetPositionAndSize(int32_t aX, int32_t aY, NS_IMETHODIMP nsContentTreeOwner::SetPositionAndSize(int32_t aX, int32_t aY,
int32_t aCX, int32_t aCY, int32_t aCX, int32_t aCY,
uint32_t aFlags) { uint32_t aFlags) {
NS_ENSURE_STATE(mXULWindow); NS_ENSURE_STATE(mAppWindow);
return mXULWindow->SetPositionAndSize(aX, aY, aCX, aCY, aFlags); return mAppWindow->SetPositionAndSize(aX, aY, aCX, aCY, aFlags);
} }
NS_IMETHODIMP nsContentTreeOwner::GetPositionAndSize(int32_t* aX, int32_t* aY, NS_IMETHODIMP nsContentTreeOwner::GetPositionAndSize(int32_t* aX, int32_t* aY,
int32_t* aCX, int32_t* aCX,
int32_t* aCY) { int32_t* aCY) {
NS_ENSURE_STATE(mXULWindow); NS_ENSURE_STATE(mAppWindow);
return mXULWindow->GetPositionAndSize(aX, aY, aCX, aCY); return mAppWindow->GetPositionAndSize(aX, aY, aCX, aCY);
} }
NS_IMETHODIMP nsContentTreeOwner::Repaint(bool aForce) { NS_IMETHODIMP nsContentTreeOwner::Repaint(bool aForce) {
NS_ENSURE_STATE(mXULWindow); NS_ENSURE_STATE(mAppWindow);
return mXULWindow->Repaint(aForce); return mAppWindow->Repaint(aForce);
} }
NS_IMETHODIMP nsContentTreeOwner::GetParentWidget(nsIWidget** aParentWidget) { NS_IMETHODIMP nsContentTreeOwner::GetParentWidget(nsIWidget** aParentWidget) {
NS_ENSURE_STATE(mXULWindow); NS_ENSURE_STATE(mAppWindow);
return mXULWindow->GetParentWidget(aParentWidget); return mAppWindow->GetParentWidget(aParentWidget);
} }
NS_IMETHODIMP nsContentTreeOwner::SetParentWidget(nsIWidget* aParentWidget) { NS_IMETHODIMP nsContentTreeOwner::SetParentWidget(nsIWidget* aParentWidget) {
@@ -551,8 +551,8 @@ NS_IMETHODIMP nsContentTreeOwner::SetParentWidget(nsIWidget* aParentWidget) {
NS_IMETHODIMP nsContentTreeOwner::GetParentNativeWindow( NS_IMETHODIMP nsContentTreeOwner::GetParentNativeWindow(
nativeWindow* aParentNativeWindow) { nativeWindow* aParentNativeWindow) {
NS_ENSURE_STATE(mXULWindow); NS_ENSURE_STATE(mAppWindow);
return mXULWindow->GetParentNativeWindow(aParentNativeWindow); return mAppWindow->GetParentNativeWindow(aParentNativeWindow);
} }
NS_IMETHODIMP nsContentTreeOwner::SetParentNativeWindow( NS_IMETHODIMP nsContentTreeOwner::SetParentNativeWindow(
@@ -562,49 +562,49 @@ NS_IMETHODIMP nsContentTreeOwner::SetParentNativeWindow(
} }
NS_IMETHODIMP nsContentTreeOwner::GetNativeHandle(nsAString& aNativeHandle) { NS_IMETHODIMP nsContentTreeOwner::GetNativeHandle(nsAString& aNativeHandle) {
NS_ENSURE_STATE(mXULWindow); NS_ENSURE_STATE(mAppWindow);
return mXULWindow->GetNativeHandle(aNativeHandle); return mAppWindow->GetNativeHandle(aNativeHandle);
} }
NS_IMETHODIMP nsContentTreeOwner::GetVisibility(bool* aVisibility) { NS_IMETHODIMP nsContentTreeOwner::GetVisibility(bool* aVisibility) {
NS_ENSURE_STATE(mXULWindow); NS_ENSURE_STATE(mAppWindow);
return mXULWindow->GetVisibility(aVisibility); return mAppWindow->GetVisibility(aVisibility);
} }
NS_IMETHODIMP nsContentTreeOwner::SetVisibility(bool aVisibility) { NS_IMETHODIMP nsContentTreeOwner::SetVisibility(bool aVisibility) {
NS_ENSURE_STATE(mXULWindow); NS_ENSURE_STATE(mAppWindow);
return mXULWindow->SetVisibility(aVisibility); return mAppWindow->SetVisibility(aVisibility);
} }
NS_IMETHODIMP nsContentTreeOwner::GetEnabled(bool* aEnabled) { NS_IMETHODIMP nsContentTreeOwner::GetEnabled(bool* aEnabled) {
NS_ENSURE_STATE(mXULWindow); NS_ENSURE_STATE(mAppWindow);
return mXULWindow->GetEnabled(aEnabled); return mAppWindow->GetEnabled(aEnabled);
} }
NS_IMETHODIMP nsContentTreeOwner::SetEnabled(bool aEnable) { NS_IMETHODIMP nsContentTreeOwner::SetEnabled(bool aEnable) {
NS_ENSURE_STATE(mXULWindow); NS_ENSURE_STATE(mAppWindow);
return mXULWindow->SetEnabled(aEnable); return mAppWindow->SetEnabled(aEnable);
} }
NS_IMETHODIMP nsContentTreeOwner::GetMainWidget(nsIWidget** aMainWidget) { NS_IMETHODIMP nsContentTreeOwner::GetMainWidget(nsIWidget** aMainWidget) {
NS_ENSURE_ARG_POINTER(aMainWidget); NS_ENSURE_ARG_POINTER(aMainWidget);
NS_ENSURE_STATE(mXULWindow); NS_ENSURE_STATE(mAppWindow);
*aMainWidget = mXULWindow->mWindow; *aMainWidget = mAppWindow->mWindow;
NS_IF_ADDREF(*aMainWidget); NS_IF_ADDREF(*aMainWidget);
return NS_OK; return NS_OK;
} }
NS_IMETHODIMP nsContentTreeOwner::SetFocus() { NS_IMETHODIMP nsContentTreeOwner::SetFocus() {
NS_ENSURE_STATE(mXULWindow); NS_ENSURE_STATE(mAppWindow);
return mXULWindow->SetFocus(); return mAppWindow->SetFocus();
} }
NS_IMETHODIMP nsContentTreeOwner::GetTitle(nsAString& aTitle) { NS_IMETHODIMP nsContentTreeOwner::GetTitle(nsAString& aTitle) {
NS_ENSURE_STATE(mXULWindow); NS_ENSURE_STATE(mAppWindow);
return mXULWindow->GetTitle(aTitle); return mAppWindow->GetTitle(aTitle);
} }
NS_IMETHODIMP nsContentTreeOwner::SetTitle(const nsAString& aTitle) { NS_IMETHODIMP nsContentTreeOwner::SetTitle(const nsAString& aTitle) {
@@ -629,7 +629,7 @@ nsContentTreeOwner::ProvideWindow(
*aReturn = nullptr; *aReturn = nullptr;
if (!mXULWindow) { if (!mAppWindow) {
// Nothing to do here // Nothing to do here
return NS_OK; return NS_OK;
} }
@@ -690,11 +690,11 @@ nsContentTreeOwner::ProvideWindow(
} }
nsCOMPtr<mozIDOMWindowProxy> domWin; nsCOMPtr<mozIDOMWindowProxy> domWin;
mXULWindow->GetWindowDOMWindow(getter_AddRefs(domWin)); mAppWindow->GetWindowDOMWindow(getter_AddRefs(domWin));
nsCOMPtr<nsIDOMChromeWindow> chromeWin = do_QueryInterface(domWin); nsCOMPtr<nsIDOMChromeWindow> chromeWin = do_QueryInterface(domWin);
if (!chromeWin) { if (!chromeWin) {
// Really odd... but whatever // Really odd... but whatever
NS_WARNING("nsXULWindow's DOMWindow is not a chrome window"); NS_WARNING("AppWindow's DOMWindow is not a chrome window");
return NS_OK; return NS_OK;
} }
@@ -756,11 +756,11 @@ class nsContentTitleSettingEvent : public Runnable {
}; };
#endif #endif
void nsContentTreeOwner::XULWindow(nsXULWindow* aXULWindow) { void nsContentTreeOwner::AppWindow(mozilla::AppWindow* aAppWindow) {
mXULWindow = aXULWindow; mAppWindow = aAppWindow;
} }
nsXULWindow* nsContentTreeOwner::XULWindow() { return mXULWindow; } mozilla::AppWindow* nsContentTreeOwner::AppWindow() { return mAppWindow; }
//***************************************************************************** //*****************************************************************************
//*** nsSiteWindow implementation //*** nsSiteWindow implementation
@@ -804,7 +804,7 @@ nsSiteWindow::SetFocus(void) {
and it's better for our purposes to not pick a document and and it's better for our purposes to not pick a document and
focus it, but allow nsGlobalWindow to carry on unhindered. focus it, but allow nsGlobalWindow to carry on unhindered.
*/ */
nsXULWindow *window = mAggregator->XULWindow(); AppWindow *window = mAggregator->AppWindow();
if (window) { if (window) {
nsCOMPtr<nsIDocShell> docshell; nsCOMPtr<nsIDocShell> docshell;
window->GetDocShell(getter_AddRefs(docshell)); window->GetDocShell(getter_AddRefs(docshell));
@@ -825,15 +825,15 @@ nsSiteWindow::Blur(void) {
NS_DEFINE_CID(kWindowMediatorCID, NS_WINDOWMEDIATOR_CID); NS_DEFINE_CID(kWindowMediatorCID, NS_WINDOWMEDIATOR_CID);
nsCOMPtr<nsISimpleEnumerator> windowEnumerator; nsCOMPtr<nsISimpleEnumerator> windowEnumerator;
nsCOMPtr<nsIXULWindow> xulWindow; nsCOMPtr<nsIAppWindow> appWindow;
bool more, foundUs; bool more, foundUs;
nsXULWindow* ourWindow = mAggregator->XULWindow(); AppWindow* ourWindow = mAggregator->AppWindow();
{ {
nsCOMPtr<nsIWindowMediator> windowMediator( nsCOMPtr<nsIWindowMediator> windowMediator(
do_GetService(kWindowMediatorCID)); do_GetService(kWindowMediatorCID));
if (windowMediator) if (windowMediator)
windowMediator->GetZOrderXULWindowEnumerator( windowMediator->GetZOrderAppWindowEnumerator(
0, true, getter_AddRefs(windowEnumerator)); 0, true, getter_AddRefs(windowEnumerator));
} }
@@ -844,30 +844,30 @@ nsSiteWindow::Blur(void) {
windowEnumerator->HasMoreElements(&more); windowEnumerator->HasMoreElements(&more);
while (more) { while (more) {
nsCOMPtr<nsISupports> nextWindow; nsCOMPtr<nsISupports> nextWindow;
nsCOMPtr<nsIXULWindow> nextXULWindow; nsCOMPtr<nsIAppWindow> nextAppWindow;
windowEnumerator->GetNext(getter_AddRefs(nextWindow)); windowEnumerator->GetNext(getter_AddRefs(nextWindow));
nextXULWindow = do_QueryInterface(nextWindow); nextAppWindow = do_QueryInterface(nextWindow);
// got it!(?) // got it!(?)
if (foundUs) { if (foundUs) {
xulWindow = nextXULWindow; appWindow = nextAppWindow;
break; break;
} }
// remember the very first one, in case we have to wrap // remember the very first one, in case we have to wrap
if (!xulWindow) xulWindow = nextXULWindow; if (!appWindow) appWindow = nextAppWindow;
// look for us // look for us
if (nextXULWindow == ourWindow) foundUs = true; if (nextAppWindow == ourWindow) foundUs = true;
windowEnumerator->HasMoreElements(&more); windowEnumerator->HasMoreElements(&more);
} }
// change focus to the window we just found // change focus to the window we just found
if (xulWindow) { if (appWindow) {
nsCOMPtr<nsIDocShell> docshell; nsCOMPtr<nsIDocShell> docshell;
xulWindow->GetDocShell(getter_AddRefs(docshell)); appWindow->GetDocShell(getter_AddRefs(docshell));
if (!docshell) { if (!docshell) {
return NS_OK; return NS_OK;
} }

View File

@@ -19,7 +19,9 @@
#include "nsIWebBrowserChrome3.h" #include "nsIWebBrowserChrome3.h"
#include "nsIWindowProvider.h" #include "nsIWindowProvider.h"
class nsXULWindow; namespace mozilla {
class AppWindow;
}
class nsSiteWindow; class nsSiteWindow;
class nsContentTreeOwner final : public nsIDocShellTreeOwner, class nsContentTreeOwner final : public nsIDocShellTreeOwner,
@@ -27,7 +29,7 @@ class nsContentTreeOwner final : public nsIDocShellTreeOwner,
public nsIInterfaceRequestor, public nsIInterfaceRequestor,
public nsIWebBrowserChrome3, public nsIWebBrowserChrome3,
public nsIWindowProvider { public nsIWindowProvider {
friend class nsXULWindow; friend class mozilla::AppWindow;
friend class nsSiteWindow; friend class nsSiteWindow;
public: public:
@@ -45,11 +47,11 @@ class nsContentTreeOwner final : public nsIDocShellTreeOwner,
explicit nsContentTreeOwner(bool fPrimary); explicit nsContentTreeOwner(bool fPrimary);
virtual ~nsContentTreeOwner(); virtual ~nsContentTreeOwner();
void XULWindow(nsXULWindow* aXULWindow); void AppWindow(mozilla::AppWindow* aAppWindow);
nsXULWindow* XULWindow(); mozilla::AppWindow* AppWindow();
protected: protected:
nsXULWindow* mXULWindow; mozilla::AppWindow* mAppWindow;
nsSiteWindow* mSiteWindow; nsSiteWindow* mSiteWindow;
bool mPrimary; bool mPrimary;
}; };

View File

@@ -5,7 +5,7 @@
#include "nsISupports.idl" #include "nsISupports.idl"
interface nsIXULWindow; interface nsIAppWindow;
interface nsIWindowlessBrowser; interface nsIWindowlessBrowser;
interface nsIURI; interface nsIURI;
interface mozIDOMWindowProxy; interface mozIDOMWindowProxy;
@@ -42,7 +42,7 @@ interface nsIAppShellService : nsISupports
* Can be left null. * Can be left null.
*/ */
const long SIZE_TO_CONTENT = -1; const long SIZE_TO_CONTENT = -1;
nsIXULWindow createTopLevelWindow(in nsIXULWindow aParent, nsIAppWindow createTopLevelWindow(in nsIAppWindow aParent,
in nsIURI aUrl, in nsIURI aUrl,
in uint32_t aChromeMask, in uint32_t aChromeMask,
in long aInitialWidth, in long aInitialWidth,
@@ -79,7 +79,7 @@ interface nsIAppShellService : nsISupports
* @param aResult the hidden window. Do not unhide hidden window. * @param aResult the hidden window. Do not unhide hidden window.
* Do not taunt hidden window. * Do not taunt hidden window.
*/ */
readonly attribute nsIXULWindow hiddenWindow; readonly attribute nsIAppWindow hiddenWindow;
/** /**
* Return the (singleton) application hidden window, automatically created * Return the (singleton) application hidden window, automatically created
@@ -104,7 +104,7 @@ interface nsIAppShellService : nsISupports
* @note When this method is successful, it fires the global notification * @note When this method is successful, it fires the global notification
* "xul-window-registered" * "xul-window-registered"
*/ */
void registerTopLevelWindow(in nsIXULWindow aWindow); void registerTopLevelWindow(in nsIAppWindow aWindow);
/** /**
* Remove a window from the application's window registry. Note that * Remove a window from the application's window registry. Note that
@@ -112,7 +112,7 @@ interface nsIAppShellService : nsISupports
* the last window is unregistered. For that, see Quit(). * the last window is unregistered. For that, see Quit().
* @param aWindow you see the pattern * @param aWindow you see the pattern
*/ */
void unregisterTopLevelWindow(in nsIXULWindow aWindow); void unregisterTopLevelWindow(in nsIAppWindow aWindow);
/** /**
* Whether the hidden window has been lazily created. * Whether the hidden window has been lazily created.

View File

@@ -7,7 +7,7 @@
#include "nsISupports.idl" #include "nsISupports.idl"
/** /**
* The nsIXULWindow * The nsIAppWindow
* *
* When the window is destroyed, it will fire a "xul-window-destroyed" * When the window is destroyed, it will fire a "xul-window-destroyed"
* notification through the global observer service. * notification through the global observer service.
@@ -27,7 +27,7 @@ interface mozIDOMWindowProxy;
native LiveResizeListenerArray(nsTArray<RefPtr<mozilla::LiveResizeListener>>); native LiveResizeListenerArray(nsTArray<RefPtr<mozilla::LiveResizeListener>>);
[builtinclass, scriptable, uuid(d6d7a014-e28d-4c9d-8727-1cf6d870619b)] [builtinclass, scriptable, uuid(d6d7a014-e28d-4c9d-8727-1cf6d870619b)]
interface nsIXULWindow : nsISupports interface nsIAppWindow : nsISupports
{ {
/** /**
* The docshell owning the XUL for this window. * The docshell owning the XUL for this window.
@@ -64,7 +64,7 @@ interface nsIXULWindow : nsISupports
* Tell this window that it has picked up a child XUL window * Tell this window that it has picked up a child XUL window
* @param aChild the child window being added * @param aChild the child window being added
*/ */
void addChildWindow(in nsIXULWindow aChild); void addChildWindow(in nsIAppWindow aChild);
/** /**
* Returns the difference between the inner window size (client size) and the * Returns the difference between the inner window size (client size) and the
@@ -77,7 +77,7 @@ interface nsIXULWindow : nsISupports
* Tell this window that it has lost a child XUL window * Tell this window that it has lost a child XUL window
* @param aChild the child window being removed * @param aChild the child window being removed
*/ */
void removeChildWindow(in nsIXULWindow aChild); void removeChildWindow(in nsIAppWindow aChild);
/** /**
* Move the window to a centered position. * Move the window to a centered position.
@@ -93,7 +93,7 @@ interface nsIXULWindow : nsISupports
* @param aAlert PR_TRUE to move the window to an alert position, * @param aAlert PR_TRUE to move the window to an alert position,
* generally centered horizontally and 1/3 down from the top. * generally centered horizontally and 1/3 down from the top.
*/ */
void center(in nsIXULWindow aRelative, in boolean aScreen, in boolean aAlert); void center(in nsIAppWindow aRelative, in boolean aScreen, in boolean aAlert);
/** /**
* Shows the window as a modal window. That is, ensures that it is visible * Shows the window as a modal window. That is, ensures that it is visible
@@ -133,7 +133,7 @@ interface nsIXULWindow : nsISupports
* 0 means there is no next remote tab actor to use. * 0 means there is no next remote tab actor to use.
* @return the newly minted window * @return the newly minted window
*/ */
nsIXULWindow createNewWindow(in int32_t aChromeFlags, nsIAppWindow createNewWindow(in int32_t aChromeFlags,
in nsIRemoteTab aOpeningTab, in nsIRemoteTab aOpeningTab,
in mozIDOMWindowProxy aOpener, in mozIDOMWindowProxy aOpener,
in unsigned long long aNextRemoteTabId); in unsigned long long aNextRemoteTabId);

View File

@@ -17,7 +17,7 @@
interface mozIDOMWindow; interface mozIDOMWindow;
interface mozIDOMWindowProxy; interface mozIDOMWindowProxy;
interface nsIXULWindow; interface nsIAppWindow;
interface nsIWidget; interface nsIWidget;
interface nsIWindowMediatorListener; interface nsIWindowMediatorListener;
@@ -37,9 +37,9 @@ interface nsIWindowMediator: nsISupports
nsISimpleEnumerator getEnumerator(in wstring aWindowType); nsISimpleEnumerator getEnumerator(in wstring aWindowType);
/** Identical to getEnumerator except: /** Identical to getEnumerator except:
* @return an enumerator of nsIXULWindows * @return an enumerator of nsIAppWindows
*/ */
nsISimpleEnumerator getXULWindowEnumerator(in wstring aWindowType); nsISimpleEnumerator getAppWindowEnumerator(in wstring aWindowType);
/** Return an enumerator which iterates over all windows of type aWindowType /** Return an enumerator which iterates over all windows of type aWindowType
* in their z (front-to-back) order. Note this interface makes * in their z (front-to-back) order. Note this interface makes
@@ -51,9 +51,9 @@ interface nsIWindowMediator: nsISupports
* If null, all windows will be enumerated. * If null, all windows will be enumerated.
* @param aFrontToBack if true, the enumerator enumerates windows in order * @param aFrontToBack if true, the enumerator enumerates windows in order
* from front to back. back to front if false. * from front to back. back to front if false.
* @return an enumerator of nsIXULWindows * @return an enumerator of nsIAppWindows
*/ */
nsISimpleEnumerator getZOrderXULWindowEnumerator(in wstring aWindowType, nsISimpleEnumerator getZOrderAppWindowEnumerator(in wstring aWindowType,
in boolean aFrontToBack); in boolean aFrontToBack);
/** This is a shortcut for simply fetching the first window in /** This is a shortcut for simply fetching the first window in
@@ -95,20 +95,20 @@ interface nsIWindowMediator: nsISupports
* addListener) will be notified through their onOpenWindow method. * addListener) will be notified through their onOpenWindow method.
* @param aWindow the window to add * @param aWindow the window to add
*/ */
[noscript] void registerWindow(in nsIXULWindow aWindow); [noscript] void registerWindow(in nsIAppWindow aWindow);
/** Remove the window from the list of known windows. Listeners (see /** Remove the window from the list of known windows. Listeners (see
* addListener) will be be notified through their onCloseWindow method. * addListener) will be be notified through their onCloseWindow method.
* @param aWindow the window to remove * @param aWindow the window to remove
*/ */
[noscript] void unregisterWindow(in nsIXULWindow aWindow); [noscript] void unregisterWindow(in nsIAppWindow aWindow);
/** Call this method when a window gains focus. It's a primitive means of /** Call this method when a window gains focus. It's a primitive means of
* determining the most recent window. It's no longer necessary and it * determining the most recent window. It's no longer necessary and it
* really should be removed. * really should be removed.
* @param aWindow the window which has gained focus * @param aWindow the window which has gained focus
*/ */
[noscript] void updateWindowTimeStamp(in nsIXULWindow aWindow); [noscript] void updateWindowTimeStamp(in nsIAppWindow aWindow);
/* z-ordering: */ /* z-ordering: */
@@ -120,8 +120,8 @@ interface nsIWindowMediator: nsISupports
* it should be constrained. Note this method is advisory only: * it should be constrained. Note this method is advisory only:
* it changes nothing either in WindowMediator's internal state * it changes nothing either in WindowMediator's internal state
* or with the window. * or with the window.
* Note it compares the nsIXULWindow to nsIWidgets. A pure interface * Note it compares the nsIAppWindow to nsIWidgets. A pure interface
* would use all nsIXULWindows. But we expect this to be called from * would use all nsIAppWindows. But we expect this to be called from
* callbacks originating in native window code. They are expected to * callbacks originating in native window code. They are expected to
* hand us comparison values which are pulled from general storage * hand us comparison values which are pulled from general storage
* in the native widget, and may not correspond to an nsIWidget at all. * in the native widget, and may not correspond to an nsIWidget at all.
@@ -146,7 +146,7 @@ interface nsIWindowMediator: nsISupports
* the position given. * the position given.
*/ */
[noscript] boolean calculateZPosition(in nsIXULWindow inWindow, [noscript] boolean calculateZPosition(in nsIAppWindow inWindow,
in unsigned long inPosition, in unsigned long inPosition,
in nsIWidget inBelow, in nsIWidget inBelow,
out unsigned long outPosition, out unsigned long outPosition,
@@ -161,24 +161,24 @@ interface nsIWindowMediator: nsISupports
* for other values of inPosition.) * for other values of inPosition.)
* @param inBelow the window inWindow is behind, if zLevelBelow * @param inBelow the window inWindow is behind, if zLevelBelow
*/ */
[noscript] void setZPosition(in nsIXULWindow inWindow, [noscript] void setZPosition(in nsIAppWindow inWindow,
in unsigned long inPosition, in unsigned long inPosition,
in nsIXULWindow inBelow); in nsIAppWindow inBelow);
/** Return the window's Z level (as defined in nsIXULWindow). /** Return the window's Z level (as defined in nsIAppWindow).
* @param aWindow the window in question * @param aWindow the window in question
* @return aWindow's z level * @return aWindow's z level
*/ */
[noscript] uint32_t getZLevel(in nsIXULWindow aWindow); [noscript] uint32_t getZLevel(in nsIAppWindow aWindow);
/** Set the window's Z level (as defined in nsIXULWindow). The implementation /** Set the window's Z level (as defined in nsIAppWindow). The implementation
* will reposition the window as necessary to match its new Z level. * will reposition the window as necessary to match its new Z level.
* The implementation will assume a window's Z level to be * The implementation will assume a window's Z level to be
* nsIXULWindow::normalZ until it has been informed of a different level. * nsIAppWindow::normalZ until it has been informed of a different level.
* @param aWindow the window in question * @param aWindow the window in question
* @param aZLevel the window's new Z level * @param aZLevel the window's new Z level
*/ */
[noscript] void setZLevel(in nsIXULWindow aWindow, in uint32_t aZLevel); [noscript] void setZLevel(in nsIAppWindow aWindow, in uint32_t aZLevel);
/** Register a listener for window status changes. /** Register a listener for window status changes.
* keeps strong ref? (to be decided) * keeps strong ref? (to be decided)

View File

@@ -5,12 +5,12 @@
#include "nsISupports.idl" #include "nsISupports.idl"
interface nsIXULWindow; interface nsIAppWindow;
[scriptable, uuid(2F276982-0D60-4377-A595-D350BA516395)] [scriptable, uuid(2F276982-0D60-4377-A595-D350BA516395)]
interface nsIWindowMediatorListener : nsISupports interface nsIWindowMediatorListener : nsISupports
{ {
void onOpenWindow(in nsIXULWindow window); void onOpenWindow(in nsIAppWindow window);
void onCloseWindow(in nsIXULWindow window); void onCloseWindow(in nsIAppWindow window);
}; };

View File

@@ -21,12 +21,12 @@
#include "nsIDocShell.h" #include "nsIDocShell.h"
#include "nsIInterfaceRequestor.h" #include "nsIInterfaceRequestor.h"
#include "nsIInterfaceRequestorUtils.h" #include "nsIInterfaceRequestorUtils.h"
#include "nsIXULWindow.h" #include "nsIAppWindow.h"
using namespace mozilla; using namespace mozilla;
nsresult nsWindowMediator::GetDOMWindow( nsresult nsWindowMediator::GetDOMWindow(
nsIXULWindow* inWindow, nsCOMPtr<nsPIDOMWindowOuter>& outDOMWindow) { nsIAppWindow* inWindow, nsCOMPtr<nsPIDOMWindowOuter>& outDOMWindow) {
nsCOMPtr<nsIDocShell> docShell; nsCOMPtr<nsIDocShell> docShell;
outDOMWindow = nullptr; outDOMWindow = nullptr;
@@ -61,7 +61,7 @@ nsresult nsWindowMediator::Init() {
return NS_OK; return NS_OK;
} }
NS_IMETHODIMP nsWindowMediator::RegisterWindow(nsIXULWindow* inWindow) { NS_IMETHODIMP nsWindowMediator::RegisterWindow(nsIAppWindow* inWindow) {
MOZ_RELEASE_ASSERT(NS_IsMainThread()); MOZ_RELEASE_ASSERT(NS_IsMainThread());
NS_ENSURE_STATE(mReady); NS_ENSURE_STATE(mReady);
@@ -89,7 +89,7 @@ NS_IMETHODIMP nsWindowMediator::RegisterWindow(nsIXULWindow* inWindow) {
} }
NS_IMETHODIMP NS_IMETHODIMP
nsWindowMediator::UnregisterWindow(nsIXULWindow* inWindow) { nsWindowMediator::UnregisterWindow(nsIAppWindow* inWindow) {
MOZ_RELEASE_ASSERT(NS_IsMainThread()); MOZ_RELEASE_ASSERT(NS_IsMainThread());
NS_ENSURE_STATE(mReady); NS_ENSURE_STATE(mReady);
nsWindowInfo* info = GetInfoFor(inWindow); nsWindowInfo* info = GetInfoFor(inWindow);
@@ -105,7 +105,7 @@ nsresult nsWindowMediator::UnregisterWindow(nsWindowInfo* inInfo) {
index++; index++;
} }
nsIXULWindow* window = inInfo->mWindow.get(); nsIAppWindow* window = inInfo->mWindow.get();
ListenerArray::ForwardIterator iter(mListeners); ListenerArray::ForwardIterator iter(mListeners);
while (iter.HasMore()) { while (iter.HasMore()) {
iter.GetNext()->OnCloseWindow(window); iter.GetNext()->OnCloseWindow(window);
@@ -122,7 +122,7 @@ nsresult nsWindowMediator::UnregisterWindow(nsWindowInfo* inInfo) {
return NS_OK; return NS_OK;
} }
nsWindowInfo* nsWindowMediator::GetInfoFor(nsIXULWindow* aWindow) { nsWindowInfo* nsWindowMediator::GetInfoFor(nsIAppWindow* aWindow) {
nsWindowInfo *info, *listEnd; nsWindowInfo *info, *listEnd;
if (!aWindow) return nullptr; if (!aWindow) return nullptr;
@@ -170,20 +170,20 @@ nsWindowMediator::GetEnumerator(const char16_t* inType,
} }
NS_IMETHODIMP NS_IMETHODIMP
nsWindowMediator::GetXULWindowEnumerator(const char16_t* inType, nsWindowMediator::GetAppWindowEnumerator(const char16_t* inType,
nsISimpleEnumerator** outEnumerator) { nsISimpleEnumerator** outEnumerator) {
MOZ_RELEASE_ASSERT(NS_IsMainThread()); MOZ_RELEASE_ASSERT(NS_IsMainThread());
NS_ENSURE_ARG_POINTER(outEnumerator); NS_ENSURE_ARG_POINTER(outEnumerator);
NS_ENSURE_STATE(mReady); NS_ENSURE_STATE(mReady);
RefPtr<nsAppShellWindowEnumerator> enumerator = RefPtr<nsAppShellWindowEnumerator> enumerator =
new nsASXULWindowEarlyToLateEnumerator(inType, *this); new nsASAppWindowEarlyToLateEnumerator(inType, *this);
enumerator.forget(outEnumerator); enumerator.forget(outEnumerator);
return NS_OK; return NS_OK;
} }
NS_IMETHODIMP NS_IMETHODIMP
nsWindowMediator::GetZOrderXULWindowEnumerator(const char16_t* aWindowType, nsWindowMediator::GetZOrderAppWindowEnumerator(const char16_t* aWindowType,
bool aFrontToBack, bool aFrontToBack,
nsISimpleEnumerator** _retval) { nsISimpleEnumerator** _retval) {
MOZ_RELEASE_ASSERT(NS_IsMainThread()); MOZ_RELEASE_ASSERT(NS_IsMainThread());
@@ -192,9 +192,9 @@ nsWindowMediator::GetZOrderXULWindowEnumerator(const char16_t* aWindowType,
RefPtr<nsAppShellWindowEnumerator> enumerator; RefPtr<nsAppShellWindowEnumerator> enumerator;
if (aFrontToBack) if (aFrontToBack)
enumerator = new nsASXULWindowFrontToBackEnumerator(aWindowType, *this); enumerator = new nsASAppWindowFrontToBackEnumerator(aWindowType, *this);
else else
enumerator = new nsASXULWindowBackToFrontEnumerator(aWindowType, *this); enumerator = new nsASAppWindowBackToFrontEnumerator(aWindowType, *this);
enumerator.forget(_retval); enumerator.forget(_retval);
return NS_OK; return NS_OK;
@@ -344,7 +344,7 @@ nsWindowMediator::GetCurrentInnerWindowWithId(uint64_t aWindowID,
} }
NS_IMETHODIMP NS_IMETHODIMP
nsWindowMediator::UpdateWindowTimeStamp(nsIXULWindow* inWindow) { nsWindowMediator::UpdateWindowTimeStamp(nsIAppWindow* inWindow) {
MOZ_RELEASE_ASSERT(NS_IsMainThread()); MOZ_RELEASE_ASSERT(NS_IsMainThread());
NS_ENSURE_STATE(mReady); NS_ENSURE_STATE(mReady);
nsWindowInfo* info = GetInfoFor(inWindow); nsWindowInfo* info = GetInfoFor(inWindow);
@@ -363,7 +363,7 @@ nsWindowMediator::UpdateWindowTimeStamp(nsIXULWindow* inWindow) {
calculate a change as seldom as possible. calculate a change as seldom as possible.
*/ */
NS_IMETHODIMP NS_IMETHODIMP
nsWindowMediator::CalculateZPosition(nsIXULWindow* inWindow, nsWindowMediator::CalculateZPosition(nsIAppWindow* inWindow,
uint32_t inPosition, nsIWidget* inBelow, uint32_t inPosition, nsIWidget* inBelow,
uint32_t* outPosition, uint32_t* outPosition,
nsIWidget** outBelow, bool* outAltered) { nsIWidget** outBelow, bool* outAltered) {
@@ -381,7 +381,7 @@ nsWindowMediator::CalculateZPosition(nsIXULWindow* inWindow,
return NS_ERROR_INVALID_ARG; return NS_ERROR_INVALID_ARG;
nsWindowInfo* info = mTopmostWindow; nsWindowInfo* info = mTopmostWindow;
nsIXULWindow* belowWindow = nullptr; nsIAppWindow* belowWindow = nullptr;
bool found = false; bool found = false;
nsresult result = NS_OK; nsresult result = NS_OK;
@@ -486,8 +486,8 @@ nsWindowMediator::CalculateZPosition(nsIXULWindow* inWindow,
} }
NS_IMETHODIMP NS_IMETHODIMP
nsWindowMediator::SetZPosition(nsIXULWindow* inWindow, uint32_t inPosition, nsWindowMediator::SetZPosition(nsIAppWindow* inWindow, uint32_t inPosition,
nsIXULWindow* inBelow) { nsIAppWindow* inBelow) {
MOZ_RELEASE_ASSERT(NS_IsMainThread()); MOZ_RELEASE_ASSERT(NS_IsMainThread());
nsWindowInfo *inInfo, *belowInfo; nsWindowInfo *inInfo, *belowInfo;
@@ -539,9 +539,9 @@ nsWindowMediator::SetZPosition(nsIXULWindow* inWindow, uint32_t inPosition,
} }
NS_IMETHODIMP NS_IMETHODIMP
nsWindowMediator::GetZLevel(nsIXULWindow* aWindow, uint32_t* _retval) { nsWindowMediator::GetZLevel(nsIAppWindow* aWindow, uint32_t* _retval) {
NS_ENSURE_ARG_POINTER(_retval); NS_ENSURE_ARG_POINTER(_retval);
*_retval = nsIXULWindow::normalZ; *_retval = nsIAppWindow::normalZ;
// This can fail during window destruction. // This can fail during window destruction.
nsWindowInfo* info = GetInfoFor(aWindow); nsWindowInfo* info = GetInfoFor(aWindow);
if (info) { if (info) {
@@ -551,7 +551,7 @@ nsWindowMediator::GetZLevel(nsIXULWindow* aWindow, uint32_t* _retval) {
} }
NS_IMETHODIMP NS_IMETHODIMP
nsWindowMediator::SetZLevel(nsIXULWindow* aWindow, uint32_t aZLevel) { nsWindowMediator::SetZLevel(nsIAppWindow* aWindow, uint32_t aZLevel) {
MOZ_RELEASE_ASSERT(NS_IsMainThread()); MOZ_RELEASE_ASSERT(NS_IsMainThread());
NS_ENSURE_STATE(mReady); NS_ENSURE_STATE(mReady);

View File

@@ -15,10 +15,10 @@
#include "nsTObserverArray.h" #include "nsTObserverArray.h"
class nsAppShellWindowEnumerator; class nsAppShellWindowEnumerator;
class nsASXULWindowEarlyToLateEnumerator; class nsASAppWindowEarlyToLateEnumerator;
class nsASDOMWindowEarlyToLateEnumerator; class nsASDOMWindowEarlyToLateEnumerator;
class nsASXULWindowFrontToBackEnumerator; class nsASAppWindowFrontToBackEnumerator;
class nsASXULWindowBackToFrontEnumerator; class nsASAppWindowBackToFrontEnumerator;
class nsIWindowMediatorListener; class nsIWindowMediatorListener;
struct nsWindowInfo; struct nsWindowInfo;
@@ -26,10 +26,10 @@ class nsWindowMediator : public nsIWindowMediator,
public nsIObserver, public nsIObserver,
public nsSupportsWeakReference { public nsSupportsWeakReference {
friend class nsAppShellWindowEnumerator; friend class nsAppShellWindowEnumerator;
friend class nsASXULWindowEarlyToLateEnumerator; friend class nsASAppWindowEarlyToLateEnumerator;
friend class nsASDOMWindowEarlyToLateEnumerator; friend class nsASDOMWindowEarlyToLateEnumerator;
friend class nsASXULWindowFrontToBackEnumerator; friend class nsASAppWindowFrontToBackEnumerator;
friend class nsASXULWindowBackToFrontEnumerator; friend class nsASAppWindowBackToFrontEnumerator;
protected: protected:
virtual ~nsWindowMediator(); virtual ~nsWindowMediator();
@@ -43,7 +43,7 @@ class nsWindowMediator : public nsIWindowMediator,
NS_DECL_NSIWINDOWMEDIATOR NS_DECL_NSIWINDOWMEDIATOR
NS_DECL_NSIOBSERVER NS_DECL_NSIOBSERVER
static nsresult GetDOMWindow(nsIXULWindow* inWindow, static nsresult GetDOMWindow(nsIAppWindow* inWindow,
nsCOMPtr<nsPIDOMWindowOuter>& outDOMWindow); nsCOMPtr<nsPIDOMWindowOuter>& outDOMWindow);
private: private:
@@ -53,7 +53,7 @@ class nsWindowMediator : public nsIWindowMediator,
bool aSkipPrivateBrowsingOrClosed = false); bool aSkipPrivateBrowsingOrClosed = false);
nsresult UnregisterWindow(nsWindowInfo* inInfo); nsresult UnregisterWindow(nsWindowInfo* inInfo);
nsWindowInfo* GetInfoFor(nsIXULWindow* aWindow); nsWindowInfo* GetInfoFor(nsIAppWindow* aWindow);
nsWindowInfo* GetInfoFor(nsIWidget* aWindow); nsWindowInfo* GetInfoFor(nsIWidget* aWindow);
void SortZOrderFrontToBack(); void SortZOrderFrontToBack();
void SortZOrderBackToFront(); void SortZOrderBackToFront();