[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

[or-cvs] r15473: Return the current selected tab instead of the outer browser (torbutton/trunk/src/components)



Author: mikeperry
Date: 2008-06-26 03:07:33 -0400 (Thu, 26 Jun 2008)
New Revision: 15473

Modified:
   torbutton/trunk/src/components/window-mapper.js
Log:

Return the current selected tab instead of the outer browser
and demote log messages to notice.



Modified: torbutton/trunk/src/components/window-mapper.js
===================================================================
--- torbutton/trunk/src/components/window-mapper.js	2008-06-26 05:25:30 UTC (rev 15472)
+++ torbutton/trunk/src/components/window-mapper.js	2008-06-26 07:07:33 UTC (rev 15473)
@@ -130,27 +130,27 @@
           }
       }
 
-      // FIXME: SpeedDial and other extensions can create their 
+      // SpeedDial, google notebook and other extensions can create their 
       // own "<browser>" tag elements. AFAICT, there is no way to enumerate
       // these... Just punt and return the most recently used browser
       try {
           if(topContentWindow.name != "speedDialLoaderBrowser") {
               if(topContentWindow && topContentWindow.location)
-                  this.logger.log(5, "No browser found: "+topContentWindow.location);
+                  this.logger.log(4, "No browser found: "+topContentWindow.location);
               else
-                  this.logger.log(5, "No browser found: "+topContentWindow.name);
+                  this.logger.log(4, "No browser found: "+topContentWindow.name);
           } else {
               this.logger.log(3, "SpeedDial browser found: "+topContentWindow.name);
           }
       } catch(e) {
-          this.logger.log(5, "No browser found.");
+          this.logger.log(4, "No browser found.");
       }
 
       // Punt..
       var wm = Components.classes["@mozilla.org/appshell/window-mediator;1"].
           getService(Components.interfaces.nsIWindowMediator);
       var recentWindow = wm.getMostRecentWindow("navigator:browser");
-      return recentWindow ? recentWindow.getBrowser() : null;
+      return recentWindow ? recentWindow.getBrowser().selectedTab.linkedBrowser : null;
   }
 }