Back to index

lightning-sunbird  0.9+nobinonly
Static Public Member Functions | Static Public Attributes
nsNSSDialogHelper Class Reference

Common class that uses the window watcher service to open a standard dialog, with or without a parent context. More...

#include <nsNSSDialogHelper.h>

List of all members.

Static Public Member Functions

static nsresult openDialog (nsIDOMWindowInternal *window, const char *url, nsISupports *params)

Static Public Attributes

static const char * kDefaultOpenWindowParam = "centerscreen,chrome,modal,titlebar"

Detailed Description

Common class that uses the window watcher service to open a standard dialog, with or without a parent context.

The params parameter can be an nsISupportsArray so any number of additional arguments can be used.

Definition at line 49 of file nsNSSDialogHelper.h.


Member Function Documentation

nsresult nsNSSDialogHelper::openDialog ( nsIDOMWindowInternal window,
const char *  url,
nsISupports *  params 
) [static]

Definition at line 52 of file nsNSSDialogHelper.cpp.

{
  nsresult rv;
  nsCOMPtr<nsIWindowWatcher> windowWatcher = 
           do_GetService(NS_WINDOWWATCHER_CONTRACTID, &rv);
  if (NS_FAILED(rv)) return rv;

  nsIDOMWindowInternal *parent = window;

  nsCOMPtr<nsIDOMWindowInternal> activeParent;
  if (!parent) {
    nsCOMPtr<nsIDOMWindow> active;
    windowWatcher->GetActiveWindow(getter_AddRefs(active));
    if (active) {
      active->QueryInterface(NS_GET_IID(nsIDOMWindowInternal), getter_AddRefs(activeParent));
      parent = activeParent;
    }
  }

  nsCOMPtr<nsIDOMWindow> newWindow;
  rv = windowWatcher->OpenWindow(parent,
                                 url,
                                 "_blank",
                                 nsNSSDialogHelper::kDefaultOpenWindowParam,
                                 params,
                                 getter_AddRefs(newWindow));
  return rv;
}

Here is the call graph for this function:


Member Data Documentation

const char * nsNSSDialogHelper::kDefaultOpenWindowParam = "centerscreen,chrome,modal,titlebar" [static]

Definition at line 52 of file nsNSSDialogHelper.h.


The documentation for this class was generated from the following files: