Bug 1265126 - fix printing of compose window and special tabs by using PrintUtils.printWindow(). r=jorgk a=jorgk
authoraceman <acelists@atlas.sk>
Sat, 16 Apr 2016 11:18:00 +0200
changeset 26979 c66fadeb47f65eda25c9c809e771ee3a3986b4f0
parent 26978 7d7b4275989563498e225748ac20b77660ed601e
child 26980 43c1462bfc4da9c1ab59f39814152da4481d84e0
push id1850
push userclokep@gmail.com
push dateWed, 08 Mar 2017 19:29:12 +0000
treeherdercomm-esr52@028df196b2d9 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjorgk, jorgk
bugs1265126
Bug 1265126 - fix printing of compose window and special tabs by using PrintUtils.printWindow(). r=jorgk a=jorgk
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
@@ -1676,17 +1676,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); }