Bug 944212 - Build xpfe/appshell in unified mode; r=bsmedberg

--HG--
extra : rebase_source : 0a36b534d3df5418e4fc91ccfe8dbb236f3ec8c5
This commit is contained in:
Ehsan Akhgari 2013-12-03 17:03:45 -05:00
parent 9e8e6864f3
commit ea1c909659
7 changed files with 18 additions and 24 deletions

View File

@ -6,7 +6,7 @@
PARALLEL_DIRS += ['test']
SOURCES += [
UNIFIED_SOURCES += [
'nsAppShellFactory.cpp',
'nsAppShellService.cpp',
'nsAppShellWindowEnumerator.cpp',

View File

@ -22,23 +22,11 @@
// static helper functions
//
static nsresult GetDOMWindow(nsIXULWindow* inWindow,
nsCOMPtr<nsIDOMWindow> &outDOMWindow);
static nsCOMPtr<nsIDOMNode> GetDOMNodeFromDocShell(nsIDocShell *aShell);
static void GetAttribute(nsIXULWindow *inWindow, const nsAString &inAttribute,
nsAString &outValue);
static void GetWindowType(nsIXULWindow* inWindow, nsString &outType);
// fetch the nsIDOMWindow(Internal) from a XUL Window
nsresult GetDOMWindow(nsIXULWindow *aWindow, nsCOMPtr<nsIDOMWindow> &aDOMWindow)
{
nsCOMPtr<nsIDocShell> docShell;
aWindow->GetDocShell(getter_AddRefs(docShell));
aDOMWindow = do_GetInterface(docShell);
return aDOMWindow ? NS_OK : NS_ERROR_FAILURE;
}
nsCOMPtr<nsIDOMNode> GetDOMNodeFromDocShell(nsIDocShell *aShell)
{
nsCOMPtr<nsIDOMNode> node;
@ -224,7 +212,7 @@ NS_IMETHODIMP nsASDOMWindowEnumerator::GetNext(nsISupports **retval)
*retval = nullptr;
while (mCurrentPosition) {
nsCOMPtr<nsIDOMWindow> domWindow;
GetDOMWindow(mCurrentPosition->mWindow, domWindow);
nsWindowMediator::GetDOMWindow(mCurrentPosition->mWindow, domWindow);
mCurrentPosition = FindNext();
if (domWindow)
return CallQueryInterface(domWindow, retval);

View File

@ -3,6 +3,9 @@
* 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 nsAppShellWindowEnumerator_h
#define nsAppShellWindowEnumerator_h
#include "nsCOMPtr.h"
#include "nsString.h"
@ -158,3 +161,5 @@ public:
protected:
virtual nsWindowInfo *FindNext();
};
#endif

View File

@ -31,9 +31,6 @@
using namespace mozilla;
// CIDs
static NS_DEFINE_CID(kWindowMediatorCID, NS_WINDOWMEDIATOR_CID);
//*****************************************************************************
// nsChromeTreeOwner string literals
//*****************************************************************************
@ -146,6 +143,8 @@ NS_IMETHODIMP nsChromeTreeOwner::FindItemWithName(const PRUnichar* aName,
nsIDocShellTreeItem* aRequestor, nsIDocShellTreeItem* aOriginalRequestor,
nsIDocShellTreeItem** aFoundItem)
{
NS_DEFINE_CID(kWindowMediatorCID, NS_WINDOWMEDIATOR_CID);
NS_ENSURE_ARG_POINTER(aFoundItem);
*aFoundItem = nullptr;

View File

@ -50,9 +50,6 @@
using namespace mozilla;
// CIDs
static NS_DEFINE_CID(kWindowMediatorCID, NS_WINDOWMEDIATOR_CID);
//*****************************************************************************
//*** nsSiteWindow declaration
//*****************************************************************************
@ -167,6 +164,8 @@ NS_IMETHODIMP nsContentTreeOwner::FindItemWithName(const PRUnichar* aName,
nsIDocShellTreeItem* aRequestor, nsIDocShellTreeItem* aOriginalRequestor,
nsIDocShellTreeItem** aFoundItem)
{
NS_DEFINE_CID(kWindowMediatorCID, NS_WINDOWMEDIATOR_CID);
NS_ENSURE_ARG_POINTER(aFoundItem);
*aFoundItem = nullptr;
@ -1092,6 +1091,8 @@ nsSiteWindow::SetFocus(void)
NS_IMETHODIMP
nsSiteWindow::Blur(void)
{
NS_DEFINE_CID(kWindowMediatorCID, NS_WINDOWMEDIATOR_CID);
nsCOMPtr<nsISimpleEnumerator> windowEnumerator;
nsCOMPtr<nsIXULWindow> xulWindow;
bool more, foundUs;

View File

@ -27,9 +27,6 @@
using namespace mozilla;
static nsresult GetDOMWindow(nsIXULWindow* inWindow,
nsCOMPtr< nsIDOMWindow>& outDOMWindow);
static bool notifyOpenWindow(nsIWindowMediatorListener *aElement, void* aData);
static bool notifyCloseWindow(nsIWindowMediatorListener *aElement, void* aData);
static bool notifyWindowTitleChange(nsIWindowMediatorListener *aElement, void* aData);
@ -41,7 +38,8 @@ struct WindowTitleData {
};
nsresult
GetDOMWindow(nsIXULWindow* inWindow, nsCOMPtr<nsIDOMWindow>& outDOMWindow)
nsWindowMediator::GetDOMWindow(nsIXULWindow* inWindow,
nsCOMPtr<nsIDOMWindow>& outDOMWindow)
{
nsCOMPtr<nsIDocShell> docShell;

View File

@ -50,6 +50,9 @@ public:
NS_DECL_NSIWINDOWMEDIATOR
NS_DECL_NSIOBSERVER
static nsresult GetDOMWindow(nsIXULWindow* inWindow,
nsCOMPtr<nsIDOMWindow>& outDOMWindow);
private:
int32_t AddEnumerator(nsAppShellWindowEnumerator* inEnumerator);
int32_t RemoveEnumerator(nsAppShellWindowEnumerator* inEnumerator);