nsIPrivateBrowsingChannel.idl 2.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
  2. /* This Source Code Form is subject to the terms of the Mozilla Public
  3. * License, v. 2.0. If a copy of the MPL was not distributed with this
  4. * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
  5. #include "nsISupports.idl"
  6. /**
  7. * This interface is implemented by channels which support overriding the
  8. * privacy state of the channel.
  9. *
  10. * This interface must be used only from the XPCOM main thread.
  11. */
  12. [scriptable, uuid(df702bb0-55b8-11e2-bcfd-0800200c9a66)]
  13. interface nsIPrivateBrowsingChannel : nsISupports
  14. {
  15. /**
  16. * Determine whether the channel is tied to a private browsing window.
  17. *
  18. * This value can be set only before the channel is opened. Setting it
  19. * after that does not have any effect. This value overrides the privacy
  20. * state of the channel, which means that if you call this method, then
  21. * the loadGroup and load context will no longer be consulted when we
  22. * need to know the private mode status for a channel.
  23. *
  24. * Note that this value is only meant to be used when the channel's privacy
  25. * status cannot be obtained from the loadGroup or load context (for
  26. * example, when the channel is not associated with any loadGroup or load
  27. * context.) Setting this value directly should be avoided if possible.
  28. *
  29. * Implementations must enforce the ordering semantics of this function by
  30. * raising errors if setPrivate is called on a channel which has a loadGroup
  31. * and/or callbacks that implement nsILoadContext, or if the loadGroup
  32. * or notificationCallbacks are set after setPrivate has been called.
  33. *
  34. * @param aPrivate whether the channel should be opened in private mode.
  35. */
  36. void setPrivate(in boolean aPrivate);
  37. /**
  38. * States whether the channel is in private browsing mode. This may either
  39. * happen because the channel is opened from a private mode context or
  40. * when the mode is explicitly set with ::setPrivate().
  41. *
  42. * This attribute is equivalent to NS_UsePrivateBrowsing(), but scriptable.
  43. */
  44. readonly attribute boolean isChannelPrivate;
  45. /*
  46. * This function is used to determine whether the channel's private mode
  47. * has been overridden by a call to setPrivate. It is intended to be used
  48. * by NS_UsePrivateBrowsing(), and you should not call it directly.
  49. *
  50. * @param aValue the overridden value. This will only be set if the function
  51. * returns true.
  52. */
  53. [noscript] boolean isPrivateModeOverriden(out boolean aValue);
  54. };