Daniel Hosseinian | 7b57a42 | 2019-06-11 23:52:32 | [diff] [blame] | 1 | // 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 Screen | 113d014 | 2020-01-31 06:11:21 | [diff] [blame] | 5 | #include "printing/printing_features.h" |
Daniel Hosseinian | 7b57a42 | 2019-06-11 23:52:32 | [diff] [blame] | 6 | |
| 7 | namespace printing { |
| 8 | namespace features { |
| 9 | |
Alan Screen | 2215769 | 2020-01-31 06:15:07 | [diff] [blame] | 10 | #if defined(OS_CHROMEOS) |
| 11 | // Enables Advanced PPD Attributes. |
| 12 | const base::Feature kAdvancedPpdAttributes{"AdvancedPpdAttributes", |
| 13 | base::FEATURE_ENABLED_BY_DEFAULT}; |
| 14 | #endif // defined(OS_CHROMEOS) |
| 15 | |
Alan Screen | c006076 | 2019-11-22 17:52:06 | [diff] [blame] | 16 | #if defined(OS_WIN) |
| 17 | // Use XPS for printing instead of GDI. |
| 18 | const base::Feature kUseXpsForPrinting{"UseXpsForPrinting", |
| 19 | base::FEATURE_DISABLED_BY_DEFAULT}; |
Alan Screen | 4938811 | 2019-12-13 23:34:21 | [diff] [blame] | 20 | |
| 21 | // Use XPS for printing instead of GDI for printing PDF documents. This is |
| 22 | // independent of |kUseXpsForPrinting|; can use XPS for PDFs even if still using |
| 23 | // GDI for modifiable content. |
| 24 | const base::Feature kUseXpsForPrintingFromPdf{ |
| 25 | "UseXpsForPrintingFromPdf", base::FEATURE_DISABLED_BY_DEFAULT}; |
Alan Screen | 28aeff3 | 2020-03-01 04:46:06 | [diff] [blame^] | 26 | |
| 27 | bool IsXpsPrintCapabilityRequired() { |
| 28 | return base::FeatureList::IsEnabled(features::kUseXpsForPrinting) || |
| 29 | base::FeatureList::IsEnabled(features::kUseXpsForPrintingFromPdf); |
| 30 | } |
| 31 | |
| 32 | bool ShouldPrintUsingXps(bool source_is_pdf) { |
| 33 | return base::FeatureList::IsEnabled(source_is_pdf |
| 34 | ? features::kUseXpsForPrintingFromPdf |
| 35 | : features::kUseXpsForPrinting); |
| 36 | } |
Alan Screen | 113d014 | 2020-01-31 06:11:21 | [diff] [blame] | 37 | #endif // defined(OS_WIN) |
Alan Screen | c006076 | 2019-11-22 17:52:06 | [diff] [blame] | 38 | |
Daniel Hosseinian | 7b57a42 | 2019-06-11 23:52:32 | [diff] [blame] | 39 | } // namespace features |
| 40 | } // namespace printing |