From 3539bc390baa6c0f499db1a20c194de71eac6053 Mon Sep 17 00:00:00 2001 From: Mark Banner Date: Tue, 3 Jan 2017 12:14:06 +0000 Subject: [PATCH 01/30] Bug 1255149 - Remove unused nsICookiePromptService. r=jdm MozReview-Commit-ID: IO07pbRqq2I --HG-- extra : rebase_source : 7c432454f216797a9937f6b6a30dc683439102d6 --- b2g/installer/package-manifest.in | 1 - browser/installer/package-manifest.in | 1 - extensions/cookie/moz.build | 8 - extensions/cookie/nsCookieModule.cpp | 5 - extensions/cookie/nsCookiePermission.cpp | 1 - extensions/cookie/nsCookiePromptService.cpp | 101 ---------- extensions/cookie/nsCookiePromptService.h | 29 --- extensions/cookie/nsICookieAcceptDialog.idl | 21 -- extensions/cookie/nsICookiePromptService.idl | 45 ----- extensions/cookie/test/unit/cookieprompt.js | 22 --- .../cookie/test/unit/cookieprompt.manifest | 2 - extensions/cookie/test/unit/xpcshell.ini | 3 - mobile/android/installer/package-manifest.in | 1 - .../cookie/content/cookieAcceptDialog.js | 180 ------------------ .../cookie/content/cookieAcceptDialog.xul | 118 ------------ toolkit/components/cookie/jar.mn | 10 - toolkit/components/cookie/moz.build | 10 - toolkit/components/moz.build | 1 - .../chrome/cookie/cookieAcceptDialog.dtd | 21 -- .../cookie/cookieAcceptDialog.properties | 19 -- toolkit/locales/jar.mn | 5 - 21 files changed, 604 deletions(-) delete mode 100644 extensions/cookie/nsCookiePromptService.cpp delete mode 100644 extensions/cookie/nsCookiePromptService.h delete mode 100644 extensions/cookie/nsICookieAcceptDialog.idl delete mode 100644 extensions/cookie/nsICookiePromptService.idl delete mode 100644 extensions/cookie/test/unit/cookieprompt.js delete mode 100644 extensions/cookie/test/unit/cookieprompt.manifest delete mode 100644 toolkit/components/cookie/content/cookieAcceptDialog.js delete mode 100644 toolkit/components/cookie/content/cookieAcceptDialog.xul delete mode 100644 toolkit/components/cookie/jar.mn delete mode 100644 toolkit/components/cookie/moz.build delete mode 100644 toolkit/locales/en-US/chrome/cookie/cookieAcceptDialog.dtd delete mode 100644 toolkit/locales/en-US/chrome/cookie/cookieAcceptDialog.properties diff --git a/b2g/installer/package-manifest.in b/b2g/installer/package-manifest.in index 0979d397f7af..63fd2f410e8f 100644 --- a/b2g/installer/package-manifest.in +++ b/b2g/installer/package-manifest.in @@ -142,7 +142,6 @@ @RESPATH@/components/content_geckomediaplugins.xpt @RESPATH@/components/content_html.xpt @RESPATH@/components/content_xslt.xpt -@RESPATH@/components/cookie.xpt @RESPATH@/components/directory.xpt @RESPATH@/components/diskspacewatcher.xpt @RESPATH@/components/docshell.xpt diff --git a/browser/installer/package-manifest.in b/browser/installer/package-manifest.in index e202d0a4c29e..7e577c5dafba 100644 --- a/browser/installer/package-manifest.in +++ b/browser/installer/package-manifest.in @@ -185,7 +185,6 @@ @RESPATH@/components/content_webrtc.xpt #endif @RESPATH@/components/content_xslt.xpt -@RESPATH@/components/cookie.xpt @RESPATH@/components/directory.xpt @RESPATH@/components/docshell.xpt @RESPATH@/components/dom.xpt diff --git a/extensions/cookie/moz.build b/extensions/cookie/moz.build index 36de41f956e5..6619196a6c8e 100644 --- a/extensions/cookie/moz.build +++ b/extensions/cookie/moz.build @@ -6,17 +6,9 @@ TEST_DIRS += ['test'] -XPIDL_SOURCES += [ - 'nsICookieAcceptDialog.idl', - 'nsICookiePromptService.idl', -] - -XPIDL_MODULE = 'cookie' - UNIFIED_SOURCES += [ 'nsCookieModule.cpp', 'nsCookiePermission.cpp', - 'nsCookiePromptService.cpp', 'nsPermission.cpp', 'nsPermissionManager.cpp', 'nsPopupWindowManager.cpp', diff --git a/extensions/cookie/nsCookieModule.cpp b/extensions/cookie/nsCookieModule.cpp index 1157e0c5d324..133f5ca00e02 100644 --- a/extensions/cookie/nsCookieModule.cpp +++ b/extensions/cookie/nsCookieModule.cpp @@ -9,7 +9,6 @@ #include "nsPermissionManager.h" #include "nsPopupWindowManager.h" #include "nsICategoryManager.h" -#include "nsCookiePromptService.h" #include "nsCookiePermission.h" #include "nsXPIDLString.h" @@ -18,18 +17,15 @@ NS_GENERIC_FACTORY_SINGLETON_CONSTRUCTOR(nsIPermissionManager, nsPermissionManager::GetXPCOMSingleton) NS_GENERIC_FACTORY_CONSTRUCTOR_INIT(nsPopupWindowManager, Init) NS_GENERIC_FACTORY_CONSTRUCTOR(nsCookiePermission) -NS_GENERIC_FACTORY_CONSTRUCTOR(nsCookiePromptService) NS_DEFINE_NAMED_CID(NS_PERMISSIONMANAGER_CID); NS_DEFINE_NAMED_CID(NS_POPUPWINDOWMANAGER_CID); -NS_DEFINE_NAMED_CID(NS_COOKIEPROMPTSERVICE_CID); NS_DEFINE_NAMED_CID(NS_COOKIEPERMISSION_CID); static const mozilla::Module::CIDEntry kCookieCIDs[] = { { &kNS_PERMISSIONMANAGER_CID, false, nullptr, nsIPermissionManagerConstructor }, { &kNS_POPUPWINDOWMANAGER_CID, false, nullptr, nsPopupWindowManagerConstructor }, - { &kNS_COOKIEPROMPTSERVICE_CID, false, nullptr, nsCookiePromptServiceConstructor }, { &kNS_COOKIEPERMISSION_CID, false, nullptr, nsCookiePermissionConstructor }, { nullptr } }; @@ -37,7 +33,6 @@ static const mozilla::Module::CIDEntry kCookieCIDs[] = { static const mozilla::Module::ContractIDEntry kCookieContracts[] = { { NS_PERMISSIONMANAGER_CONTRACTID, &kNS_PERMISSIONMANAGER_CID }, { NS_POPUPWINDOWMANAGER_CONTRACTID, &kNS_POPUPWINDOWMANAGER_CID }, - { NS_COOKIEPROMPTSERVICE_CONTRACTID, &kNS_COOKIEPROMPTSERVICE_CID }, { NS_COOKIEPERMISSION_CONTRACTID, &kNS_COOKIEPERMISSION_CID }, { nullptr } }; diff --git a/extensions/cookie/nsCookiePermission.cpp b/extensions/cookie/nsCookiePermission.cpp index 7dfc943f091f..9745f2616f00 100644 --- a/extensions/cookie/nsCookiePermission.cpp +++ b/extensions/cookie/nsCookiePermission.cpp @@ -9,7 +9,6 @@ #include "mozIThirdPartyUtil.h" #include "nsICookie2.h" #include "nsIServiceManager.h" -#include "nsICookiePromptService.h" #include "nsICookieManager2.h" #include "nsNetUtil.h" #include "nsIInterfaceRequestorUtils.h" diff --git a/extensions/cookie/nsCookiePromptService.cpp b/extensions/cookie/nsCookiePromptService.cpp deleted file mode 100644 index 258193ab8ffe..000000000000 --- a/extensions/cookie/nsCookiePromptService.cpp +++ /dev/null @@ -1,101 +0,0 @@ -/* 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 "nsCookiePromptService.h" -#include "nsICookie.h" -#include "nsICookieAcceptDialog.h" -#include "nsIDOMWindow.h" -#include "nsPIDOMWindow.h" -#include "nsIWindowWatcher.h" -#include "nsIServiceManager.h" -#include "nsString.h" -#include "nsIDialogParamBlock.h" -#include "nsIMutableArray.h" -#include "mozilla/dom/ScriptSettings.h" - -/**************************************************************** - ************************ nsCookiePromptService ***************** - ****************************************************************/ - -NS_IMPL_ISUPPORTS(nsCookiePromptService, nsICookiePromptService) - -nsCookiePromptService::nsCookiePromptService() { -} - -nsCookiePromptService::~nsCookiePromptService() { -} - -NS_IMETHODIMP -nsCookiePromptService::CookieDialog(mozIDOMWindowProxy *aParent, - nsICookie *aCookie, - const nsACString &aHostname, - int32_t aCookiesFromHost, - bool aChangingCookie, - bool *aRememberDecision, - int32_t *aAccept) -{ - nsresult rv; - - nsCOMPtr block = do_CreateInstance(NS_DIALOGPARAMBLOCK_CONTRACTID,&rv); - if (NS_FAILED(rv)) return rv; - - block->SetInt(nsICookieAcceptDialog::ACCEPT_COOKIE, 1); - block->SetString(nsICookieAcceptDialog::HOSTNAME, NS_ConvertUTF8toUTF16(aHostname).get()); - block->SetInt(nsICookieAcceptDialog::COOKIESFROMHOST, aCookiesFromHost); - block->SetInt(nsICookieAcceptDialog::CHANGINGCOOKIE, aChangingCookie ? 1 : 0); - - nsCOMPtr objects = - do_CreateInstance(NS_ARRAY_CONTRACTID, &rv); - if (NS_FAILED(rv)) return rv; - - rv = objects->AppendElement(aCookie, false); - if (NS_FAILED(rv)) return rv; - - block->SetObjects(objects); - - nsCOMPtr wwatcher = do_GetService(NS_WINDOWWATCHER_CONTRACTID, &rv); - if (NS_FAILED(rv)) return rv; - - nsCOMPtr arguments = do_QueryInterface(block); - - nsCOMPtr parent(aParent); - if (!parent) // if no parent provided, consult the window watcher: - wwatcher->GetActiveWindow(getter_AddRefs(parent)); - - if (parent) { - auto* privateParent = nsPIDOMWindowOuter::From(parent); - if (privateParent) - privateParent = privateParent->GetPrivateRoot(); - parent = privateParent; - } - - // We're opening a chrome window and passing in a nsIDialogParamBlock. Setting - // the nsIDialogParamBlock as the .arguments property on the chrome window - // requires system principals on the stack, so we use an AutoNoJSAPI for that. - mozilla::dom::AutoNoJSAPI nojsapi; - - // The cookie dialog will be modal for the root chrome window rather than the - // tab containing the permission-requesting page. This removes confusion - // about which monitor is displaying the dialog (see bug 470356), but also - // avoids unwanted tab switches (see bug 405239). - nsCOMPtr dialog; - rv = wwatcher->OpenWindow(parent, "chrome://cookie/content/cookieAcceptDialog.xul", "_blank", - "centerscreen,chrome,modal,titlebar", arguments, - getter_AddRefs(dialog)); - - if (NS_FAILED(rv)) return rv; - - // get back output parameters - int32_t tempValue; - block->GetInt(nsICookieAcceptDialog::ACCEPT_COOKIE, &tempValue); - *aAccept = tempValue; - - // GetInt returns a int32_t; we need to sanitize it into bool - block->GetInt(nsICookieAcceptDialog::REMEMBER_DECISION, &tempValue); - *aRememberDecision = (tempValue == 1); - - return rv; -} - diff --git a/extensions/cookie/nsCookiePromptService.h b/extensions/cookie/nsCookiePromptService.h deleted file mode 100644 index a6e10fce4b26..000000000000 --- a/extensions/cookie/nsCookiePromptService.h +++ /dev/null @@ -1,29 +0,0 @@ -/* 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/. */ - -#ifndef nsCookiePromptService_h__ -#define nsCookiePromptService_h__ - -#include "nsICookiePromptService.h" - -class nsCookiePromptService : public nsICookiePromptService { - - virtual ~nsCookiePromptService(); - -public: - - nsCookiePromptService(); - - NS_DECL_NSICOOKIEPROMPTSERVICE - NS_DECL_ISUPPORTS - -private: - -}; - -// {CE002B28-92B7-4701-8621-CC925866FB87} -#define NS_COOKIEPROMPTSERVICE_CID \ - {0xCE002B28, 0x92B7, 0x4701, {0x86, 0x21, 0xCC, 0x92, 0x58, 0x66, 0xFB, 0x87}} - -#endif diff --git a/extensions/cookie/nsICookieAcceptDialog.idl b/extensions/cookie/nsICookieAcceptDialog.idl deleted file mode 100644 index b02339780807..000000000000 --- a/extensions/cookie/nsICookieAcceptDialog.idl +++ /dev/null @@ -1,21 +0,0 @@ -/* 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" - -/* - - This file contains some constants for the cookie accept dialog - - */ - -[scriptable, uuid(3F2F0D2C-BDEA-4B5A-AFC6-FCF18F66B97E)] -interface nsICookieAcceptDialog: nsISupports { - - const short ACCEPT_COOKIE=0; - const short REMEMBER_DECISION=1; - const short HOSTNAME=2; - const short COOKIESFROMHOST=3; - const short CHANGINGCOOKIE=4; -}; diff --git a/extensions/cookie/nsICookiePromptService.idl b/extensions/cookie/nsICookiePromptService.idl deleted file mode 100644 index 163da6a26e62..000000000000 --- a/extensions/cookie/nsICookiePromptService.idl +++ /dev/null @@ -1,45 +0,0 @@ -/* 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 mozIDOMWindowProxy; -interface nsICookie; - -[scriptable, uuid(65ca07c3-6241-4de1-bf41-3336470499db)] -interface nsICookiePromptService : nsISupports -{ - const uint32_t DENY_COOKIE = 0; - const uint32_t ACCEPT_COOKIE = 1; - const uint32_t 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 mozIDOMWindowProxy 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" -%} diff --git a/extensions/cookie/test/unit/cookieprompt.js b/extensions/cookie/test/unit/cookieprompt.js deleted file mode 100644 index c0a17e0060f7..000000000000 --- a/extensions/cookie/test/unit/cookieprompt.js +++ /dev/null @@ -1,22 +0,0 @@ -/* Any copyright is dedicated to the Public Domain. - http://creativecommons.org/publicdomain/zero/1.0/ */ - -Components.utils.import("resource://gre/modules/XPCOMUtils.jsm"); - -var Ci = Components.interfaces; - -function CookiePromptService() { -} - -CookiePromptService.prototype = { - classID: Components.ID("{509b5540-c87c-11dd-ad8b-0800200c9a66}"), - QueryInterface: XPCOMUtils.generateQI([Ci.nsICookiePromptService]), - - cookieDialog: function(parent, cookie, hostname, - cookiesFromHost, changingCookie, - rememberDecision) { - return 0; - } -}; - -this.NSGetFactory = XPCOMUtils.generateNSGetFactory([CookiePromptService]); diff --git a/extensions/cookie/test/unit/cookieprompt.manifest b/extensions/cookie/test/unit/cookieprompt.manifest deleted file mode 100644 index 5a3bcad40aef..000000000000 --- a/extensions/cookie/test/unit/cookieprompt.manifest +++ /dev/null @@ -1,2 +0,0 @@ -component {509b5540-c87c-11dd-ad8b-0800200c9a66} cookieprompt.js -contract @mozilla.org/embedcomp/cookieprompt-service;1 {509b5540-c87c-11dd-ad8b-0800200c9a66} diff --git a/extensions/cookie/test/unit/xpcshell.ini b/extensions/cookie/test/unit/xpcshell.ini index e20d0142cc60..9735f414d0c9 100644 --- a/extensions/cookie/test/unit/xpcshell.ini +++ b/extensions/cookie/test/unit/xpcshell.ini @@ -2,9 +2,6 @@ head = head_cookies.js tail = skip-if = toolkit == 'android' -support-files = - cookieprompt.js - cookieprompt.manifest [test_bug526789.js] [test_bug650522.js] diff --git a/mobile/android/installer/package-manifest.in b/mobile/android/installer/package-manifest.in index e3c99a023174..6c1a0836fa82 100644 --- a/mobile/android/installer/package-manifest.in +++ b/mobile/android/installer/package-manifest.in @@ -109,7 +109,6 @@ @BINPATH@/components/content_html.xpt @BINPATH@/components/content_webrtc.xpt @BINPATH@/components/content_xslt.xpt -@BINPATH@/components/cookie.xpt @BINPATH@/components/directory.xpt @BINPATH@/components/docshell.xpt @BINPATH@/components/dom.xpt diff --git a/toolkit/components/cookie/content/cookieAcceptDialog.js b/toolkit/components/cookie/content/cookieAcceptDialog.js deleted file mode 100644 index 52a85e58b96e..000000000000 --- a/toolkit/components/cookie/content/cookieAcceptDialog.js +++ /dev/null @@ -1,180 +0,0 @@ -// -*- indent-tabs-mode: nil; js-indent-level: 2 -*- - -/* 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/. */ - -const nsICookieAcceptDialog = Components.interfaces.nsICookieAcceptDialog; -const nsIDialogParamBlock = Components.interfaces.nsIDialogParamBlock; -const nsICookie = Components.interfaces.nsICookie; -const nsICookiePromptService = Components.interfaces.nsICookiePromptService; - -Components.utils.import("resource://gre/modules/PrivateBrowsingUtils.jsm"); - -var params; -var cookieBundle; - -var showDetails = ""; -var hideDetails = ""; -var detailsAccessKey = ""; - -function onload() { - doSetOKCancel(cookieAcceptNormal, cookieDeny, cookieAcceptSession); - - var dialog = document.documentElement; - - document.getElementById("Button2").collapsed = false; - - document.getElementById("ok").label = dialog.getAttribute("acceptLabel"); - document.getElementById("ok").accessKey = dialog.getAttribute("acceptKey"); - document.getElementById("Button2").label = dialog.getAttribute("extra1Label"); - document.getElementById("Button2").accessKey = dialog.getAttribute("extra1Key"); - document.getElementById("cancel").label = dialog.getAttribute("cancelLabel"); - document.getElementById("cancel").accessKey = dialog.getAttribute("cancelKey"); - - // hook up button icons where implemented - document.getElementById("ok").setAttribute("icon", "accept"); - document.getElementById("cancel").setAttribute("icon", "cancel"); - document.getElementById("disclosureButton").setAttribute("icon", "properties"); - - cookieBundle = document.getElementById("cookieBundle"); - - // cache strings - if (!showDetails) { - showDetails = cookieBundle.getString('showDetails'); - } - if (!hideDetails) { - hideDetails = cookieBundle.getString('hideDetails'); - } - detailsAccessKey = cookieBundle.getString('detailsAccessKey'); - - if (document.getElementById('infobox').hidden) { - document.getElementById('disclosureButton').setAttribute("label", showDetails); - } else { - document.getElementById('disclosureButton').setAttribute("label", hideDetails); - } - document.getElementById('disclosureButton').setAttribute("accesskey", detailsAccessKey); - - if ("arguments" in window && window.arguments.length >= 1 && window.arguments[0]) { - try { - params = window.arguments[0].QueryInterface(nsIDialogParamBlock); - var cookie = params.objects.queryElementAt(0, nsICookie); - var cookiesFromHost = params.GetInt(nsICookieAcceptDialog.COOKIESFROMHOST); - - var messageFormat; - if (params.GetInt(nsICookieAcceptDialog.CHANGINGCOOKIE)) - messageFormat = 'permissionToModifyCookie'; - else if (cookiesFromHost > 1) - messageFormat = 'permissionToSetAnotherCookie'; - else if (cookiesFromHost == 1) - messageFormat = 'permissionToSetSecondCookie'; - else - messageFormat = 'permissionToSetACookie'; - - var hostname = params.GetString(nsICookieAcceptDialog.HOSTNAME); - - var messageText; - if (cookie) - messageText = cookieBundle.getFormattedString(messageFormat, [hostname, cookiesFromHost]); - else - // No cookies means something went wrong. Bring up the dialog anyway - // to not make the mess worse. - messageText = cookieBundle.getFormattedString(messageFormat, ["", cookiesFromHost]); - - var messageParent = document.getElementById("dialogtextbox"); - var messageParagraphs = messageText.split("\n"); - - // use value for the header, so it doesn't wrap. - var headerNode = document.getElementById("dialog-header"); - headerNode.setAttribute("value", messageParagraphs[0]); - - // use childnodes here, the text can wrap - for (var i = 1; i < messageParagraphs.length; i++) { - var descriptionNode = document.createElement("description"); - let text = document.createTextNode(messageParagraphs[i]); - descriptionNode.appendChild(text); - messageParent.appendChild(descriptionNode); - } - - if (cookie) { - document.getElementById('ifl_name').setAttribute("value", cookie.name); - document.getElementById('ifl_value').setAttribute("value", cookie.value); - document.getElementById('ifl_host').setAttribute("value", cookie.host); - document.getElementById('ifl_path').setAttribute("value", cookie.path); - document.getElementById('ifl_isSecure').setAttribute("value", - cookie.isSecure ? - cookieBundle.getString("forSecureOnly") : cookieBundle.getString("forAnyConnection") - ); - document.getElementById('ifl_expires').setAttribute("value", GetExpiresString(cookie.expires)); - document.getElementById('ifl_isDomain').setAttribute("value", - cookie.isDomain ? - cookieBundle.getString("domainColon") : cookieBundle.getString("hostColon") - ); - } - // set default result to not accept the cookie - params.SetInt(nsICookieAcceptDialog.ACCEPT_COOKIE, 0); - // and to not persist - params.SetInt(nsICookieAcceptDialog.REMEMBER_DECISION, 0); - } catch (e) { - } - } - - // The Private Browsing service might not be available - try { - if (window.opener && PrivateBrowsingUtils.isWindowPrivate(window.opener)) { - var persistCheckbox = document.getElementById("persistDomainAcceptance"); - persistCheckbox.removeAttribute("checked"); - persistCheckbox.setAttribute("disabled", "true"); - } - } catch (ex) {} -} - -function showhideinfo() { - var infobox = document.getElementById('infobox'); - - if (infobox.hidden) { - infobox.setAttribute("hidden", "false"); - document.getElementById('disclosureButton').setAttribute("label", hideDetails); - } else { - infobox.setAttribute("hidden", "true"); - document.getElementById('disclosureButton').setAttribute("label", showDetails); - } - sizeToContent(); -} - -function cookieAcceptNormal() { - // accept the cookie normally - params.SetInt(nsICookieAcceptDialog.ACCEPT_COOKIE, nsICookiePromptService.ACCEPT_COOKIE); - // And remember that when needed - params.SetInt(nsICookieAcceptDialog.REMEMBER_DECISION, document.getElementById('persistDomainAcceptance').checked); - window.close(); -} - -function cookieAcceptSession() { - // accept for the session only - params.SetInt(nsICookieAcceptDialog.ACCEPT_COOKIE, nsICookiePromptService.ACCEPT_SESSION_COOKIE); - // And remember that when needed - params.SetInt(nsICookieAcceptDialog.REMEMBER_DECISION, document.getElementById('persistDomainAcceptance').checked); - window.close(); -} - -function cookieDeny() { - // say that the cookie was rejected - params.SetInt(nsICookieAcceptDialog.ACCEPT_COOKIE, nsICookiePromptService.DENY_COOKIE); - // And remember that when needed - params.SetInt(nsICookieAcceptDialog.REMEMBER_DECISION, document.getElementById('persistDomainAcceptance').checked); - window.close(); -} - -function GetExpiresString(secondsUntilExpires) { - if (secondsUntilExpires) { - var date = new Date(1000 * secondsUntilExpires); - const locale = Components.classes["@mozilla.org/chrome/chrome-registry;1"] - .getService(Components.interfaces.nsIXULChromeRegistry) - .getSelectedLocale("global", true); - const dtOptions = { year: 'numeric', month: 'long', day: 'numeric', - hour: 'numeric', minute: 'numeric', second: 'numeric' }; - return date.toLocaleString(locale, dtOptions); - } - return cookieBundle.getString("expireAtEndOfSession"); -} diff --git a/toolkit/components/cookie/content/cookieAcceptDialog.xul b/toolkit/components/cookie/content/cookieAcceptDialog.xul deleted file mode 100644 index 99fd92c0c975..000000000000 --- a/toolkit/components/cookie/content/cookieAcceptDialog.xul +++ /dev/null @@ -1,118 +0,0 @@ - - - - - - - - - - - - - - -