do_GetService("@mozilla.org/embedcomp/window-watcher;1", &rv);
do_GetService(NS_WINDOWWATCHER_CONTRACTID, &rv);
nsNSSDialogHelper::openDialog(    nsIDOMWindowInternal *window,    const char *url,    nsISupports *params){  nsresult rv;  nsCOMPtr<nsIWindowWatcher> windowWatcher =            do_GetService("@mozilla.org/embedcomp/window-watcher;1", &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;}