Enable chrome with aura for tizen
[platform/framework/web/chromium-efl.git] / printing / printing_features.cc
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.
4
5 #include "printing/printing_features.h"
6
7 #include "build/build_config.h"
8 #include "printing/buildflags/buildflags.h"
9
10 #if BUILDFLAG(ENABLE_OOP_PRINTING)
11 #include "base/metrics/field_trial_params.h"
12 #endif
13
14 namespace printing {
15 namespace features {
16
17 #if BUILDFLAG(IS_MAC)
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)
24
25 #if BUILDFLAG(IS_WIN)
26 // When using PostScript level 3 printing, render text with Type 42 fonts if
27 // possible.
28 BASE_FEATURE(kPrintWithPostScriptType42Fonts,
29              "PrintWithPostScriptType42Fonts",
30              base::FEATURE_DISABLED_BY_DEFAULT);
31
32 // When using GDI printing, avoid rasterization if possible.
33 BASE_FEATURE(kPrintWithReducedRasterization,
34              "PrintWithReducedRasterization",
35              base::FEATURE_DISABLED_BY_DEFAULT);
36
37 // Read printer capabilities with XPS when use XPS for printing.
38 BASE_FEATURE(kReadPrinterCapabilitiesWithXps,
39              "ReadPrinterCapabilitiesWithXps",
40              base::FEATURE_DISABLED_BY_DEFAULT);
41
42 // Use XPS for printing instead of GDI.
43 BASE_FEATURE(kUseXpsForPrinting,
44              "UseXpsForPrinting",
45              base::FEATURE_DISABLED_BY_DEFAULT);
46
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);
53
54 bool IsXpsPrintCapabilityRequired() {
55   return base::FeatureList::IsEnabled(features::kUseXpsForPrinting) ||
56          base::FeatureList::IsEnabled(features::kUseXpsForPrintingFromPdf);
57 }
58
59 bool ShouldPrintUsingXps(bool source_is_pdf) {
60   return base::FeatureList::IsEnabled(source_is_pdf
61                                           ? features::kUseXpsForPrintingFromPdf
62                                           : features::kUseXpsForPrinting);
63 }
64 #endif  // BUILDFLAG(IS_WIN)
65
66 #if BUILDFLAG(ENABLE_OOP_PRINTING)
67 // Enables printing interactions with the operating system to be performed
68 // out-of-process.
69 BASE_FEATURE(kEnableOopPrintDrivers,
70              "EnableOopPrintDrivers",
71              base::FEATURE_DISABLED_BY_DEFAULT);
72
73 const base::FeatureParam<bool> kEnableOopPrintDriversJobPrint{
74     &kEnableOopPrintDrivers, "JobPrint", false};
75
76 const base::FeatureParam<bool> kEnableOopPrintDriversSandbox{
77     &kEnableOopPrintDrivers, "Sandbox", false};
78 #endif  // BUILDFLAG(ENABLE_OOP_PRINTING)
79
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)
87
88 }  // namespace features
89 }  // namespace printing