extensions/cookie/nsICookiePromptService.idl
author Margaret Leibovic <margaret.leibovic@gmail.com>
Wed, 30 May 2012 13:26:13 -0700
changeset 95318 2389f26e4efaea58d7b2cef6c4b597b40745073e
parent 94475 f4157e8c410708d76703f19e4dfb61859bfe32d8
child 103003 a16372ce30b5f6b747246b01fcd215a4bf3b6342
permissions -rw-r--r--
Bug 695172 - Find in page. r=mfinkle

/* This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */

#include "nsISupports.idl"

/**
 * An interface to open a dialog to ask to permission to accept the cookie.
 */

interface nsIDOMWindow;
interface nsICookie;

[scriptable, uuid(72f8bb14-2810-4f38-8d0d-290c5401f54e)]
interface nsICookiePromptService : nsISupports
{
  const PRUint32 DENY_COOKIE = 0;
  const PRUint32 ACCEPT_COOKIE = 1;
  const PRUint32 ACCEPT_SESSION_COOKIE = 2;

  /* Open a dialog that asks for permission to accept a cookie
   * 
   * @param parent
   * @param cookie
   * @param hostname          the host that wants to set the cookie, 
   *                           not the domain: part of the cookie
   * @param cookiesFromHost   the number of cookies there are already for this host
   * @param changingCookie    are we changing this cookie?
   * @param rememberDecision  should we set the matching permission for this host?
   * @returns                 0 == deny cookie
   *                          1 == accept cookie
   *                          2 == accept cookie for current session
   */

  long cookieDialog(in nsIDOMWindow parent,
                    in nsICookie cookie,
                    in ACString hostname,
                    in long cookiesFromHost,
                    in boolean changingCookie,
                    out boolean rememberDecision);
};

%{C++
#define NS_COOKIEPROMPTSERVICE_CONTRACTID "@mozilla.org/embedcomp/cookieprompt-service;1"
%}