michael@0: /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ michael@0: /* This Source Code Form is subject to the terms of the Mozilla Public michael@0: * License, v. 2.0. If a copy of the MPL was not distributed with this michael@0: * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ michael@0: michael@0: #include "nsISupports.idl" michael@0: michael@0: /** michael@0: * This interface is implemented by channels which support overriding the michael@0: * privacy state of the channel. michael@0: * michael@0: * This interface must be used only from the XPCOM main thread. michael@0: */ michael@0: [scriptable, uuid(df702bb0-55b8-11e2-bcfd-0800200c9a66)] michael@0: interface nsIPrivateBrowsingChannel : nsISupports michael@0: { michael@0: /** michael@0: * Determine whether the channel is tied to a private browsing window. michael@0: * michael@0: * This value can be set only before the channel is opened. Setting it michael@0: * after that does not have any effect. This value overrides the privacy michael@0: * state of the channel, which means that if you call this method, then michael@0: * the loadGroup and load context will no longer be consulted when we michael@0: * need to know the private mode status for a channel. michael@0: * michael@0: * Note that this value is only meant to be used when the channel's privacy michael@0: * status cannot be obtained from the loadGroup or load context (for michael@0: * example, when the channel is not associated with any loadGroup or load michael@0: * context.) Setting this value directly should be avoided if possible. michael@0: * michael@0: * Implementations must enforce the ordering semantics of this function by michael@0: * raising errors if setPrivate is called on a channel which has a loadGroup michael@0: * and/or callbacks that implement nsILoadContext, or if the loadGroup michael@0: * or notificationCallbacks are set after setPrivate has been called. michael@0: * michael@0: * @param aPrivate whether the channel should be opened in private mode. michael@0: */ michael@0: void setPrivate(in boolean aPrivate); michael@0: michael@0: /** michael@0: * States whether the channel is in private browsing mode. This may either michael@0: * happen because the channel is opened from a private mode context or michael@0: * when the mode is explicitly set with ::setPrivate(). michael@0: * michael@0: * This attribute is equivalent to NS_UsePrivateBrowsing(), but scriptable. michael@0: */ michael@0: readonly attribute boolean isChannelPrivate; michael@0: michael@0: /* michael@0: * This function is used to determine whether the channel's private mode michael@0: * has been overridden by a call to setPrivate. It is intended to be used michael@0: * by NS_UsePrivateBrowsing(), and you should not call it directly. michael@0: * michael@0: * @param aValue the overridden value. This will only be set if the function michael@0: * returns true. michael@0: */ michael@0: [noscript] boolean isPrivateModeOverriden(out boolean aValue); michael@0: };