Bug 1265126 - fix printing of compose window and special tabs by using PrintUtils.printWindow(). r=jorgk a=rkent
authoraceman <acelists@atlas.sk>
Sat, 16 Apr 2016 11:18:00 +0200
changeset 31284 63fca1af88b1ae7ada7530517c37f19283e2bbcd
parent 31283 4f1b213a9b21e2ff566e633e86624dbf235ec334
child 31285 b9944e3236ebc017483de22e6fdb31fca26fdf06
push id1
push userclokep@gmail.com
push dateMon, 07 May 2018 22:45:56 +0000
treeherdercomm-esr60@57eacde5ef40 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjorgk, rkent
bugs1265126
Bug 1265126 - fix printing of compose window and special tabs by using PrintUtils.printWindow(). r=jorgk a=rkent
mail/base/content/specialTabs.js
mail/components/compose/content/MsgComposeCommands.js
--- a/mail/base/content/specialTabs.js
+++ b/mail/base/content/specialTabs.js
@@ -420,17 +420,18 @@ var contentTabBaseType = {
         break;
       case "cmd_findPrevious":
         aTab.findbar.onFindAgainCommand(true);
         break;
       case "cmd_printSetup":
         PrintUtils.showPageSetup();
         break;
       case "cmd_print":
-        PrintUtils.print();
+        let browser = this.getBrowser(aTab);
+        PrintUtils.printWindow(browser.outerWindowID, browser);
         break;
       // XXX print preview not currently supported - bug 497994 to implement.
       //case "cmd_printpreview":
       //  PrintUtils.printPreview();
       //  break;
       case "cmd_stop":
         aTab.browser.stop();
         break;
@@ -1143,17 +1144,18 @@ var specialTabs = {
           break;
         case "cmd_fullZoomToggle":
           ZoomManager.toggleZoom();
           break;
         case "cmd_printSetup":
           PrintUtils.showPageSetup();
           break;
         case "cmd_print":
-          PrintUtils.print();
+          let browser = this.getBrowser(aTab);
+          PrintUtils.printWindow(browser.outerWindowID, browser);
           break;
         // XXX print preview not currently supported - bug 497994 to implement.
         //case "cmd_printpreview":
         //  PrintUtils.printPreview();
         //  break;
       }
     },
     getBrowser: function getBrowser(aTab) {
--- a/mail/components/compose/content/MsgComposeCommands.js
+++ b/mail/components/compose/content/MsgComposeCommands.js
@@ -1688,17 +1688,18 @@ function DoCommandClose()
   }
 
   return false;
 }
 
 function DoCommandPrint()
 {
   try {
-    PrintUtils.print();
+    let editor = GetCurrentEditorElement();
+    PrintUtils.printWindow(editor.outerWindowID, editor);
   } catch(ex) {dump("#PRINT ERROR: " + ex + "\n");}
 }
 
 function DoCommandPrintPreview()
 {
   try {
     PrintUtils.printPreview(PrintPreviewListener);
     } catch(ex) { Components.utils.reportError(ex); }