diff --git a/src/chrome/content/overlay.js b/src/chrome/content/overlay.js index 34b19af..4ba5aaf 100644 --- a/src/chrome/content/overlay.js +++ b/src/chrome/content/overlay.js @@ -1,118 +1,11 @@ /* -*- Mode: js2; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -Components.utils.import("resource://gre/modules/Services.jsm"); -Components.utils.import("resource://gre/modules/ctypes.jsm"); -Components.utils.import("resource://moztray/LibGObject.jsm"); -Components.utils.import("resource://moztray/LibGtkStatusIcon.jsm"); Components.utils.import("resource://moztray/commons.js"); - -const MOZT_ICON_DIR = "chrome/skin/"; -const MOZT_ICON_SUFFIX = "32.png"; - - -/** - * mozt namespace. - */ -if ("undefined" == typeof(mozt)) { - var mozt = {}; -}; - -mozt.Handler = { - _windowsHidden: false, - - _getBaseWindow: function(win) { - var bw; - try { // thx Neil Deakin !! - bw = win.QueryInterface(Components.interfaces.nsIInterfaceRequestor) - .getInterface(Components.interfaces.nsIWebNavigation) - .QueryInterface(Components.interfaces.nsIDocShellTreeItem) - .treeOwner - .QueryInterface(Components.interfaces.nsIInterfaceRequestor) - .getInterface(Components.interfaces.nsIBaseWindow); - } catch (ex) { - bw = null; - setTimeout(function() {throw ex; }, 0); - // ignore no-interface exception - } - return bw; - }, - - _getAllWindows: function() { - mozt.Debug.debug("_getAllWindows"); - var baseWindows = new Array(); - var e = Services.wm.getEnumerator(null); - while (e.hasMoreElements()) { - var w = e.getNext(); - baseWindows[baseWindows.length] = this._getBaseWindow(w); - } - return baseWindows; - }, - - /* - * might need to remember position... - * var outX = {}, outY = {}, outCX = {}, outCY = {}; - * bw.getPositionAndSize(outX, outY, outCX, outCY); - * mozt.Debug.debug("pos: " - * + outX.value + ", " - * + outY.value + ", " - * + outCX.value + ", " - * + outCY.value - * ); - */ - showHideToTray: function(a1, a2, a3) { - mozt.Debug.debug("showHideToTray"); - - var baseWindows; - try { - baseWindows = this._getAllWindows(); - } catch (x) { - mozt.Debug.debug(x); - } - mozt.Debug.debug("baseWindows: " + baseWindows.length); - for(var i=0; i