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

--HG--
rename : xpfe/appshell/nsXULWindow.cpp => xpfe/appshell/AppWindow.cpp
rename : xpfe/appshell/nsXULWindow.h => xpfe/appshell/AppWindow.h
rename : xpfe/appshell/nsIXULWindow.idl => xpfe/appshell/nsIAppWindow.idl
extra : moz-landing-system : lando
This commit is contained in:
Brendan Dahl 2019-11-04 16:52:35 +00:00
Родитель e99dc7d58d
Коммит 247b257cfa
69 изменённых файлов: 833 добавлений и 835 удалений

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

@ -45,7 +45,7 @@
#include "nsGlobalWindow.h"
#ifdef MOZ_XUL
# include "nsIXULWindow.h"
# include "nsIAppWindow.h"
#endif
using namespace mozilla;
@ -97,18 +97,18 @@ role RootAccessible::NativeRole() const {
uint32_t RootAccessible::GetChromeFlags() const {
// Return the flag set for the top level window as defined
// 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);
NS_ENSURE_TRUE(docShell, 0);
nsCOMPtr<nsIDocShellTreeOwner> treeOwner;
docShell->GetTreeOwner(getter_AddRefs(treeOwner));
NS_ENSURE_TRUE(treeOwner, 0);
nsCOMPtr<nsIXULWindow> xulWin(do_GetInterface(treeOwner));
if (!xulWin) {
nsCOMPtr<nsIAppWindow> appWin(do_GetInterface(treeOwner));
if (!appWin) {
return 0;
}
uint32_t chromeFlags;
xulWin->GetChromeFlags(&chromeFlags);
appWin->GetChromeFlags(&chromeFlags);
return chromeFlags;
}
#endif

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

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

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

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

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

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

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

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

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

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

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

@ -2,7 +2,7 @@
/**
* 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
* both the window's nsILoadContext, as well as on the initial
* browser's content docShell nsILoadContext.
@ -15,7 +15,7 @@ function assertWindowIsPrivate(win) {
let winDocShell = win.docShell;
let chromeFlags = winDocShell.treeOwner
.QueryInterface(Ci.nsIInterfaceRequestor)
.getInterface(Ci.nsIXULWindow).chromeFlags;
.getInterface(Ci.nsIAppWindow).chromeFlags;
if (!win.gBrowser.selectedBrowser.hasContentOpener) {
Assert.ok(

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

@ -244,10 +244,10 @@ class TelemetryHandler {
* This is called when a new window is opened, and handles registration of
* 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) {
let win = xulWin.docShell.domWindow;
onOpenWindow(appWin) {
let win = appWin.docShell.domWindow;
win.addEventListener(
"load",
() => {
@ -268,10 +268,10 @@ class TelemetryHandler {
* Listener that is called when a window is closed, and handles deregistration of
* 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) {
let win = xulWin.docShell.domWindow;
onCloseWindow(appWin) {
let win = appWin.docShell.domWindow;
if (
win.document.documentElement.getAttribute("windowtype") !=

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

@ -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
* (and hope for reasonable values when maximized/minimized - since then
* 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
// to store the outer size, so add the difference.
let xulWin = aWindow.docShell.treeOwner
let appWin = aWindow.docShell.treeOwner
.QueryInterface(Ci.nsIInterfaceRequestor)
.getInterface(Ci.nsIXULWindow);
.getInterface(Ci.nsIAppWindow);
let diff =
aAttribute == "width"
? xulWin.outerToInnerWidthDifferenceInCSSPixels
: xulWin.outerToInnerHeightDifferenceInCSSPixels;
? appWin.outerToInnerWidthDifferenceInCSSPixels
: appWin.outerToInnerHeightDifferenceInCSSPixels;
return attr + diff;
}
}

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

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

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

@ -289,12 +289,12 @@ BrowserTabList.prototype._getChildren = function(window) {
};
BrowserTabList.prototype.getList = function(browserActorOptions) {
const topXULWindow = Services.wm.getMostRecentWindow(
const topAppWindow = Services.wm.getMostRecentWindow(
DebuggerServer.chromeWindowType
);
let selectedBrowser = null;
if (topXULWindow) {
selectedBrowser = this._getSelectedBrowser(topXULWindow);
if (topAppWindow) {
selectedBrowser = this._getSelectedBrowser(topAppWindow);
}
// 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
);
if (topXULWindow) {
const selectedBrowser = this._getSelectedBrowser(topXULWindow);
if (topAppWindow) {
const selectedBrowser = this._getSelectedBrowser(topAppWindow);
return this._getActorForBrowser(selectedBrowser, browserActorOptions);
}
return Promise.reject({
@ -781,7 +781,7 @@ BrowserTabList.prototype.onOpenWindow = DevToolsUtils.makeInfallible(function(
BrowserTabList.prototype.onCloseWindow = DevToolsUtils.makeInfallible(function(
window
) {
if (window instanceof Ci.nsIXULWindow) {
if (window instanceof Ci.nsIAppWindow) {
window = window.docShell.domWindow;
}

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

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

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

@ -360,7 +360,7 @@ nsDocShellTreeOwner::SizeShellTo(nsIDocShellTreeItem* aShellItem, int32_t aCX,
if (browserChild) {
// 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
// nsXULWindow::SizeShellTo, so let's send the width and height of
// AppWindow::SizeShellTo, so let's send the width and height of
// aShellItem too.
nsCOMPtr<nsIBaseWindow> shellAsWin(do_QueryInterface(aShellItem));
NS_ENSURE_TRUE(shellAsWin, NS_ERROR_FAILURE);
@ -588,7 +588,7 @@ nsDocShellTreeOwner::SetParentNativeWindow(nativeWindow aParentNativeWindow) {
NS_IMETHODIMP
nsDocShellTreeOwner::GetNativeHandle(nsAString& aNativeHandle) {
// the nativeHandle should be accessed from nsIXULWindow
// the nativeHandle should be accessed from nsIAppWindow
return NS_ERROR_NOT_IMPLEMENTED;
}

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

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

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

@ -312,7 +312,7 @@
#ifdef MOZ_XUL
# include "mozilla/dom/XULBroadcastManager.h"
# include "mozilla/dom/XULPersist.h"
# include "nsIXULWindow.h"
# include "nsIAppWindow.h"
# include "nsIChromeRegistry.h"
# include "nsXULPrototypeDocument.h"
# include "nsXULCommandDispatcher.h"
@ -8377,7 +8377,7 @@ void Document::SetMayStartLayout(bool aMayStartLayout) {
// 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
// the whole tree after StartLayout.
if (nsCOMPtr<nsIXULWindow> win = GetXULWindowIfToplevelChrome()) {
if (nsCOMPtr<nsIAppWindow> win = GetAppWindowIfToplevelChrome()) {
// We're the chrome document!
win->BeforeStartLayout();
}
@ -14271,23 +14271,23 @@ already_AddRefed<XPathResult> Document::Evaluate(
aType, aResult, rv);
}
already_AddRefed<nsIXULWindow> Document::GetXULWindowIfToplevelChrome() const {
already_AddRefed<nsIAppWindow> Document::GetAppWindowIfToplevelChrome() const {
nsCOMPtr<nsIDocShellTreeItem> item = GetDocShell();
if (!item) {
return nullptr;
}
nsCOMPtr<nsIDocShellTreeOwner> owner;
item->GetTreeOwner(getter_AddRefs(owner));
nsCOMPtr<nsIXULWindow> xulWin = do_GetInterface(owner);
if (!xulWin) {
nsCOMPtr<nsIAppWindow> appWin = do_GetInterface(owner);
if (!appWin) {
return nullptr;
}
nsCOMPtr<nsIDocShell> xulWinShell;
xulWin->GetDocShell(getter_AddRefs(xulWinShell));
if (!SameCOMIdentity(xulWinShell, item)) {
nsCOMPtr<nsIDocShell> appWinShell;
appWin->GetDocShell(getter_AddRefs(appWinShell));
if (!SameCOMIdentity(appWinShell, item)) {
return nullptr;
}
return xulWin.forget();
return appWin.forget();
}
Document* Document::GetTopLevelContentDocument() {

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

@ -133,7 +133,7 @@ class nsWindowSizes;
class nsDOMCaretPosition;
class nsViewportInfo;
class nsIGlobalObject;
class nsIXULWindow;
class nsIAppWindow;
class nsXULPrototypeDocument;
class nsXULPrototypeElement;
class PermissionDelegateHandler;
@ -3536,9 +3536,9 @@ class Document : public nsINode,
Document* GetTopLevelContentDocument();
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.
already_AddRefed<nsIXULWindow> GetXULWindowIfToplevelChrome() const;
already_AddRefed<nsIAppWindow> GetAppWindowIfToplevelChrome() const;
already_AddRefed<Element> CreateElement(
const nsAString& aTagName, const ElementCreationOptionsOrString& aOptions,

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

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

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

@ -24,7 +24,7 @@
#include "nsIWebNavigation.h"
#include "nsCaret.h"
#include "nsIBaseWindow.h"
#include "nsIXULWindow.h"
#include "nsIAppWindow.h"
#include "nsViewManager.h"
#include "nsFrameSelection.h"
#include "mozilla/dom/Document.h"
@ -700,10 +700,10 @@ nsFocusManager::WindowRaised(mozIDOMWindowProxy* aWindow) {
NS_ASSERTION(currentWindow, "window raised with no window current");
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.
nsCOMPtr<nsIXULWindow> xulWin(do_GetInterface(baseWindow));
Focus(currentWindow, currentFocus, 0, true, false, xulWin != nullptr, true);
nsCOMPtr<nsIAppWindow> appWin(do_GetInterface(baseWindow));
Focus(currentWindow, currentFocus, 0, true, false, appWin != nullptr, true);
return NS_OK;
}

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

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

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

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

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

@ -154,7 +154,7 @@
#include "mozilla/EventStateManager.h"
#include "nsIObserverService.h"
#include "nsFocusManager.h"
#include "nsIXULWindow.h"
#include "nsIAppWindow.h"
#include "nsITimedChannel.h"
#include "nsServiceManagerUtils.h"
#include "mozilla/dom/CustomEvent.h"
@ -1546,7 +1546,7 @@ void nsGlobalWindowOuter::SetInitialPrincipalToSubject(
// 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
// 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) ||
(nsContentUtils::IsSystemPrincipal(newWindowPrincipal) &&
GetDocShell()->ItemType() != nsIDocShellTreeItem::typeChrome)) {
@ -4404,9 +4404,9 @@ nsresult nsGlobalWindowOuter::SetFullscreenInternal(FullscreenReason aReason,
// Prevent chrome documents which are still loading from resizing
// the window after we set fullscreen mode.
nsCOMPtr<nsIBaseWindow> treeOwnerAsWin = GetTreeOwnerWindow();
nsCOMPtr<nsIXULWindow> xulWin(do_GetInterface(treeOwnerAsWin));
if (aFullscreen && xulWin) {
xulWin->SetIntrinsicallySized(false);
nsCOMPtr<nsIAppWindow> appWin(do_GetInterface(treeOwnerAsWin));
if (aFullscreen && appWin) {
appWin->SetIntrinsicallySized(false);
}
// 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
nsCOMPtr<nsPIDOMWindowOuter> topLevelWindow;
// widgetListener should be a nsXULWindow
// widgetListener should be an AppWindow
nsIWidgetListener* listener = topLevelWidget->GetWidgetListener();
if (listener) {
nsCOMPtr<nsIXULWindow> window = listener->GetXULWindow();
nsCOMPtr<nsIAppWindow> window = listener->GetAppWindow();
nsCOMPtr<nsIInterfaceRequestor> req(do_QueryInterface(window));
topLevelWindow = do_GetInterface(req);
}

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

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

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

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

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

@ -13,7 +13,7 @@
# include "nsIStringEnumerator.h"
#endif
#include "nsIXULWindow.h"
#include "nsIAppWindow.h"
namespace mozilla {
namespace dom {
@ -25,12 +25,12 @@ static bool IsRootElement(Element* aElement) {
static bool ShouldPersistAttribute(Element* aElement, nsAtom* aAttribute) {
if (IsRootElement(aElement)) {
// 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()) {
return true;
}
// 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 ||
aAttribute == nsGkAtoms::width || aAttribute == nsGkAtoms::height ||
aAttribute == nsGkAtoms::sizemode) {
@ -66,7 +66,7 @@ void XULPersist::AttributeChanged(dom::Element* aElement, int32_t aNameSpaceID,
//
// XXX Namespace handling broken :-(
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) &&
ShouldPersistAttribute(aElement, aAttribute) && !persist.IsEmpty() &&
// 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;
}
// Persisting attributes to top level windows is handled by nsXULWindow.
// Persisting attributes to top level windows is handled by AppWindow.
if (IsRootElement(aElement)) {
if (nsCOMPtr<nsIXULWindow> win =
mDocument->GetXULWindowIfToplevelChrome()) {
if (nsCOMPtr<nsIAppWindow> win =
mDocument->GetAppWindowIfToplevelChrome()) {
return;
}
}
@ -300,10 +300,10 @@ nsresult XULPersist::ApplyPersistentAttributesToElements(
}
// Applying persistent attributes to top level windows is handled
// by nsXULWindow.
// by AppWindow.
if (IsRootElement(element)) {
if (nsCOMPtr<nsIXULWindow> win =
mDocument->GetXULWindowIfToplevelChrome()) {
if (nsCOMPtr<nsIAppWindow> win =
mDocument->GetAppWindowIfToplevelChrome()) {
continue;
}
}

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

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

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

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

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

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

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

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

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

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

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

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

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

@ -138,7 +138,7 @@ function getPromptState(ui) {
// We can't just check window.opener because that'll be
// a content window, which therefore isn't exposed (it'll lie and
// 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.dialog = (flags & Ci.nsIWebBrowserChrome.CHROME_OPENAS_DIALOG) != 0;
state.chromeDependent =

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

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

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

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

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

@ -71,7 +71,7 @@
#include "mozilla/dom/BrowserHost.h"
#include "mozilla/dom/DocGroup.h"
#include "mozilla/dom/TabGroup.h"
#include "nsIXULWindow.h"
#include "nsIAppWindow.h"
#include "nsIXULBrowserWindow.h"
#include "nsGlobalWindow.h"
#include "ReferrerInfo.h"
@ -911,17 +911,17 @@ nsresult nsWindowWatcher::OpenWindowInternal(
}
if (newChrome) {
nsCOMPtr<nsIXULWindow> xulWin = do_GetInterface(newChrome);
if (xulWin) {
nsCOMPtr<nsIAppWindow> appWin = do_GetInterface(newChrome);
if (appWin) {
nsCOMPtr<nsIXULBrowserWindow> xulBrowserWin;
xulWin->GetXULBrowserWindow(getter_AddRefs(xulBrowserWin));
appWin->GetXULBrowserWindow(getter_AddRefs(xulBrowserWin));
if (xulBrowserWin) {
nsPIDOMWindowOuter* openerWindow =
aForceNoOpener ? nullptr : parentWindow.get();
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
be able to hand over an nsIDocShellTreeItem directly. */
nsCOMPtr<nsPIDOMWindowOuter> newWindow(do_GetInterface(newChrome));
@ -2372,9 +2372,9 @@ void nsWindowWatcher::SizeOpenedWindow(nsIDocShellTreeOwner* aTreeOwner,
}
if (aIsCallerChrome) {
nsCOMPtr<nsIXULWindow> xulWin = do_GetInterface(treeOwnerAsWin);
if (xulWin && aSizeSpec.mLockAspectRatio) {
xulWin->LockAspectRatio(true);
nsCOMPtr<nsIAppWindow> appWin = do_GetInterface(treeOwnerAsWin);
if (appWin && aSizeSpec.mLockAspectRatio) {
appWin->LockAspectRatio(true);
}
}

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

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

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

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

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

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

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

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

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

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

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

@ -142,7 +142,7 @@ XULStore.prototype = {
const value = node.getAttribute(attr);
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;
}

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

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

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

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

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

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

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

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

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

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

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

@ -19,7 +19,7 @@
#include "nsIAppShellService.h"
#include "nsIBaseWindow.h"
#include "nsIInterfaceRequestorUtils.h"
#include "nsIXULWindow.h"
#include "nsIAppWindow.h"
#include "nsToolkit.h"
#include "nsTouchBarNativeAPIDefines.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
// do this, for the following reason: The OS runs modal non-sheet windows
// 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
// the same time as other (similar) event loops).
if (mWindowType != eWindowType_sheet) {
@ -1653,7 +1653,7 @@ void nsCocoaWindow::BackingScaleFactorChanged() {
mBackingScaleFactor = newScale;
if (!mWidgetListener || mWidgetListener->GetXULWindow()) {
if (!mWidgetListener || mWidgetListener->GetAppWindow()) {
return;
}

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

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

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

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

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

@ -16,7 +16,7 @@
class nsView;
class nsIWidget;
class nsIXULWindow;
class nsIAppWindow;
namespace mozilla {
class PresShell;
@ -45,11 +45,11 @@ enum nsWindowZ {
class nsIWidgetListener {
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
* 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.

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

@ -16,7 +16,7 @@
#include "nsIRunnable.h"
#include "nsIURI.h"
#include "nsIWebBrowserChrome.h"
#include "nsIXULWindow.h"
#include "nsIAppWindow.h"
#include "nsAppShellCID.h"
#include "nsIInterfaceRequestorUtils.h"
@ -361,14 +361,14 @@ bool Test4Internal(nsIAppShell* aAppShell) {
uint32_t flags = nsIWebBrowserChrome::CHROME_DEFAULT;
nsCOMPtr<nsIXULWindow> xulWindow;
nsCOMPtr<nsIAppWindow> appWindow;
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");
return false;
}
nsCOMPtr<nsIDOMWindow> window = do_GetInterface(xulWindow);
nsCOMPtr<nsIDOMWindow> window = do_GetInterface(appWindow);
if (!window) {
fail("Can't get dom window!");
return false;

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

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

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

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

Разница между файлами не показана из-за своего большого размера Загрузить разницу

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

@ -4,8 +4,8 @@
* 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/. */
#ifndef nsXULWindow_h__
#define nsXULWindow_h__
#ifndef mozilla_AppWindow_h__
#define mozilla_AppWindow_h__
// Local Includes
#include "nsChromeTreeOwner.h"
@ -27,7 +27,7 @@
#include "nsIDocShellTreeItem.h"
#include "nsIInterfaceRequestor.h"
#include "nsIInterfaceRequestorUtils.h"
#include "nsIXULWindow.h"
#include "nsIAppWindow.h"
#include "nsIPrompt.h"
#include "nsIAuthPrompt.h"
#include "nsIXULBrowserWindow.h"
@ -52,12 +52,12 @@ struct nsWidgetInitData;
namespace mozilla {
class PresShell;
class nsXULWindowTimerCallback;
class AppWindowTimerCallback;
} // namespace mozilla
// nsXULWindow
// AppWindow
#define NS_XULWINDOW_IMPL_CID \
#define NS_APPWINDOW_IMPL_CID \
{ /* 8eaec2f3-ed02-4be2-8e0f-342798477298 */ \
0x8eaec2f3, 0xed02, 0x4be2, { \
0x8e, 0x0f, 0x34, 0x27, 0x98, 0x47, 0x72, 0x98 \
@ -66,25 +66,27 @@ class nsXULWindowTimerCallback;
class nsContentShellInfo;
class nsXULWindow final : public nsIBaseWindow,
public nsIInterfaceRequestor,
public nsIXULWindow,
public nsSupportsWeakReference,
public nsIWebProgressListener {
friend class nsChromeTreeOwner;
friend class nsContentTreeOwner;
namespace mozilla {
class AppWindow final : public nsIBaseWindow,
public nsIInterfaceRequestor,
public nsIAppWindow,
public nsSupportsWeakReference,
public nsIWebProgressListener {
friend class ::nsChromeTreeOwner;
friend class ::nsContentTreeOwner;
public:
// 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.
class WidgetListenerDelegate : public nsIWidgetListener {
public:
explicit WidgetListenerDelegate(nsXULWindow* aXULWindow)
: mXULWindow(aXULWindow) {}
explicit WidgetListenerDelegate(AppWindow* aAppWindow)
: mAppWindow(aAppWindow) {}
MOZ_CAN_RUN_SCRIPT_BOUNDARY
virtual nsIXULWindow* GetXULWindow() override;
virtual nsIAppWindow* GetAppWindow() override;
MOZ_CAN_RUN_SCRIPT_BOUNDARY
virtual mozilla::PresShell* GetPresShell() override;
MOZ_CAN_RUN_SCRIPT_BOUNDARY
@ -116,26 +118,26 @@ class nsXULWindow final : public nsIBaseWindow,
virtual void WindowDeactivated() override;
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.
nsXULWindow* mXULWindow;
AppWindow* mAppWindow;
};
NS_DECL_THREADSAFE_ISUPPORTS
NS_DECL_NSIINTERFACEREQUESTOR
NS_DECL_NSIXULWINDOW
NS_DECL_NSIAPPWINDOW
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; }
bool IsLocked() const { return mLockedUntilChromeLoad; }
void IgnoreXULSizeMode(bool aEnable) { mIgnoreXULSizeMode = aEnable; }
void WasRegistered() { mRegistered = true; }
// nsXULWindow methods...
nsresult Initialize(nsIXULWindow* aParent, nsIXULWindow* aOpener,
// AppWindow methods...
nsresult Initialize(nsIAppWindow* aParent, nsIAppWindow* aOpener,
nsIURI* aUrl, int32_t aInitialWidth,
int32_t aInitialHeight, bool aIsHiddenWindow,
nsIRemoteTab* aOpeningTab,
@ -148,7 +150,7 @@ class nsXULWindow final : public nsIBaseWindow,
NS_DECL_NSIWEBPROGRESSLISTENER
// nsIWidgetListener methods for WidgetListenerDelegate.
nsIXULWindow* GetXULWindow() { return this; }
nsIAppWindow* GetAppWindow() { return this; }
mozilla::PresShell* GetPresShell();
MOZ_CAN_RUN_SCRIPT
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 WindowDeactivated();
explicit nsXULWindow(uint32_t aChromeFlags);
explicit AppWindow(uint32_t aChromeFlags);
protected:
enum persistentAttributes {
@ -176,9 +178,9 @@ class nsXULWindow final : public nsIBaseWindow,
PAD_SIZE = 0x4
};
virtual ~nsXULWindow();
virtual ~AppWindow();
friend class mozilla::nsXULWindowTimerCallback;
friend class mozilla::AppWindowTimerCallback;
bool ExecuteCloseHandler();
void ConstrainToOpenerScreen(int32_t* aX, int32_t* aY);
@ -227,19 +229,19 @@ class nsXULWindow final : public nsIBaseWindow,
NS_IMETHOD CreateNewChromeWindow(int32_t aChromeFlags,
nsIRemoteTab* aOpeningTab,
mozIDOMWindowProxy* aOpenerWindow,
nsIXULWindow** _retval);
nsIAppWindow** _retval);
NS_IMETHOD CreateNewContentWindow(int32_t aChromeFlags,
nsIRemoteTab* aOpeningTab,
mozIDOMWindowProxy* aOpenerWindow,
uint64_t aNextRemoteTabId,
nsIXULWindow** _retval);
nsIAppWindow** _retval);
NS_IMETHOD GetHasPrimaryContent(bool* aResult);
void EnableParent(bool aEnable);
bool ConstrainToZLevel(bool aImmediate, nsWindowZ* aPlacement,
nsIWidget* aReqBelow, nsIWidget** aActualBelow);
void PlaceWindowLayersBehind(uint32_t aLowLevel, uint32_t aHighLevel,
nsIXULWindow* aBehind);
nsIAppWindow* aBehind);
void SetContentScrollbarVisibility(bool aVisible);
bool GetContentScrollbarVisibility();
void PersistentAttributesDirty(uint32_t aDirtyFlags);
@ -304,5 +306,8 @@ class nsXULWindow final : public nsIBaseWindow,
#endif
};
NS_DEFINE_STATIC_IID_ACCESSOR(nsXULWindow, NS_XULWINDOW_IMPL_CID)
#endif /* nsXULWindow_h__ */
NS_DEFINE_STATIC_IID_ACCESSOR(AppWindow, NS_APPWINDOW_IMPL_CID)
} // namespace mozilla
#endif /* mozilla_AppWindow_h__ */

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

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

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

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

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

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

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

@ -11,7 +11,7 @@
#include "nsIFactory.h"
#include "nsIInterfaceRequestor.h"
#include "nsIInterfaceRequestorUtils.h"
#include "nsIXULWindow.h"
#include "nsIAppWindow.h"
#include "mozilla/dom/Element.h"
#include "nsWindowMediator.h"
@ -23,9 +23,9 @@ using mozilla::dom::Element;
// static helper functions
//
static void GetAttribute(nsIXULWindow* inWindow, const nsAString& inAttribute,
static void GetAttribute(nsIAppWindow* inWindow, const nsAString& inAttribute,
nsAString& outValue);
static void GetWindowType(nsIXULWindow* inWindow, nsString& outType);
static void GetWindowType(nsIAppWindow* inWindow, nsString& outType);
static Element* GetElementFromDocShell(nsIDocShell* aShell) {
nsCOMPtr<nsIContentViewer> cv;
@ -41,7 +41,7 @@ static Element* GetElementFromDocShell(nsIDocShell* aShell) {
}
// 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) {
nsCOMPtr<nsIDocShell> 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
// 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);
}
@ -62,10 +62,10 @@ void GetWindowType(nsIXULWindow* aWindow, nsString& outType) {
// nsWindowInfo
//
nsWindowInfo::nsWindowInfo(nsIXULWindow* inWindow, int32_t inTimeStamp)
nsWindowInfo::nsWindowInfo(nsIAppWindow* inWindow, int32_t inTimeStamp)
: mWindow(inWindow),
mTimeStamp(inTimeStamp),
mZLevel(nsIXULWindow::normalZ) {
mZLevel(nsIAppWindow::normalZ) {
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)
: 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;
*retval = nullptr;
@ -225,7 +225,7 @@ nsWindowInfo* nsASDOMWindowEarlyToLateEnumerator::FindNext() {
nsWindowInfo *info, *listEnd;
bool allWindows = mType.IsEmpty();
// see nsXULWindowEarlyToLateEnumerator::FindNext
// see AppWindowEarlyToLateEnumerator::FindNext
if (!mCurrentPosition) return nullptr;
info = mCurrentPosition->mYounger;
@ -240,19 +240,19 @@ nsWindowInfo* nsASDOMWindowEarlyToLateEnumerator::FindNext() {
}
//
// nsASXULWindowEarlyToLateEnumerator
// nsASAppWindowEarlyToLateEnumerator
//
nsASXULWindowEarlyToLateEnumerator::nsASXULWindowEarlyToLateEnumerator(
nsASAppWindowEarlyToLateEnumerator::nsASAppWindowEarlyToLateEnumerator(
const char16_t* aTypeString, nsWindowMediator& aMediator)
: nsASXULWindowEnumerator(aTypeString, aMediator) {
: nsASAppWindowEnumerator(aTypeString, aMediator) {
mCurrentPosition = aMediator.mOldestWindow;
AdjustInitialPosition();
}
nsASXULWindowEarlyToLateEnumerator::~nsASXULWindowEarlyToLateEnumerator() {}
nsASAppWindowEarlyToLateEnumerator::~nsASAppWindowEarlyToLateEnumerator() {}
nsWindowInfo* nsASXULWindowEarlyToLateEnumerator::FindNext() {
nsWindowInfo* nsASAppWindowEarlyToLateEnumerator::FindNext() {
nsWindowInfo *info, *listEnd;
bool allWindows = mType.IsEmpty();
@ -277,23 +277,23 @@ nsWindowInfo* nsASXULWindowEarlyToLateEnumerator::FindNext() {
}
//
// nsASXULWindowFrontToBackEnumerator
// nsASAppWindowFrontToBackEnumerator
//
nsASXULWindowFrontToBackEnumerator::nsASXULWindowFrontToBackEnumerator(
nsASAppWindowFrontToBackEnumerator::nsASAppWindowFrontToBackEnumerator(
const char16_t* aTypeString, nsWindowMediator& aMediator)
: nsASXULWindowEnumerator(aTypeString, aMediator) {
: nsASAppWindowEnumerator(aTypeString, aMediator) {
mCurrentPosition = aMediator.mTopmostWindow;
AdjustInitialPosition();
}
nsASXULWindowFrontToBackEnumerator::~nsASXULWindowFrontToBackEnumerator() {}
nsASAppWindowFrontToBackEnumerator::~nsASAppWindowFrontToBackEnumerator() {}
nsWindowInfo* nsASXULWindowFrontToBackEnumerator::FindNext() {
nsWindowInfo* nsASAppWindowFrontToBackEnumerator::FindNext() {
nsWindowInfo *info, *listEnd;
bool allWindows = mType.IsEmpty();
// see nsXULWindowEarlyToLateEnumerator::FindNext
// see AppWindowEarlyToLateEnumerator::FindNext
if (!mCurrentPosition) return nullptr;
info = mCurrentPosition->mLower;
@ -308,24 +308,24 @@ nsWindowInfo* nsASXULWindowFrontToBackEnumerator::FindNext() {
}
//
// nsASXULWindowBackToFrontEnumerator
// nsASAppWindowBackToFrontEnumerator
//
nsASXULWindowBackToFrontEnumerator::nsASXULWindowBackToFrontEnumerator(
nsASAppWindowBackToFrontEnumerator::nsASAppWindowBackToFrontEnumerator(
const char16_t* aTypeString, nsWindowMediator& aMediator)
: nsASXULWindowEnumerator(aTypeString, aMediator) {
: nsASAppWindowEnumerator(aTypeString, aMediator) {
mCurrentPosition =
aMediator.mTopmostWindow ? aMediator.mTopmostWindow->mHigher : nullptr;
AdjustInitialPosition();
}
nsASXULWindowBackToFrontEnumerator::~nsASXULWindowBackToFrontEnumerator() {}
nsASAppWindowBackToFrontEnumerator::~nsASAppWindowBackToFrontEnumerator() {}
nsWindowInfo* nsASXULWindowBackToFrontEnumerator::FindNext() {
nsWindowInfo* nsASAppWindowBackToFrontEnumerator::FindNext() {
nsWindowInfo *info, *listEnd;
bool allWindows = mType.IsEmpty();
// see nsXULWindowEarlyToLateEnumerator::FindNext
// see AppWindowEarlyToLateEnumerator::FindNext
if (!mCurrentPosition) return nullptr;
info = mCurrentPosition->mHigher;

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

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

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

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

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

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

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

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

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

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

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

@ -5,7 +5,7 @@
#include "nsISupports.idl"
interface nsIXULWindow;
interface nsIAppWindow;
interface nsIWindowlessBrowser;
interface nsIURI;
interface mozIDOMWindowProxy;
@ -42,7 +42,7 @@ interface nsIAppShellService : nsISupports
* Can be left null.
*/
const long SIZE_TO_CONTENT = -1;
nsIXULWindow createTopLevelWindow(in nsIXULWindow aParent,
nsIAppWindow createTopLevelWindow(in nsIAppWindow aParent,
in nsIURI aUrl,
in uint32_t aChromeMask,
in long aInitialWidth,
@ -79,7 +79,7 @@ interface nsIAppShellService : nsISupports
* @param aResult the hidden window. Do not unhide hidden window.
* Do not taunt hidden window.
*/
readonly attribute nsIXULWindow hiddenWindow;
readonly attribute nsIAppWindow hiddenWindow;
/**
* 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
* "xul-window-registered"
*/
void registerTopLevelWindow(in nsIXULWindow aWindow);
void registerTopLevelWindow(in nsIAppWindow aWindow);
/**
* 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().
* @param aWindow you see the pattern
*/
void unregisterTopLevelWindow(in nsIXULWindow aWindow);
void unregisterTopLevelWindow(in nsIAppWindow aWindow);
/**
* Whether the hidden window has been lazily created.

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

@ -7,7 +7,7 @@
#include "nsISupports.idl"
/**
* The nsIXULWindow
* The nsIAppWindow
*
* When the window is destroyed, it will fire a "xul-window-destroyed"
* notification through the global observer service.
@ -27,7 +27,7 @@ interface mozIDOMWindowProxy;
native LiveResizeListenerArray(nsTArray<RefPtr<mozilla::LiveResizeListener>>);
[builtinclass, scriptable, uuid(d6d7a014-e28d-4c9d-8727-1cf6d870619b)]
interface nsIXULWindow : nsISupports
interface nsIAppWindow : nsISupports
{
/**
* 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
* @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
@ -77,7 +77,7 @@ interface nsIXULWindow : nsISupports
* Tell this window that it has lost a child XUL window
* @param aChild the child window being removed
*/
void removeChildWindow(in nsIXULWindow aChild);
void removeChildWindow(in nsIAppWindow aChild);
/**
* 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,
* 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
@ -133,7 +133,7 @@ interface nsIXULWindow : nsISupports
* 0 means there is no next remote tab actor to use.
* @return the newly minted window
*/
nsIXULWindow createNewWindow(in int32_t aChromeFlags,
nsIAppWindow createNewWindow(in int32_t aChromeFlags,
in nsIRemoteTab aOpeningTab,
in mozIDOMWindowProxy aOpener,
in unsigned long long aNextRemoteTabId);

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

@ -17,7 +17,7 @@
interface mozIDOMWindow;
interface mozIDOMWindowProxy;
interface nsIXULWindow;
interface nsIAppWindow;
interface nsIWidget;
interface nsIWindowMediatorListener;
@ -37,9 +37,9 @@ interface nsIWindowMediator: nsISupports
nsISimpleEnumerator getEnumerator(in wstring aWindowType);
/** 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
* 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.
* @param aFrontToBack if true, the enumerator enumerates windows in order
* 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);
/** 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.
* @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
* addListener) will be be notified through their onCloseWindow method.
* @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
* determining the most recent window. It's no longer necessary and it
* really should be removed.
* @param aWindow the window which has gained focus
*/
[noscript] void updateWindowTimeStamp(in nsIXULWindow aWindow);
[noscript] void updateWindowTimeStamp(in nsIAppWindow aWindow);
/* z-ordering: */
@ -120,8 +120,8 @@ interface nsIWindowMediator: nsISupports
* it should be constrained. Note this method is advisory only:
* it changes nothing either in WindowMediator's internal state
* or with the window.
* Note it compares the nsIXULWindow to nsIWidgets. A pure interface
* would use all nsIXULWindows. But we expect this to be called from
* Note it compares the nsIAppWindow to nsIWidgets. A pure interface
* would use all nsIAppWindows. But we expect this to be called from
* callbacks originating in native window code. They are expected to
* hand us comparison values which are pulled from general storage
* in the native widget, and may not correspond to an nsIWidget at all.
@ -146,7 +146,7 @@ interface nsIWindowMediator: nsISupports
* the position given.
*/
[noscript] boolean calculateZPosition(in nsIXULWindow inWindow,
[noscript] boolean calculateZPosition(in nsIAppWindow inWindow,
in unsigned long inPosition,
in nsIWidget inBelow,
out unsigned long outPosition,
@ -161,24 +161,24 @@ interface nsIWindowMediator: nsISupports
* for other values of inPosition.)
* @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 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
* @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.
* 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 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.
* keeps strong ref? (to be decided)

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

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

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

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

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

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