Add print preview support (see issue #123)

Pass the `--enable-print-preview` command-line flag to enable. Currently only
supported on Windows and Linux.
This commit is contained in:
Ananyo Maiti
2019-07-17 14:47:27 -04:00
committed by Marshall Greenblatt
parent cf87c88b05
commit 1669c0afbd
49 changed files with 1098 additions and 1425 deletions

View File

@@ -24,4 +24,22 @@ bool PdfExtensionEnabled() {
return enabled;
}
bool PrintPreviewEnabled() {
#if defined(OS_MACOSX)
// Not currently supported on macOS.
return false;
#else
if (!PdfExtensionEnabled())
return false;
if (base::CommandLine::ForCurrentProcess()->HasSwitch(
switches::kDisablePrintPreview)) {
return false;
}
return base::CommandLine::ForCurrentProcess()->HasSwitch(
switches::kEnablePrintPreview);
#endif
}
} // namespace extensions