Bug 1122697 - [Linux Only] When opening a bookmark folder, no tabs are opened when the opening multiple tabs dialog warning is dismissed r=Neil
authorPhilip Chee <philip.chee@gmail.com>
Sun, 01 Feb 2015 01:12:41 +0800
changeset 21641 e8b1aa4336226be76486cba40a5900d083a45455
parent 21640 a08093dbf8713b96991bab95cb7609a0148f8683
child 21642 f471c3bd3c47ff9208535f764025731d9c32d5e6
push id1305
push usermbanner@mozilla.com
push dateMon, 23 Feb 2015 19:48:12 +0000
treeherdercomm-beta@3ae4f13858fd [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersNeil
bugs1122697
Bug 1122697 - [Linux Only] When opening a bookmark folder, no tabs are opened when the opening multiple tabs dialog warning is dismissed r=Neil a=IanN comm-aurora comm-beta comm-release CLOSED TREE
suite/modules/PlacesUIUtils.jsm
--- a/suite/modules/PlacesUIUtils.jsm
+++ b/suite/modules/PlacesUIUtils.jsm
@@ -639,22 +639,22 @@ var PlacesUIUtils = {
   _showBookmarkDialog: function PUIU__showBookmarkDialog(aInfo) {
     var dialogURL = "chrome://communicator/content/bookmarks/bm-props.xul";
     var features = "centerscreen,chrome,modal,resizable=yes";
     this._getCurrentActiveWin().openDialog(dialogURL, "", features, aInfo);
     return ("performed" in aInfo && aInfo.performed);
   },
 
   _getTopBrowserWin: function PUIU__getTopBrowserWin() {
-    return focusManager.activeWindow.gPrivate ||
+    return this._getCurrentActiveWin().gPrivate ||
            Services.wm.getMostRecentWindow("navigator:browser");
   },
 
   _getCurrentActiveWin: function PUIU__getCurrentActiveWin() {
-    return focusManager.activeWindow;
+    return focusManager.activeWindow || Services.wm.getMostRecentWindow(null);
   },
 
   /**
    * Returns the closet ancestor places view for the given DOM node
    * @param aNode
    *        a DOM node
    * @return the closet ancestor places view if exists, null otherwsie.
    */
@@ -926,22 +926,22 @@ var PlacesUIUtils = {
     }
     else {
       let win = this._getCurrentActiveWin();
       win.openDialog(win.getBrowserURL(), "_blank",
                      "chrome,all,dialog=no", urls.join("\n"));
     }
   },
 
-  openContainerNodeInTabs: function PUIU_openContainerInTabs(aNode, aEvent) {
+  openContainerNodeInTabs: function PUIU_openContainerInTabs(aNode, aEvent, aWhere) {
     var urlsToOpen = PlacesUtils.getURLsForContainerNode(aNode);
     if (!this._confirmOpenInTabs(urlsToOpen.length))
       return;
 
-    this._openTabset(urlsToOpen, aEvent);
+    this._openTabset(urlsToOpen, aEvent, aWhere);
   },
 
   openURINodesInTabs: function PUIU_openURINodesInTabs(aNodes, aEvent) {
     this.openSelectionIn(aNodes, null, aEvent);
   },
 
   openSelectionIn: function (aNodes, aWhere, aEvent) {
     var urlsToOpen = [];
@@ -972,17 +972,17 @@ var PlacesUIUtils = {
    * web panel.
    * see also openUILinkIn
    */
   openNodeIn: function PUIU_openNodeIn(aNode, aWhere) {
     if (!aNode || !aWhere)
       return;
     var win = this._getCurrentActiveWin();
     if (PlacesUtils.nodeIsContainer(aNode) && aWhere != "current") {
-        this.openContainerNodeInTabs(aNode, aWhere);
+      this.openContainerNodeInTabs(aNode, null, aWhere);
     } else if (PlacesUtils.nodeIsURI(aNode) && this.checkURLSecurity(aNode, win)) {
       var isBookmark = PlacesUtils.nodeIsBookmark(aNode);
 
       if (isBookmark)
         this.markPageAsFollowedBookmark(aNode.uri);
       else
         this.markPageAsTyped(aNode.uri);