1 // Copyright 2019 The Chromium Authors
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #include "printing/printing_features.h"
7 #include "build/build_config.h"
8 #include "printing/buildflags/buildflags.h"
10 #if BUILDFLAG(ENABLE_OOP_PRINTING)
11 #include "base/metrics/field_trial_params.h"
18 // Use the CUPS IPP printing backend instead of the original CUPS backend that
19 // calls the deprecated PPD API.
20 BASE_FEATURE(kCupsIppPrintingBackend,
21 "CupsIppPrintingBackend",
22 base::FEATURE_ENABLED_BY_DEFAULT);
23 #endif // BUILDFLAG(IS_MAC)
26 // When using PostScript level 3 printing, render text with Type 42 fonts if
28 BASE_FEATURE(kPrintWithPostScriptType42Fonts,
29 "PrintWithPostScriptType42Fonts",
30 base::FEATURE_DISABLED_BY_DEFAULT);
32 // When using GDI printing, avoid rasterization if possible.
33 BASE_FEATURE(kPrintWithReducedRasterization,
34 "PrintWithReducedRasterization",
35 base::FEATURE_DISABLED_BY_DEFAULT);
37 // Read printer capabilities with XPS when use XPS for printing.
38 BASE_FEATURE(kReadPrinterCapabilitiesWithXps,
39 "ReadPrinterCapabilitiesWithXps",
40 base::FEATURE_DISABLED_BY_DEFAULT);
42 // Use XPS for printing instead of GDI.
43 BASE_FEATURE(kUseXpsForPrinting,
45 base::FEATURE_DISABLED_BY_DEFAULT);
47 // Use XPS for printing instead of GDI for printing PDF documents. This is
48 // independent of `kUseXpsForPrinting`; can use XPS for PDFs even if still using
49 // GDI for modifiable content.
50 BASE_FEATURE(kUseXpsForPrintingFromPdf,
51 "UseXpsForPrintingFromPdf",
52 base::FEATURE_DISABLED_BY_DEFAULT);
54 bool IsXpsPrintCapabilityRequired() {
55 return base::FeatureList::IsEnabled(features::kUseXpsForPrinting) ||
56 base::FeatureList::IsEnabled(features::kUseXpsForPrintingFromPdf);
59 bool ShouldPrintUsingXps(bool source_is_pdf) {
60 return base::FeatureList::IsEnabled(source_is_pdf
61 ? features::kUseXpsForPrintingFromPdf
62 : features::kUseXpsForPrinting);
64 #endif // BUILDFLAG(IS_WIN)
66 #if BUILDFLAG(ENABLE_OOP_PRINTING)
67 // Enables printing interactions with the operating system to be performed
69 BASE_FEATURE(kEnableOopPrintDrivers,
70 "EnableOopPrintDrivers",
71 base::FEATURE_DISABLED_BY_DEFAULT);
73 const base::FeatureParam<bool> kEnableOopPrintDriversJobPrint{
74 &kEnableOopPrintDrivers, "JobPrint", false};
76 const base::FeatureParam<bool> kEnableOopPrintDriversSandbox{
77 &kEnableOopPrintDrivers, "Sandbox", false};
78 #endif // BUILDFLAG(ENABLE_OOP_PRINTING)
80 #if BUILDFLAG(ENABLE_PRINT_CONTENT_ANALYSIS)
81 // Enables scanning of to-be-printed pages and documents for sensitive data if
82 // the OnPrintEnterpriseConnector policy is enabled.
83 BASE_FEATURE(kEnablePrintContentAnalysis,
84 "EnablePrintContentAnalysis",
85 base::FEATURE_DISABLED_BY_DEFAULT);
86 #endif // BUILDFLAG(ENABLE_PRINT_CONTENT_ANALYSIS)
88 } // namespace features
89 } // namespace printing