1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/extensions/cookie/nsICookiePromptService.idl Wed Dec 31 06:09:35 2014 +0100 1.3 @@ -0,0 +1,45 @@ 1.4 +/* This Source Code Form is subject to the terms of the Mozilla Public 1.5 + * License, v. 2.0. If a copy of the MPL was not distributed with this 1.6 + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ 1.7 + 1.8 +#include "nsISupports.idl" 1.9 + 1.10 +/** 1.11 + * An interface to open a dialog to ask to permission to accept the cookie. 1.12 + */ 1.13 + 1.14 +interface nsIDOMWindow; 1.15 +interface nsICookie; 1.16 + 1.17 +[scriptable, uuid(72f8bb14-2810-4f38-8d0d-290c5401f54e)] 1.18 +interface nsICookiePromptService : nsISupports 1.19 +{ 1.20 + const uint32_t DENY_COOKIE = 0; 1.21 + const uint32_t ACCEPT_COOKIE = 1; 1.22 + const uint32_t ACCEPT_SESSION_COOKIE = 2; 1.23 + 1.24 + /* Open a dialog that asks for permission to accept a cookie 1.25 + * 1.26 + * @param parent 1.27 + * @param cookie 1.28 + * @param hostname the host that wants to set the cookie, 1.29 + * not the domain: part of the cookie 1.30 + * @param cookiesFromHost the number of cookies there are already for this host 1.31 + * @param changingCookie are we changing this cookie? 1.32 + * @param rememberDecision should we set the matching permission for this host? 1.33 + * @returns 0 == deny cookie 1.34 + * 1 == accept cookie 1.35 + * 2 == accept cookie for current session 1.36 + */ 1.37 + 1.38 + long cookieDialog(in nsIDOMWindow parent, 1.39 + in nsICookie cookie, 1.40 + in ACString hostname, 1.41 + in long cookiesFromHost, 1.42 + in boolean changingCookie, 1.43 + out boolean rememberDecision); 1.44 +}; 1.45 + 1.46 +%{C++ 1.47 +#define NS_COOKIEPROMPTSERVICE_CONTRACTID "@mozilla.org/embedcomp/cookieprompt-service;1" 1.48 +%}