nsIAuthPromptCallback.idl 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. /* This Source Code Form is subject to the terms of the Mozilla Public
  2. * License, v. 2.0. If a copy of the MPL was not distributed with this
  3. * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
  4. #include "nsISupports.idl"
  5. interface nsIAuthInformation;
  6. /**
  7. * Interface for callback methods for the asynchronous nsIAuthPrompt2 method.
  8. * Callers MUST call exactly one method if nsIAuthPrompt2::promptPasswordAsync
  9. * returns successfully. They MUST NOT call any method on this interface before
  10. * promptPasswordAsync returns.
  11. */
  12. [scriptable, uuid(bdc387d7-2d29-4cac-92f1-dd75d786631d)]
  13. interface nsIAuthPromptCallback : nsISupports
  14. {
  15. /**
  16. * Authentication information is available.
  17. *
  18. * @param aContext
  19. * The context as passed to promptPasswordAsync
  20. * @param aAuthInfo
  21. * Authentication information. Must be the same object that was passed
  22. * to promptPasswordAsync.
  23. *
  24. * @note Any exceptions thrown from this method should be ignored.
  25. */
  26. void onAuthAvailable(in nsISupports aContext,
  27. in nsIAuthInformation aAuthInfo);
  28. /**
  29. * Notification that the prompt was cancelled.
  30. *
  31. * @param aContext
  32. * The context that was passed to promptPasswordAsync.
  33. * @param userCancel
  34. * If false, this prompt was cancelled by calling the
  35. * the cancel method on the nsICancelable; otherwise,
  36. * it was cancelled by the user.
  37. */
  38. void onAuthCancelled(in nsISupports aContext, in boolean userCancel);
  39. };