Back to index

lightning-sunbird  0.9+nobinonly
Classes | Functions
nsPrompt.cpp File Reference
#include "nsIServiceManager.h"
#include "nsIAuthPromptWrapper.h"
#include "nsPrompt.h"
#include "nsReadableUtils.h"
#include "nsDependentString.h"
#include "nsIDOMDocument.h"
#include "nsIDOMDocumentEvent.h"
#include "nsIDOMEventTarget.h"
#include "nsIDOMEvent.h"
#include "nsIPrivateDOMEvent.h"
#include "nsEmbedCID.h"
#include "nsPIDOMWindow.h"

Go to the source code of this file.

Classes

class  nsAutoWindowStateHelper

Functions

nsresult NS_NewPrompter (nsIPrompt **result, nsIDOMWindow *aParent)
nsresult NS_NewAuthPrompter (nsIAuthPrompt **result, nsIDOMWindow *aParent)

Function Documentation

nsresult NS_NewAuthPrompter ( nsIAuthPrompt **  result,
nsIDOMWindow aParent 
)

Definition at line 73 of file nsPrompt.cpp.

{

  nsresult rv;
  *result = 0;

  nsPrompt *prompter = new nsPrompt(aParent);
  if (!prompter)
    return NS_ERROR_OUT_OF_MEMORY;

  NS_ADDREF(prompter);
  rv = prompter->Init();
  if (NS_FAILED(rv)) {
    NS_RELEASE(prompter);
    return rv;
  }

  *result = prompter;
  // wrap the base prompt in an nsIAuthPromptWrapper, if available
  // the impl used here persists prompt data and pre-fills the dialogs
  nsCOMPtr<nsIAuthPromptWrapper> siPrompt =
    do_CreateInstance("@mozilla.org/wallet/single-sign-on-prompt;1");
  if (siPrompt) {
    // then single sign-on is installed
    rv = siPrompt->SetPromptDialogs(prompter);
    if (NS_SUCCEEDED(rv)) {
      *result = siPrompt;
      NS_RELEASE(prompter); // siPrompt is a strong owner
      NS_ADDREF(*result);
    }
  }
  return NS_OK;
}

Here is the call graph for this function:

Here is the caller graph for this function:

nsresult NS_NewPrompter ( nsIPrompt **  result,
nsIDOMWindow aParent 
)

Definition at line 52 of file nsPrompt.cpp.

{
  nsresult rv;
  *result = 0;

  nsPrompt *prompter = new nsPrompt(aParent);
  if (!prompter)
    return NS_ERROR_OUT_OF_MEMORY;

  NS_ADDREF(prompter);
  rv = prompter->Init();
  if (NS_FAILED(rv)) {
    NS_RELEASE(prompter);
    return rv;
  }

  *result = prompter;
  return NS_OK;
}

Here is the call graph for this function:

Here is the caller graph for this function: