summaryrefslogtreecommitdiffstats
path: root/application/basilisk/modules/RemotePrompt.jsm
diff options
context:
space:
mode:
authorMatt A. Tobin <email@mattatobin.com>2018-02-02 05:06:10 -0500
committerMatt A. Tobin <email@mattatobin.com>2018-02-02 05:06:10 -0500
commit6d614170cbfa958564eb5f824234ad5a9e484344 (patch)
tree3e1eb384382f30987cb2e64bd654afa8b74fd06b /application/basilisk/modules/RemotePrompt.jsm
parent2a6b605d64b19411a300efdbbd7f78c349f90206 (diff)
downloadUXP-6d614170cbfa958564eb5f824234ad5a9e484344.tar
UXP-6d614170cbfa958564eb5f824234ad5a9e484344.tar.gz
UXP-6d614170cbfa958564eb5f824234ad5a9e484344.tar.lz
UXP-6d614170cbfa958564eb5f824234ad5a9e484344.tar.xz
UXP-6d614170cbfa958564eb5f824234ad5a9e484344.zip
Revert "Add Basilisk"
This reverts commit e72ef92b5bdc43cd2584198e2e54e951b70299e8.
Diffstat (limited to 'application/basilisk/modules/RemotePrompt.jsm')
-rw-r--r--application/basilisk/modules/RemotePrompt.jsm110
1 files changed, 0 insertions, 110 deletions
diff --git a/application/basilisk/modules/RemotePrompt.jsm b/application/basilisk/modules/RemotePrompt.jsm
deleted file mode 100644
index 9dde55b8f..000000000
--- a/application/basilisk/modules/RemotePrompt.jsm
+++ /dev/null
@@ -1,110 +0,0 @@
-/* vim: set ts=2 sw=2 et tw=80: */
-/* 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/. */
-
-"use strict";
-
-var Cc = Components.classes;
-var Ci = Components.interfaces;
-var Cu = Components.utils;
-
-this.EXPORTED_SYMBOLS = [ "RemotePrompt" ];
-
-Cu.import("resource:///modules/PlacesUIUtils.jsm");
-Cu.import("resource://gre/modules/PrivateBrowsingUtils.jsm");
-Cu.import("resource://gre/modules/Services.jsm");
-Cu.import("resource://gre/modules/SharedPromptUtils.jsm");
-
-var RemotePrompt = {
- init() {
- let mm = Cc["@mozilla.org/globalmessagemanager;1"].getService(Ci.nsIMessageListenerManager);
- mm.addMessageListener("Prompt:Open", this);
- },
-
- receiveMessage(message) {
- switch (message.name) {
- case "Prompt:Open":
- if (message.data.uri) {
- this.openModalWindow(message.data, message.target);
- } else {
- this.openTabPrompt(message.data, message.target)
- }
- break;
- }
- },
-
- openTabPrompt(args, browser) {
- let window = browser.ownerGlobal;
- let tabPrompt = window.gBrowser.getTabModalPromptBox(browser)
- let newPrompt;
- let needRemove = false;
- let promptId = args._remoteId;
-
- function onPromptClose(forceCleanup) {
- // It's possible that we removed the prompt during the
- // appendPrompt call below. In that case, newPrompt will be
- // undefined. We set the needRemove flag to remember to remove
- // it right after we've finished adding it.
- if (newPrompt)
- tabPrompt.removePrompt(newPrompt);
- else
- needRemove = true;
-
- PromptUtils.fireDialogEvent(window, "DOMModalDialogClosed", browser);
- browser.messageManager.sendAsyncMessage("Prompt:Close", args);
- }
-
- browser.messageManager.addMessageListener("Prompt:ForceClose", function listener(message) {
- // If this was for another prompt in the same tab, ignore it.
- if (message.data._remoteId !== promptId) {
- return;
- }
-
- browser.messageManager.removeMessageListener("Prompt:ForceClose", listener);
-
- if (newPrompt) {
- newPrompt.abortPrompt();
- }
- });
-
- try {
- let eventDetail = {
- tabPrompt: true,
- promptPrincipal: args.promptPrincipal,
- inPermitUnload: args.inPermitUnload,
- };
- PromptUtils.fireDialogEvent(window, "DOMWillOpenModalDialog", browser, eventDetail);
-
- args.promptActive = true;
-
- newPrompt = tabPrompt.appendPrompt(args, onPromptClose);
-
- if (needRemove) {
- tabPrompt.removePrompt(newPrompt);
- }
-
- // TODO since we don't actually open a window, need to check if
- // there's other stuff in nsWindowWatcher::OpenWindowInternal
- // that we might need to do here as well.
- } catch (ex) {
- onPromptClose(true);
- }
- },
-
- openModalWindow(args, browser) {
- let window = browser.ownerGlobal;
- try {
- PromptUtils.fireDialogEvent(window, "DOMWillOpenModalDialog", browser);
- let bag = PromptUtils.objectToPropBag(args);
-
- Services.ww.openWindow(window, args.uri, "_blank",
- "centerscreen,chrome,modal,titlebar", bag);
-
- PromptUtils.propBagToObject(bag, args);
- } finally {
- PromptUtils.fireDialogEvent(window, "DOMModalDialogClosed", browser);
- browser.messageManager.sendAsyncMessage("Prompt:Close", args);
- }
- }
-};