зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1664332. Derive the prepopulated filename for save-to-PDF via the system print dialog from the document title. r=sfoster
Differential Revision: https://phabricator.services.mozilla.com/D89838
This commit is contained in:
Родитель
744a5e4c1e
Коммит
bace57115a
|
@ -164,6 +164,10 @@ var PrintEventHandler = {
|
||||||
? PrintUtils.getPrintSettings(this.viewSettings.defaultSystemPrinter)
|
? PrintUtils.getPrintSettings(this.viewSettings.defaultSystemPrinter)
|
||||||
: this.settings.clone();
|
: this.settings.clone();
|
||||||
settings.showPrintProgress = true;
|
settings.showPrintProgress = true;
|
||||||
|
// We set the title so that if the user chooses save-to-PDF from the
|
||||||
|
// system dialog the title will be used to generate the prepopulated
|
||||||
|
// filename in the file picker.
|
||||||
|
settings.title = this.previewBrowser.browsingContext.embedderElement.contentTitle;
|
||||||
const PRINTPROMPTSVC = Cc[
|
const PRINTPROMPTSVC = Cc[
|
||||||
"@mozilla.org/embedcomp/printingprompt-service;1"
|
"@mozilla.org/embedcomp/printingprompt-service;1"
|
||||||
].getService(Ci.nsIPrintingPromptService);
|
].getService(Ci.nsIPrintingPromptService);
|
||||||
|
|
Загрузка…
Ссылка в новой задаче