netwerk/base/public/nsIPrivateBrowsingChannel.idl

changeset 0
6474c204b198
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/netwerk/base/public/nsIPrivateBrowsingChannel.idl	Wed Dec 31 06:09:35 2014 +0100
     1.3 @@ -0,0 +1,58 @@
     1.4 +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
     1.5 +/* This Source Code Form is subject to the terms of the Mozilla Public
     1.6 + * License, v. 2.0. If a copy of the MPL was not distributed with this
     1.7 + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
     1.8 +
     1.9 +#include "nsISupports.idl"
    1.10 +
    1.11 +/**
    1.12 + * This interface is implemented by channels which support overriding the
    1.13 + * privacy state of the channel.
    1.14 + *
    1.15 + * This interface must be used only from the XPCOM main thread.
    1.16 + */
    1.17 +[scriptable, uuid(df702bb0-55b8-11e2-bcfd-0800200c9a66)]
    1.18 +interface nsIPrivateBrowsingChannel : nsISupports
    1.19 +{
    1.20 +    /**
    1.21 +     * Determine whether the channel is tied to a private browsing window.
    1.22 +     *
    1.23 +     * This value can be set only before the channel is opened.  Setting it
    1.24 +     * after that does not have any effect.  This value overrides the privacy
    1.25 +     * state of the channel, which means that if you call this method, then
    1.26 +     * the loadGroup and load context will no longer be consulted when we
    1.27 +     * need to know the private mode status for a channel.
    1.28 +     *
    1.29 +     * Note that this value is only meant to be used when the channel's privacy
    1.30 +     * status cannot be obtained from the loadGroup or load context (for
    1.31 +     * example, when the channel is not associated with any loadGroup or load
    1.32 +     * context.)  Setting this value directly should be avoided if possible.
    1.33 +     *
    1.34 +     * Implementations must enforce the ordering semantics of this function by
    1.35 +     * raising errors if setPrivate is called on a channel which has a loadGroup
    1.36 +     * and/or callbacks that implement nsILoadContext, or if the loadGroup
    1.37 +     * or notificationCallbacks are set after setPrivate has been called.
    1.38 +     *
    1.39 +     * @param aPrivate whether the channel should be opened in private mode.
    1.40 +     */
    1.41 +    void setPrivate(in boolean aPrivate);
    1.42 +
    1.43 +    /**
    1.44 +     * States whether the channel is in private browsing mode. This may either
    1.45 +     * happen because the channel is opened from a private mode context or
    1.46 +     * when the mode is explicitly set with ::setPrivate().
    1.47 +     *
    1.48 +     * This attribute is equivalent to NS_UsePrivateBrowsing(), but scriptable.
    1.49 +     */
    1.50 +    readonly attribute boolean isChannelPrivate;
    1.51 +
    1.52 +    /*
    1.53 +     * This function is used to determine whether the channel's private mode
    1.54 +     * has been overridden by a call to setPrivate.  It is intended to be used
    1.55 +     * by NS_UsePrivateBrowsing(), and you should not call it directly.
    1.56 +     *
    1.57 +     * @param aValue the overridden value.  This will only be set if the function
    1.58 +     *               returns true.
    1.59 +     */
    1.60 +    [noscript] boolean isPrivateModeOverriden(out boolean aValue);
    1.61 +};

mercurial