blob: cc7d82e7158edbf0dca37df51a77f40d737ed5ba [file] [log] [blame]
Daniel Hosseinian7b57a422019-06-11 23:52:321// Copyright 2019 The Chromium Authors. All rights reserved.
2// Use of this source code is governed by a BSD-style license that can be
3// found in the LICENSE file.
4
Alan Screen113d0142020-01-31 06:11:215#include "printing/printing_features.h"
Daniel Hosseinian7b57a422019-06-11 23:52:326
7namespace printing {
8namespace features {
9
Alan Screen22157692020-01-31 06:15:0710#if defined(OS_CHROMEOS)
11// Enables Advanced PPD Attributes.
12const base::Feature kAdvancedPpdAttributes{"AdvancedPpdAttributes",
13 base::FEATURE_ENABLED_BY_DEFAULT};
14#endif // defined(OS_CHROMEOS)
15
Avi Drissman578cd722020-07-29 17:21:1516#if defined(OS_MAC)
Daniel Hosseinian159cb3d2020-03-13 03:02:0217// Use the CUPS IPP printing backend instead of the original CUPS backend that
18// calls the deprecated PPD API.
19const base::Feature kCupsIppPrintingBackend{"CupsIppPrintingBackend",
20 base::FEATURE_DISABLED_BY_DEFAULT};
Avi Drissman578cd722020-07-29 17:21:1521#endif // defined(OS_MAC)
Daniel Hosseinian159cb3d2020-03-13 03:02:0222
Alan Screenc0060762019-11-22 17:52:0623#if defined(OS_WIN)
Lei Zhang92eadbb2020-05-13 22:32:3624// When using GDI printing, avoid rasterization if possible.
25const base::Feature kPrintWithReducedRasterization{
26 "PrintWithReducedRasterization", base::FEATURE_DISABLED_BY_DEFAULT};
27
Alan Screenc0060762019-11-22 17:52:0628// Use XPS for printing instead of GDI.
29const base::Feature kUseXpsForPrinting{"UseXpsForPrinting",
30 base::FEATURE_DISABLED_BY_DEFAULT};
Alan Screen49388112019-12-13 23:34:2131
Daniel Hosseinian159cb3d2020-03-13 03:02:0232// Use XPS for printing instead of GDI for printing PDF documents. This is
Alan Screen49388112019-12-13 23:34:2133// independent of |kUseXpsForPrinting|; can use XPS for PDFs even if still using
34// GDI for modifiable content.
35const base::Feature kUseXpsForPrintingFromPdf{
36 "UseXpsForPrintingFromPdf", base::FEATURE_DISABLED_BY_DEFAULT};
Alan Screen28aeff32020-03-01 04:46:0637
38bool IsXpsPrintCapabilityRequired() {
39 return base::FeatureList::IsEnabled(features::kUseXpsForPrinting) ||
40 base::FeatureList::IsEnabled(features::kUseXpsForPrintingFromPdf);
41}
42
43bool ShouldPrintUsingXps(bool source_is_pdf) {
44 return base::FeatureList::IsEnabled(source_is_pdf
45 ? features::kUseXpsForPrintingFromPdf
46 : features::kUseXpsForPrinting);
47}
Alan Screen113d0142020-01-31 06:11:2148#endif // defined(OS_WIN)
Alan Screenc0060762019-11-22 17:52:0649
Alan Screen652ddbb2020-09-16 07:14:5350#if defined(OS_WIN) || defined(OS_MAC) || defined(OS_LINUX) || \
51 defined(OS_CHROMEOS)
52// Enables printing interactions with the operating system to be performed
53// out-of-process.
54const base::Feature kEnableOopPrintDrivers{"EnableOopPrintDrivers",
55 base::FEATURE_DISABLED_BY_DEFAULT};
56#endif // defined(OS_WIN) || defined(OS_MAC) || defined(OS_LINUX) ||
57 // defined(OS_CHROMEOS)
58
Daniel Hosseinian7b57a422019-06-11 23:52:3259} // namespace features
60} // namespace printing