Bug 1820641: Make a test that calls window.restore handle zoomed windows. r=mstange
[gecko.git] / toolkit / actors / PrintingParent.jsm
blob7c2e2ce6689cfb1b4b97491af213111ad506eb8a
1 /* vim: set ts=2 sw=2 sts=2 et tw=80: */
2 /* This Source Code Form is subject to the terms of the Mozilla Public
3  * License, v. 2.0. If a copy of the MPL was not distributed with this
4  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
5 "use strict";
7 var EXPORTED_SYMBOLS = ["PrintingParent"];
9 class PrintingParent extends JSWindowActorParent {
10   receiveMessage(message) {
11     let browser = this.browsingContext.top.embedderElement;
13     if (message.name == "Printing:Error") {
14       browser.ownerGlobal.PrintUtils._displayPrintingError(
15         message.data.nsresult,
16         message.data.isPrinting
17       );
18     } else if (message.name == "Printing:Preview:CurrentPage") {
19       browser.setAttribute("current-page", message.data.currentPage);
20     }
22     return undefined;
23   }