Bug 537155 - Eliminate gFocused... globals.
authorSaint Wesonga wesongathedeveloper@yahoo.com>
Sun, 03 Jan 2010 12:44:28 +0100
changeset 4616 44d5b972c5c096d4d968a8235621538a82ab2982
parent 4615 2303689fabf41c75c449d1bcbcc8b49d5f60d012
child 4617 fc273a034e2f8bfd68c97add8f33c2931797bc57
push idunknown
push userunknown
push dateunknown
bugs537155
Bug 537155 - Eliminate gFocused... globals. r=neil.
suite/browser/navigator.js
--- a/suite/browser/navigator.js
+++ b/suite/browser/navigator.js
@@ -58,20 +58,16 @@ var gIgnoreFocus = false;
 var gIgnoreClick = false;
 var gURIFixup = null;
 
 var pref = null;
 
 //cached elements
 var gBrowser = null;
 
-// focused frame URL
-var gFocusedURL = null;
-var gFocusedDocument = null;
-
 // Pref listener constants
 const gButtonPrefListener =
 {
   domain: "browser.toolbars.showbutton",
   init: function()
   {
     var array = pref.getChildList(this.domain, {});
     array.forEach(
@@ -233,26 +229,16 @@ function getContentAreaFrameCount()
     saveFrameItem.setAttribute("hidden", "true");
   else {
     var autoDownload = pref.getBoolPref("browser.download.useDownloadDir");
     goSetMenuValue("saveframe", autoDownload ? "valueSave" : "valueSaveAs");
     saveFrameItem.removeAttribute("hidden");
   }
 }
 
-// When a content area frame is focused, update the focused frame URL
-function contentAreaFrameFocus()
-{
-  const focusedWindow = document.commandDispatcher.focusedWindow;
-  if (focusedWindow && focusedWindow.top == window.content) {
-    gFocusedURL = focusedWindow.location.href;
-    gFocusedDocument = focusedWindow.document;
-  }
-}
-
 function updateHomeButtonTooltip()
 {
   var homePage = getHomePage();
   var tooltip = document.getElementById("home-button-tooltip-inner");
 
   while (tooltip.firstChild)
     tooltip.removeChild(tooltip.firstChild);
 
@@ -508,17 +494,16 @@ function Startup()
   window.browserContentListener =
     new nsBrowserContentListener(window, getBrowser());
   
   // Add a capturing event listener to the content area
   // (rjc note: not the entire window, otherwise we'll get sidebar pane loads too!)
   //  so we'll be notified when onloads complete.
   var contentArea = document.getElementById("appcontent");
   contentArea.addEventListener("pageshow", pageShowEventHandlers, true);
-  contentArea.addEventListener("focus", contentAreaFrameFocus, true);
 
   // set default character set if provided
   if ("arguments" in window && window.arguments.length > 1 && window.arguments[1]) {
     if (window.arguments[1].indexOf("charset=") != -1) {
       var arrayArgComponents = window.arguments[1].split("=");
       if (arrayArgComponents) {
         //we should "inherit" the charset menu setting in a new window
         getMarkupDocumentViewer().defaultCharacterSet = arrayArgComponents[1];