Back to index

lightning-sunbird  0.9+nobinonly
Functions
nsAppShellWindowEnumerator.cpp File Reference
#include "nsIContentViewer.h"
#include "nsIDocShell.h"
#include "nsIDocumentViewer.h"
#include "nsIDocument.h"
#include "nsIDOMDocument.h"
#include "nsIDOMElement.h"
#include "nsIDOMWindow.h"
#include "nsIDOMWindowInternal.h"
#include "nsIFactory.h"
#include "nsIInterfaceRequestor.h"
#include "nsIInterfaceRequestorUtils.h"
#include "nsIXULWindow.h"
#include "nsAppShellWindowEnumerator.h"
#include "nsWindowMediator.h"

Go to the source code of this file.

Functions

static nsresult GetDOMWindow (nsIXULWindow *inWindow, nsCOMPtr< nsIDOMWindowInternal > &outDOMWindow)
static nsCOMPtr< nsIDOMNodeGetDOMNodeFromDocShell (nsIDocShell *aShell)
static void GetAttribute (nsIXULWindow *inWindow, const nsAString &inAttribute, nsAString &outValue)
static void GetWindowType (nsIXULWindow *inWindow, nsString &outType)

Function Documentation

void GetAttribute ( nsIXULWindow inWindow,
const nsAString &  inAttribute,
nsAString &  outValue 
) [static]

Definition at line 104 of file nsAppShellWindowEnumerator.cpp.

{
  nsCOMPtr<nsIDocShell> shell;
  if (inWindow && NS_SUCCEEDED(inWindow->GetDocShell(getter_AddRefs(shell)))) {

    nsCOMPtr<nsIDOMNode> node(GetDOMNodeFromDocShell(shell));
    if (node) {
      nsCOMPtr<nsIDOMElement> webshellElement(do_QueryInterface(node));
      if (webshellElement)
        webshellElement->GetAttribute(inAttribute, outValue);
    }
  }
}

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 77 of file nsAppShellWindowEnumerator.cpp.

{
  nsCOMPtr<nsIDOMNode> node;

  nsCOMPtr<nsIContentViewer> cv;
  aShell->GetContentViewer(getter_AddRefs(cv));
  if (cv) {
    nsCOMPtr<nsIDocumentViewer> docv(do_QueryInterface(cv));
    if (docv) {
      nsCOMPtr<nsIDocument> doc;
      docv->GetDocument(getter_AddRefs(doc));
      if (doc) {
        nsCOMPtr<nsIDOMDocument> domdoc(do_QueryInterface(doc));
        if (domdoc) {
          nsCOMPtr<nsIDOMElement> element;
          domdoc->GetDocumentElement(getter_AddRefs(element));
          if (element)
            node = do_QueryInterface(element);
        }
      }
    }
  }

  return node;
}

Here is the call graph for this function:

Here is the caller graph for this function:

nsresult GetDOMWindow ( nsIXULWindow inWindow,
nsCOMPtr< nsIDOMWindowInternal > &  outDOMWindow 
) [static]

Definition at line 66 of file nsAppShellWindowEnumerator.cpp.

{
  nsCOMPtr<nsIDocShell> docShell;

  aWindow->GetDocShell(getter_AddRefs(docShell));
  aDOMWindow = do_GetInterface(docShell);
  return aDOMWindow ? NS_OK : NS_ERROR_FAILURE;
}

Here is the call graph for this function:

Here is the caller graph for this function:

void GetWindowType ( nsIXULWindow inWindow,
nsString outType 
) [static]

Definition at line 121 of file nsAppShellWindowEnumerator.cpp.

{
  GetAttribute(aWindow, NS_LITERAL_STRING("windowtype"), outType);
}

Here is the call graph for this function:

Here is the caller graph for this function: