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 #ifndef PRINTING_PRINTING_FEATURES_H_
6 #define PRINTING_PRINTING_FEATURES_H_
8 #include "base/component_export.h"
9 #include "base/feature_list.h"
10 #include "base/metrics/field_trial_params.h"
11 #include "build/build_config.h"
12 #include "printing/buildflags/buildflags.h"
17 // The following features are declared alphabetically. The features should be
18 // documented with descriptions of their behaviors in the .cc file.
20 #if BUILDFLAG(IS_CHROMEOS)
21 COMPONENT_EXPORT(PRINTING_BASE) BASE_DECLARE_FEATURE(kEnableBorderlessPrinting);
22 #endif // BUILDFLAG(IS_CHROMEOS)
25 COMPONENT_EXPORT(PRINTING_BASE) BASE_DECLARE_FEATURE(kCupsIppPrintingBackend);
26 #endif // BUILDFLAG(IS_MAC)
29 COMPONENT_EXPORT(PRINTING_BASE)
30 BASE_DECLARE_FEATURE(kPrintWithPostScriptType42Fonts);
31 COMPONENT_EXPORT(PRINTING_BASE)
32 BASE_DECLARE_FEATURE(kPrintWithReducedRasterization);
33 COMPONENT_EXPORT(PRINTING_BASE)
34 BASE_DECLARE_FEATURE(kReadPrinterCapabilitiesWithXps);
35 COMPONENT_EXPORT(PRINTING_BASE) BASE_DECLARE_FEATURE(kUseXpsForPrinting);
36 COMPONENT_EXPORT(PRINTING_BASE) BASE_DECLARE_FEATURE(kUseXpsForPrintingFromPdf);
38 // Helper function to determine if there is any print path which could require
39 // the use of XPS print capabilities.
40 COMPONENT_EXPORT(PRINTING_BASE) bool IsXpsPrintCapabilityRequired();
42 // Helper function to determine if printing of a document from a particular
43 // source should be done using XPS printing API instead of with GDI.
44 COMPONENT_EXPORT(PRINTING_BASE)
45 bool ShouldPrintUsingXps(bool source_is_pdf);
46 #endif // BUILDFLAG(IS_WIN)
48 #if BUILDFLAG(ENABLE_OOP_PRINTING)
49 COMPONENT_EXPORT(PRINTING_BASE) BASE_DECLARE_FEATURE(kEnableOopPrintDrivers);
50 COMPONENT_EXPORT(PRINTING_BASE)
51 extern const base::FeatureParam<bool> kEnableOopPrintDriversJobPrint;
52 COMPONENT_EXPORT(PRINTING_BASE)
53 extern const base::FeatureParam<bool> kEnableOopPrintDriversSandbox;
55 COMPONENT_EXPORT(PRINTING_BASE)
56 extern const base::FeatureParam<bool> kEnableOopPrintDriversSingleProcess;
59 // Helper function to determine if a printing of a document should be made OOP
60 // using a Print Backend service.
61 COMPONENT_EXPORT(PRINTING_BASE) bool ShouldPrintJobOop();
62 #endif // BUILDFLAG(ENABLE_OOP_PRINTING)
64 #if BUILDFLAG(ENABLE_PRINT_CONTENT_ANALYSIS)
65 // Enterprise code gated by the following two features is handled almost
66 // identically through the print stack, but the underlying enterprise behavior
67 // changes significantly depending on which service provider is set by the
68 // OnPrintEnterpriseConnector policy. As such, using two features allows both
69 // workflows to be tested and ramped up/down independently.
71 // Since the policy can only ever be enabled with a cloud provider or a local
72 // provider, both flags being enabled at once shouldn't impact either workflows
73 // in an unexpected way since administrators will select a policy value that
74 // interacts with at most one of these two features.
76 // Allows the scanning to happen post-print-preview when
77 // OnPrintEnterpriseConnector has the "google" service_provider instead of doing
78 // a pre-print-preview snapshot and sending it to the cloud for analysis.
79 COMPONENT_EXPORT(PRINTING_BASE)
80 BASE_DECLARE_FEATURE(kEnableCloudScanAfterPreview);
82 // Allows the scanning to happen post-print-preview when
83 // OnPrintEnterpriseConnector has a local agent service_provider instead of
84 // doing a pre-print-preview snapshot and sending it to a local agent for
85 // analysis. This applies to the following service_provider values:
87 // - local_system_agent
90 // TODO(b/216105729): Remove once the local content scanning post-preview UX is
91 // officially supported.
92 COMPONENT_EXPORT(PRINTING_BASE)
93 BASE_DECLARE_FEATURE(kEnableLocalScanAfterPreview);
94 #endif // BUILDFLAG(ENABLE_PRINT_CONTENT_ANALYSIS)
96 } // namespace features
97 } // namespace printing
99 #endif // PRINTING_PRINTING_FEATURES_H_