Merge mozilla-b2g34 to 2.1s. a=merge
[gecko.git] / extensions / cookie / nsICookiePromptService.idl
blobc6b938606ebbb92dd54ae0dc54a2c9c14ef559c1
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/. */
5 #include "nsISupports.idl"
7 /**
8 * An interface to open a dialog to ask to permission to accept the cookie.
9 */
11 interface nsIDOMWindow;
12 interface nsICookie;
14 [scriptable, uuid(72f8bb14-2810-4f38-8d0d-290c5401f54e)]
15 interface nsICookiePromptService : nsISupports
17 const uint32_t DENY_COOKIE = 0;
18 const uint32_t ACCEPT_COOKIE = 1;
19 const uint32_t ACCEPT_SESSION_COOKIE = 2;
21 /* Open a dialog that asks for permission to accept a cookie
23 * @param parent
24 * @param cookie
25 * @param hostname the host that wants to set the cookie,
26 * not the domain: part of the cookie
27 * @param cookiesFromHost the number of cookies there are already for this host
28 * @param changingCookie are we changing this cookie?
29 * @param rememberDecision should we set the matching permission for this host?
30 * @returns 0 == deny cookie
31 * 1 == accept cookie
32 * 2 == accept cookie for current session
35 long cookieDialog(in nsIDOMWindow parent,
36 in nsICookie cookie,
37 in ACString hostname,
38 in long cookiesFromHost,
39 in boolean changingCookie,
40 out boolean rememberDecision);
43 %{C++
44 #define NS_COOKIEPROMPTSERVICE_CONTRACTID "@mozilla.org/embedcomp/cookieprompt-service;1"