Bug 630265 - Bookmarks menu broken in non browser windows. r=mak. a=blocker.
authorAsaf Romano (Mano) <mano@mozilla.com>
Mon, 31 Jan 2011 22:04:03 +0200
changeset 61656 947ba01d23f3713824a87190dfc33577ac23543a
parent 61655 0162ac678b8ff5e7278275243758835e3c072679
child 61657 5e4632c4dd7c085cc2dbed10a89484655b708de6
push idunknown
push userunknown
push dateunknown
reviewersmak, blocker
bugs630265
milestone2.0b11pre
Bug 630265 - Bookmarks menu broken in non browser windows. r=mak. a=blocker.
browser/base/content/browser-places.js
browser/base/content/browser.js
--- a/browser/base/content/browser-places.js
+++ b/browser/base/content/browser-places.js
@@ -414,16 +414,20 @@ var PlacesCommandHook = {
     }
   },
 
   /**
    * Updates disabled state for the "Bookmark All Tabs" command.
    */
   updateBookmarkAllTabsCommand:
   function PCH_updateBookmarkAllTabsCommand() {
+    // There's nothing to do in non-browser windows.
+    if (window.location.href != getBrowserURL())
+      return;
+
     // Disable "Bookmark All Tabs" if there are less than two
     // "unique current pages".
     goSetCommandEnabled("Browser:BookmarkAllTabs",
                         this.uniqueCurrentPages.length >= 2);
   },
 
   /**
    * Adds a Live Bookmark to a feed associated with the current page. 
--- a/browser/base/content/browser.js
+++ b/browser/base/content/browser.js
@@ -1728,18 +1728,18 @@ function BrowserShutdown()
 // macBrowserOverlay
 function nonBrowserWindowStartup()
 {
   // Disable inappropriate commands / submenus
   var disabledItems = ['Browser:SavePage',
                        'Browser:SendLink', 'cmd_pageSetup', 'cmd_print', 'cmd_find', 'cmd_findAgain',
                        'viewToolbarsMenu', 'viewSidebarMenuMenu', 'Browser:Reload',
                        'viewFullZoomMenu', 'pageStyleMenu', 'charsetMenu', 'View:PageSource', 'View:FullScreen',
-                       'viewHistorySidebar', 'Browser:AddBookmarkAs', 'View:PageInfo', 'Tasks:InspectPage',
-                       'Browser:ToggleTabView'];
+                       'viewHistorySidebar', 'Browser:AddBookmarkAs', 'Browser:BookmarkAllTabs',
+                       'View:PageInfo', 'Tasks:InspectPage', 'Browser:ToggleTabView', ];
   var element;
 
   for (var id in disabledItems)
   {
     element = document.getElementById(disabledItems[id]);
     if (element)
       element.setAttribute("disabled", "true");
   }