blob: d2892a29229acfc197240cd94ab3cbe2973fa242 [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
Daniel Hosseinian159cb3d2020-03-13 03:02:0216#if defined(OS_MACOSX)
17// 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};
21#endif // defined(OS_MACOSX)
22
Alan Screenc0060762019-11-22 17:52:0623#if defined(OS_WIN)
24// Use XPS for printing instead of GDI.
25const base::Feature kUseXpsForPrinting{"UseXpsForPrinting",
26 base::FEATURE_DISABLED_BY_DEFAULT};
Alan Screen49388112019-12-13 23:34:2127
Daniel Hosseinian159cb3d2020-03-13 03:02:0228// Use XPS for printing instead of GDI for printing PDF documents. This is
Alan Screen49388112019-12-13 23:34:2129// independent of |kUseXpsForPrinting|; can use XPS for PDFs even if still using
30// GDI for modifiable content.
31const base::Feature kUseXpsForPrintingFromPdf{
32 "UseXpsForPrintingFromPdf", base::FEATURE_DISABLED_BY_DEFAULT};
Alan Screen28aeff32020-03-01 04:46:0633
34bool IsXpsPrintCapabilityRequired() {
35 return base::FeatureList::IsEnabled(features::kUseXpsForPrinting) ||
36 base::FeatureList::IsEnabled(features::kUseXpsForPrintingFromPdf);
37}
38
39bool ShouldPrintUsingXps(bool source_is_pdf) {
40 return base::FeatureList::IsEnabled(source_is_pdf
41 ? features::kUseXpsForPrintingFromPdf
42 : features::kUseXpsForPrinting);
43}
Alan Screen113d0142020-01-31 06:11:2144#endif // defined(OS_WIN)
Alan Screenc0060762019-11-22 17:52:0645
Yutaka Hiranoc45e93c42020-03-05 12:33:1746// When enabled, PrintRenderFrameHelper uses a frame-associated
47// URLLoaderFactory rather than renderer-associated one.
48const base::Feature kUseFrameAssociatedLoaderFactory{
49 "UseFrameAssociatedLoaderFactory", base::FEATURE_ENABLED_BY_DEFAULT};
50
Daniel Hosseinian7b57a422019-06-11 23:52:3251} // namespace features
52} // namespace printing