Commit 34c1b554 authored by Yuta Hijikata's avatar Yuta Hijikata Committed by Chromium LUCI CQ

LaCrOS: Replace defined(OS_CHROMEOS) with BUILDFLAG(IS_CHROMEOS_ASH)

The change is mostly mechanical replacing defined(OS_CHROMEOS) with
BUILDFLAG(IS_CHROMEOS_ASH) and GN variable is_chromeos with
is_chromeos_ash with some special cases (For those cases please
refer to http://go/lacros-macros).

The patch is made in preparation to switching lacros build from
target_os=linux to target_os=chromeos. This will prevent lacros from
changing behaviour after the switch.

Bug: 1052397
Change-Id: Iad750ef52b3a42cc0339e8e6fdb682c4cf397b16
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2550844Reviewed-by: default avatarAlex Gough <ajgo@chromium.org>
Reviewed-by: default avatarWei Li <weili@chromium.org>
Commit-Queue: Yuta Hijikata <ythjkt@chromium.org>
Cr-Commit-Position: refs/heads/master@{#833996}
parent 9b5d9de1
...@@ -2,6 +2,7 @@ ...@@ -2,6 +2,7 @@
# Use of this source code is governed by a BSD-style license that can be # Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file. # found in the LICENSE file.
import("//build/config/chromeos/ui_mode.gni")
import("//build/config/features.gni") import("//build/config/features.gni")
import("//build/config/sysroot.gni") import("//build/config/sysroot.gni")
import("//build/config/ui.gni") import("//build/config/ui.gni")
...@@ -14,7 +15,7 @@ if (is_mac) { ...@@ -14,7 +15,7 @@ if (is_mac) {
if (is_android) { if (is_android) {
import("//build/config/android/rules.gni") import("//build/config/android/rules.gni")
} }
if (use_cups && is_chromeos) { if (use_cups && is_chromeos_ash) {
import("//printing/backend/tools/code_generator.gni") import("//printing/backend/tools/code_generator.gni")
} }
...@@ -28,7 +29,7 @@ if ((enable_basic_printing && is_win) || enable_print_preview) { ...@@ -28,7 +29,7 @@ if ((enable_basic_printing && is_win) || enable_print_preview) {
# Enable the CUPS IPP printing backend. # Enable the CUPS IPP printing backend.
# TODO(crbug.com/226176): Remove this after CUPS PPD API calls are removed. # TODO(crbug.com/226176): Remove this after CUPS PPD API calls are removed.
declare_args() { declare_args() {
use_cups_ipp = use_cups && !is_linux use_cups_ipp = use_cups && !(is_linux || is_chromeos_lacros)
} }
# Several targets want to include this header file. We separate it out # Several targets want to include this header file. We separate it out
...@@ -37,7 +38,7 @@ source_set("printing_export") { ...@@ -37,7 +38,7 @@ source_set("printing_export") {
sources = [ "printing_export.h" ] sources = [ "printing_export.h" ]
} }
if (use_cups_ipp && is_chromeos) { if (use_cups_ipp && is_chromeos_ash) {
ipp_handler_map_path = "$target_gen_dir/backend/ipp_handler_map.cc" ipp_handler_map_path = "$target_gen_dir/backend/ipp_handler_map.cc"
ipp_code_generate("ipp_handlers_generate") { ipp_code_generate("ipp_handlers_generate") {
...@@ -125,7 +126,7 @@ component("printing") { ...@@ -125,7 +126,7 @@ component("printing") {
] ]
} }
if (is_chromeos) { if (is_chromeos_ash) {
defines += [ "PRINT_BACKEND_AVAILABLE" ] defines += [ "PRINT_BACKEND_AVAILABLE" ]
sources += [ sources += [
...@@ -136,7 +137,7 @@ component("printing") { ...@@ -136,7 +137,7 @@ component("printing") {
] ]
} }
if (is_linux) { if (is_linux || is_chromeos_lacros) {
sources += [ sources += [
"printed_document_linux.cc", "printed_document_linux.cc",
"printing_context_linux.cc", "printing_context_linux.cc",
...@@ -239,7 +240,7 @@ component("printing") { ...@@ -239,7 +240,7 @@ component("printing") {
] ]
} }
if (is_chromeos) { if (is_chromeos_ash) {
deps += [ ":ipp_handlers_generate" ] deps += [ ":ipp_handlers_generate" ]
sources += [ sources += [
...@@ -272,7 +273,7 @@ component("printing") { ...@@ -272,7 +273,7 @@ component("printing") {
} }
} }
if (use_cups_ipp || is_chromeos) { if (use_cups_ipp || is_chromeos_ash) {
sources += [ sources += [
"printer_query_result.h", "printer_query_result.h",
"printer_status.cc", "printer_status.cc",
...@@ -381,7 +382,7 @@ test("printing_unittests") { ...@@ -381,7 +382,7 @@ test("printing_unittests") {
sources += [ "backend/cups_ipp_helper_unittest.cc" ] sources += [ "backend/cups_ipp_helper_unittest.cc" ]
} }
if (is_chromeos) { if (is_chromeos_ash) {
sources += [ "printing_context_chromeos_unittest.cc" ] sources += [ "printing_context_chromeos_unittest.cc" ]
} else { } else {
sources += [ sources += [
......
...@@ -24,7 +24,7 @@ constexpr char kIppPinEncryption[] = "job-password-encryption"; // PWG 5100.11 ...@@ -24,7 +24,7 @@ constexpr char kIppPinEncryption[] = "job-password-encryption"; // PWG 5100.11
constexpr char kCollated[] = "separate-documents-collated-copies"; constexpr char kCollated[] = "separate-documents-collated-copies";
constexpr char kUncollated[] = "separate-documents-uncollated-copies"; constexpr char kUncollated[] = "separate-documents-uncollated-copies";
#if BUILDFLAG(IS_ASH) #if BUILDFLAG(IS_CHROMEOS_ASH)
constexpr char kIppDocumentAttributes[] = constexpr char kIppDocumentAttributes[] =
"document-creation-attributes"; // PWG 5100.5 "document-creation-attributes"; // PWG 5100.5
...@@ -35,6 +35,6 @@ constexpr char kPinEncryptionNone[] = "none"; ...@@ -35,6 +35,6 @@ constexpr char kPinEncryptionNone[] = "none";
constexpr char kOptionFalse[] = "false"; constexpr char kOptionFalse[] = "false";
constexpr char kOptionTrue[] = "true"; constexpr char kOptionTrue[] = "true";
#endif // BUILDFLAG(IS_ASH) #endif // BUILDFLAG(IS_CHROMEOS_ASH)
} // namespace printing } // namespace printing
...@@ -25,7 +25,7 @@ PRINTING_EXPORT extern const char kIppPinEncryption[]; ...@@ -25,7 +25,7 @@ PRINTING_EXPORT extern const char kIppPinEncryption[];
PRINTING_EXPORT extern const char kCollated[]; PRINTING_EXPORT extern const char kCollated[];
PRINTING_EXPORT extern const char kUncollated[]; PRINTING_EXPORT extern const char kUncollated[];
#if BUILDFLAG(IS_ASH) #if BUILDFLAG(IS_CHROMEOS_ASH)
PRINTING_EXPORT extern const char kIppDocumentAttributes[]; PRINTING_EXPORT extern const char kIppDocumentAttributes[];
PRINTING_EXPORT extern const char kIppJobAttributes[]; PRINTING_EXPORT extern const char kIppJobAttributes[];
...@@ -35,7 +35,7 @@ PRINTING_EXPORT extern const char kPinEncryptionNone[]; ...@@ -35,7 +35,7 @@ PRINTING_EXPORT extern const char kPinEncryptionNone[];
PRINTING_EXPORT extern const char kOptionFalse[]; PRINTING_EXPORT extern const char kOptionFalse[];
PRINTING_EXPORT extern const char kOptionTrue[]; PRINTING_EXPORT extern const char kOptionTrue[];
#endif // BUILDFLAG(IS_ASH) #endif // BUILDFLAG(IS_CHROMEOS_ASH)
} // namespace printing } // namespace printing
......
...@@ -24,19 +24,19 @@ ...@@ -24,19 +24,19 @@
#include "printing/printing_utils.h" #include "printing/printing_utils.h"
#include "printing/units.h" #include "printing/units.h"
#if BUILDFLAG(IS_ASH) #if BUILDFLAG(IS_CHROMEOS_ASH)
#include "base/callback.h" #include "base/callback.h"
#include "base/metrics/histogram_functions.h" #include "base/metrics/histogram_functions.h"
#include "base/no_destructor.h" #include "base/no_destructor.h"
#include "printing/backend/ipp_handler_map.h" #include "printing/backend/ipp_handler_map.h"
#include "printing/printing_features.h" #include "printing/printing_features.h"
#endif // BUILDFLAG(IS_ASH) #endif // BUILDFLAG(IS_CHROMEOS_ASH)
namespace printing { namespace printing {
#if BUILDFLAG(IS_ASH) #if BUILDFLAG(IS_CHROMEOS_ASH)
constexpr int kPinMinimumLength = 4; constexpr int kPinMinimumLength = 4;
#endif // BUILDFLAG(IS_ASH) #endif // BUILDFLAG(IS_CHROMEOS_ASH)
namespace { namespace {
...@@ -256,7 +256,7 @@ bool CollateDefault(const CupsOptionProvider& printer) { ...@@ -256,7 +256,7 @@ bool CollateDefault(const CupsOptionProvider& printer) {
return name && !base::StringPiece(name).compare(kCollated); return name && !base::StringPiece(name).compare(kCollated);
} }
#if BUILDFLAG(IS_ASH) #if BUILDFLAG(IS_CHROMEOS_ASH)
bool PinSupported(const CupsOptionProvider& printer) { bool PinSupported(const CupsOptionProvider& printer) {
ipp_attribute_t* attr = printer.GetSupportedOptionValues(kIppPin); ipp_attribute_t* attr = printer.GetSupportedOptionValues(kIppPin);
if (!attr) if (!attr)
...@@ -311,7 +311,7 @@ void ExtractAdvancedCapabilities(const CupsOptionProvider& printer, ...@@ -311,7 +311,7 @@ void ExtractAdvancedCapabilities(const CupsOptionProvider& printer,
attr_count += AddAttributes(printer, kIppDocumentAttributes, options); attr_count += AddAttributes(printer, kIppDocumentAttributes, options);
base::UmaHistogramCounts1000("Printing.CUPS.IppAttributesCount", attr_count); base::UmaHistogramCounts1000("Printing.CUPS.IppAttributesCount", attr_count);
} }
#endif // BUILDFLAG(IS_ASH) #endif // BUILDFLAG(IS_CHROMEOS_ASH)
} // namespace } // namespace
...@@ -334,11 +334,11 @@ void CapsAndDefaultsFromPrinter(const CupsOptionProvider& printer, ...@@ -334,11 +334,11 @@ void CapsAndDefaultsFromPrinter(const CupsOptionProvider& printer,
printer_info->default_paper = DefaultPaper(printer); printer_info->default_paper = DefaultPaper(printer);
printer_info->papers = SupportedPapers(printer); printer_info->papers = SupportedPapers(printer);
#if BUILDFLAG(IS_ASH) #if BUILDFLAG(IS_CHROMEOS_ASH)
printer_info->pin_supported = PinSupported(printer); printer_info->pin_supported = PinSupported(printer);
if (base::FeatureList::IsEnabled(printing::features::kAdvancedPpdAttributes)) if (base::FeatureList::IsEnabled(printing::features::kAdvancedPpdAttributes))
ExtractAdvancedCapabilities(printer, printer_info); ExtractAdvancedCapabilities(printer, printer_info);
#endif // BUILDFLAG(IS_ASH) #endif // BUILDFLAG(IS_CHROMEOS_ASH)
ExtractCopies(printer, printer_info); ExtractCopies(printer, printer_info);
ExtractColor(printer, printer_info); ExtractColor(printer, printer_info);
......
...@@ -285,7 +285,7 @@ TEST_F(PrintBackendCupsIppHelperTest, OmitPapersWithSpecialVendorIds) { ...@@ -285,7 +285,7 @@ TEST_F(PrintBackendCupsIppHelperTest, OmitPapersWithSpecialVendorIds) {
"iso b0"))); "iso b0")));
} }
#if BUILDFLAG(IS_ASH) #if BUILDFLAG(IS_CHROMEOS_ASH)
TEST_F(PrintBackendCupsIppHelperTest, PinSupported) { TEST_F(PrintBackendCupsIppHelperTest, PinSupported) {
printer_->SetSupportedOptions("job-password", MakeInteger(ipp_, 4)); printer_->SetSupportedOptions("job-password", MakeInteger(ipp_, 4));
printer_->SetSupportedOptions("job-password-encryption", printer_->SetSupportedOptions("job-password-encryption",
...@@ -364,6 +364,6 @@ TEST_F(PrintBackendCupsIppHelperTest, AdvancedCaps) { ...@@ -364,6 +364,6 @@ TEST_F(PrintBackendCupsIppHelperTest, AdvancedCaps) {
EXPECT_EQ(3u, caps.advanced_capabilities[5].values.size()); EXPECT_EQ(3u, caps.advanced_capabilities[5].values.size());
histograms.ExpectUniqueSample("Printing.CUPS.IppAttributesCount", 5, 1); histograms.ExpectUniqueSample("Printing.CUPS.IppAttributesCount", 5, 1);
} }
#endif // BUILDFLAG(IS_ASH) #endif // BUILDFLAG(IS_CHROMEOS_ASH)
} // namespace printing } // namespace printing
...@@ -2,6 +2,7 @@ ...@@ -2,6 +2,7 @@
# Use of this source code is governed by a BSD-style license that can be # Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file. # found in the LICENSE file.
import("//build/config/chromeos/ui_mode.gni")
import("//mojo/public/tools/bindings/mojom.gni") import("//mojo/public/tools/bindings/mojom.gni")
mojom("mojom") { mojom("mojom") {
...@@ -30,11 +31,14 @@ mojom("mojom") { ...@@ -30,11 +31,14 @@ mojom("mojom") {
] ]
traits_sources = [ "print_backend_mojom_traits.cc" ] traits_sources = [ "print_backend_mojom_traits.cc" ]
traits_headers = [ "print_backend_mojom_traits.h" ] traits_headers = [ "print_backend_mojom_traits.h" ]
traits_deps = [ "//printing:printing" ] traits_deps = [
"//build:chromeos_buildflags",
"//printing:printing",
]
}, },
] ]
if (is_chromeos) { if (is_chromeos_ash) {
cpp_typemaps += [ cpp_typemaps += [
{ {
types = [ types = [
......
...@@ -7,6 +7,7 @@ ...@@ -7,6 +7,7 @@
#include <map> #include <map>
#include "base/logging.h" #include "base/logging.h"
#include "build/chromeos_buildflags.h"
#include "ui/gfx/geometry/mojom/geometry.mojom-shared.h" #include "ui/gfx/geometry/mojom/geometry.mojom-shared.h"
#include "ui/gfx/geometry/mojom/geometry_mojom_traits.h" #include "ui/gfx/geometry/mojom/geometry_mojom_traits.h"
...@@ -38,7 +39,7 @@ struct less<::printing::PrinterSemanticCapsAndDefaults::Paper> { ...@@ -38,7 +39,7 @@ struct less<::printing::PrinterSemanticCapsAndDefaults::Paper> {
} }
}; };
#if defined(OS_CHROMEOS) #if BUILDFLAG(IS_CHROMEOS_ASH)
template <> template <>
struct less<::printing::AdvancedCapability> { struct less<::printing::AdvancedCapability> {
bool operator()(const ::printing::AdvancedCapability& lhs, bool operator()(const ::printing::AdvancedCapability& lhs,
...@@ -48,7 +49,7 @@ struct less<::printing::AdvancedCapability> { ...@@ -48,7 +49,7 @@ struct less<::printing::AdvancedCapability> {
return lhs.display_name < rhs.display_name; return lhs.display_name < rhs.display_name;
} }
}; };
#endif // defined(OS_CHROMEOS) #endif // BUILDFLAG(IS_CHROMEOS_ASH)
} // namespace std } // namespace std
...@@ -114,7 +115,7 @@ bool StructTraits<printing::mojom::PaperDataView, ...@@ -114,7 +115,7 @@ bool StructTraits<printing::mojom::PaperDataView,
data.ReadVendorId(&out->vendor_id) && data.ReadSizeUm(&out->size_um); data.ReadVendorId(&out->vendor_id) && data.ReadSizeUm(&out->size_um);
} }
#if defined(OS_CHROMEOS) #if BUILDFLAG(IS_CHROMEOS_ASH)
// static // static
printing::mojom::AdvancedCapabilityType printing::mojom::AdvancedCapabilityType
EnumTraits<printing::mojom::AdvancedCapabilityType, EnumTraits<printing::mojom::AdvancedCapabilityType,
...@@ -176,7 +177,7 @@ bool StructTraits<printing::mojom::AdvancedCapabilityDataView, ...@@ -176,7 +177,7 @@ bool StructTraits<printing::mojom::AdvancedCapabilityDataView,
data.ReadDefaultValue(&out->default_value) && data.ReadDefaultValue(&out->default_value) &&
data.ReadValues(&out->values); data.ReadValues(&out->values);
} }
#endif // defined(OS_CHROMEOS) #endif // BUILDFLAG(IS_CHROMEOS_ASH)
// static // static
bool StructTraits<printing::mojom::PrinterSemanticCapsAndDefaultsDataView, bool StructTraits<printing::mojom::PrinterSemanticCapsAndDefaultsDataView,
...@@ -200,11 +201,11 @@ bool StructTraits<printing::mojom::PrinterSemanticCapsAndDefaultsDataView, ...@@ -200,11 +201,11 @@ bool StructTraits<printing::mojom::PrinterSemanticCapsAndDefaultsDataView,
return false; return false;
} }
#if defined(OS_CHROMEOS) #if BUILDFLAG(IS_CHROMEOS_ASH)
out->pin_supported = data.pin_supported(); out->pin_supported = data.pin_supported();
if (!data.ReadAdvancedCapabilities(&out->advanced_capabilities)) if (!data.ReadAdvancedCapabilities(&out->advanced_capabilities))
return false; return false;
#endif // defined(OS_CHROMEOS) #endif // BUILDFLAG(IS_CHROMEOS_ASH)
// Extra validity checks. // Extra validity checks.
...@@ -247,7 +248,7 @@ bool StructTraits<printing::mojom::PrinterSemanticCapsAndDefaultsDataView, ...@@ -247,7 +248,7 @@ bool StructTraits<printing::mojom::PrinterSemanticCapsAndDefaultsDataView,
return false; return false;
} }
#if defined(OS_CHROMEOS) #if BUILDFLAG(IS_CHROMEOS_ASH)
DuplicateChecker<printing::AdvancedCapability> DuplicateChecker<printing::AdvancedCapability>
advanced_capabilities_dup_checker; advanced_capabilities_dup_checker;
if (advanced_capabilities_dup_checker.HasDuplicates( if (advanced_capabilities_dup_checker.HasDuplicates(
...@@ -255,7 +256,7 @@ bool StructTraits<printing::mojom::PrinterSemanticCapsAndDefaultsDataView, ...@@ -255,7 +256,7 @@ bool StructTraits<printing::mojom::PrinterSemanticCapsAndDefaultsDataView,
DLOG(ERROR) << "Duplicate advanced_capabilities detected."; DLOG(ERROR) << "Duplicate advanced_capabilities detected.";
return false; return false;
} }
#endif // defined(OS_CHROMEOS) #endif // BUILDFLAG(IS_CHROMEOS_ASH)
return true; return true;
} }
......
...@@ -8,6 +8,7 @@ ...@@ -8,6 +8,7 @@
#include <string> #include <string>
#include <vector> #include <vector>
#include "build/chromeos_buildflags.h"
#include "printing/backend/mojom/print_backend.mojom-shared.h" #include "printing/backend/mojom/print_backend.mojom-shared.h"
#include "printing/backend/print_backend.h" #include "printing/backend/print_backend.h"
#include "printing/mojom/print.mojom.h" #include "printing/mojom/print.mojom.h"
...@@ -63,7 +64,7 @@ struct StructTraits<printing::mojom::PaperDataView, ...@@ -63,7 +64,7 @@ struct StructTraits<printing::mojom::PaperDataView,
printing::PrinterSemanticCapsAndDefaults::Paper* out); printing::PrinterSemanticCapsAndDefaults::Paper* out);
}; };
#if defined(OS_CHROMEOS) #if BUILDFLAG(IS_CHROMEOS_ASH)
template <> template <>
struct EnumTraits<printing::mojom::AdvancedCapabilityType, struct EnumTraits<printing::mojom::AdvancedCapabilityType,
::printing::AdvancedCapability::Type> { ::printing::AdvancedCapability::Type> {
...@@ -114,7 +115,7 @@ struct StructTraits<printing::mojom::AdvancedCapabilityDataView, ...@@ -114,7 +115,7 @@ struct StructTraits<printing::mojom::AdvancedCapabilityDataView,
static bool Read(printing::mojom::AdvancedCapabilityDataView data, static bool Read(printing::mojom::AdvancedCapabilityDataView data,
::printing::AdvancedCapability* out); ::printing::AdvancedCapability* out);
}; };
#endif // defined(OS_CHROMEOS) #endif // BUILDFLAG(IS_CHROMEOS_ASH)
template <> template <>
struct StructTraits<printing::mojom::PrinterSemanticCapsAndDefaultsDataView, struct StructTraits<printing::mojom::PrinterSemanticCapsAndDefaultsDataView,
...@@ -174,7 +175,7 @@ struct StructTraits<printing::mojom::PrinterSemanticCapsAndDefaultsDataView, ...@@ -174,7 +175,7 @@ struct StructTraits<printing::mojom::PrinterSemanticCapsAndDefaultsDataView,
return p.default_dpi; return p.default_dpi;
} }
#if defined(OS_CHROMEOS) #if BUILDFLAG(IS_CHROMEOS_ASH)
static bool pin_supported(const printing::PrinterSemanticCapsAndDefaults& p) { static bool pin_supported(const printing::PrinterSemanticCapsAndDefaults& p) {
return p.pin_supported; return p.pin_supported;
} }
...@@ -182,7 +183,7 @@ struct StructTraits<printing::mojom::PrinterSemanticCapsAndDefaultsDataView, ...@@ -182,7 +183,7 @@ struct StructTraits<printing::mojom::PrinterSemanticCapsAndDefaultsDataView,
const printing::PrinterSemanticCapsAndDefaults& p) { const printing::PrinterSemanticCapsAndDefaults& p) {
return p.advanced_capabilities; return p.advanced_capabilities;
} }
#endif // defined(OS_CHROMEOS) #endif // BUILDFLAG(IS_CHROMEOS_ASH)
static bool Read(printing::mojom::PrinterSemanticCapsAndDefaultsDataView data, static bool Read(printing::mojom::PrinterSemanticCapsAndDefaultsDataView data,
printing::PrinterSemanticCapsAndDefaults* out); printing::PrinterSemanticCapsAndDefaults* out);
......
...@@ -6,6 +6,7 @@ ...@@ -6,6 +6,7 @@
#include <string> #include <string>
#include <vector> #include <vector>
#include "build/chromeos_buildflags.h"
#include "mojo/public/cpp/test_support/test_utils.h" #include "mojo/public/cpp/test_support/test_utils.h"
#include "printing/backend/mojom/print_backend.mojom.h" #include "printing/backend/mojom/print_backend.mojom.h"
#include "printing/backend/print_backend.h" #include "printing/backend/print_backend.h"
...@@ -29,7 +30,7 @@ const printing::PrinterSemanticCapsAndDefaults::Paper kPaperLedger{ ...@@ -29,7 +30,7 @@ const printing::PrinterSemanticCapsAndDefaults::Paper kPaperLedger{
/*display_name=*/"Ledger", /*vendor_id=*/"89", /*display_name=*/"Ledger", /*vendor_id=*/"89",
/*size_um=*/gfx::Size(6600, 10200)}; /*size_um=*/gfx::Size(6600, 10200)};
#if defined(OS_CHROMEOS) #if BUILDFLAG(IS_CHROMEOS_ASH)
const printing::AdvancedCapability kAdvancedCapability1( const printing::AdvancedCapability kAdvancedCapability1(
/*name=*/"advanced_cap_bool", /*name=*/"advanced_cap_bool",
/*display_name=*/"Advanced Capability #1 (bool)", /*display_name=*/"Advanced Capability #1 (bool)",
...@@ -55,7 +56,7 @@ const printing::AdvancedCapability kAdvancedCapability2( ...@@ -55,7 +56,7 @@ const printing::AdvancedCapability kAdvancedCapability2(
}); });
const printing::AdvancedCapabilities kAdvancedCapabilities{ const printing::AdvancedCapabilities kAdvancedCapabilities{
kAdvancedCapability1, kAdvancedCapability2}; kAdvancedCapability1, kAdvancedCapability2};
#endif // defined(OS_CHROMEOS) #endif // BUILDFLAG(IS_CHROMEOS_ASH)
static constexpr bool kCollateCapable = true; static constexpr bool kCollateCapable = true;
static constexpr bool kCollateDefault = true; static constexpr bool kCollateDefault = true;
...@@ -83,7 +84,7 @@ static constexpr gfx::Size kDpi1200(1200, 1200); ...@@ -83,7 +84,7 @@ static constexpr gfx::Size kDpi1200(1200, 1200);
static constexpr gfx::Size kDpi1200x600(1200, 600); static constexpr gfx::Size kDpi1200x600(1200, 600);
const std::vector<gfx::Size> kDpis{kDpi600, kDpi1200, kDpi1200x600}; const std::vector<gfx::Size> kDpis{kDpi600, kDpi1200, kDpi1200x600};
static constexpr gfx::Size kDefaultDpi = kDpi600; static constexpr gfx::Size kDefaultDpi = kDpi600;
#if defined(OS_CHROMEOS) #if BUILDFLAG(IS_CHROMEOS_ASH)
static constexpr bool kPinSupported = true; static constexpr bool kPinSupported = true;
#endif #endif
...@@ -105,10 +106,10 @@ GenerateSamplePrinterSemanticCapsAndDefaults() { ...@@ -105,10 +106,10 @@ GenerateSamplePrinterSemanticCapsAndDefaults() {
caps.default_paper = kPaperLetter; caps.default_paper = kPaperLetter;
caps.dpis = kDpis; caps.dpis = kDpis;
caps.default_dpi = kDefaultDpi; caps.default_dpi = kDefaultDpi;
#if defined(OS_CHROMEOS) #if BUILDFLAG(IS_CHROMEOS_ASH)
caps.pin_supported = kPinSupported; caps.pin_supported = kPinSupported;
caps.advanced_capabilities = kAdvancedCapabilities; caps.advanced_capabilities = kAdvancedCapabilities;
#endif // defined(OS_CHROMEOS) #endif // BUILDFLAG(IS_CHROMEOS_ASH)
return caps; return caps;
} }
...@@ -189,7 +190,7 @@ TEST(PrintBackendMojomTraitsTest, TestSerializeAndDeserializePaper) { ...@@ -189,7 +190,7 @@ TEST(PrintBackendMojomTraitsTest, TestSerializeAndDeserializePaper) {
} }
} }
#if defined(OS_CHROMEOS) #if BUILDFLAG(IS_CHROMEOS_ASH)
TEST(PrintBackendMojomTraitsTest, TEST(PrintBackendMojomTraitsTest,
TestSerializeAndDeserializeAdvancedCapability) { TestSerializeAndDeserializeAdvancedCapability) {
for (const auto& advanced_capability : kAdvancedCapabilities) { for (const auto& advanced_capability : kAdvancedCapabilities) {
...@@ -200,7 +201,7 @@ TEST(PrintBackendMojomTraitsTest, ...@@ -200,7 +201,7 @@ TEST(PrintBackendMojomTraitsTest,
EXPECT_EQ(advanced_capability, output); EXPECT_EQ(advanced_capability, output);
} }
} }
#endif // defined(OS_CHROMEOS) #endif // BUILDFLAG(IS_CHROMEOS_ASH)
TEST(PrintBackendMojomTraitsTest, TEST(PrintBackendMojomTraitsTest,
TestSerializeAndDeserializePrinterSemanticCapsAndDefaults) { TestSerializeAndDeserializePrinterSemanticCapsAndDefaults) {
...@@ -225,10 +226,10 @@ TEST(PrintBackendMojomTraitsTest, ...@@ -225,10 +226,10 @@ TEST(PrintBackendMojomTraitsTest,
EXPECT_TRUE(kDefaultPaper == output.default_paper); EXPECT_TRUE(kDefaultPaper == output.default_paper);
EXPECT_EQ(kDpis, output.dpis); EXPECT_EQ(kDpis, output.dpis);
EXPECT_EQ(kDefaultDpi, output.default_dpi); EXPECT_EQ(kDefaultDpi, output.default_dpi);
#if defined(OS_CHROMEOS) #if BUILDFLAG(IS_CHROMEOS_ASH)
EXPECT_EQ(kPinSupported, output.pin_supported); EXPECT_EQ(kPinSupported, output.pin_supported);
EXPECT_EQ(kAdvancedCapabilities, output.advanced_capabilities); EXPECT_EQ(kAdvancedCapabilities, output.advanced_capabilities);
#endif // defined(OS_CHROMEOS) #endif // BUILDFLAG(IS_CHROMEOS_ASH)
} }
TEST(PrintBackendMojomTraitsTest, TEST(PrintBackendMojomTraitsTest,
...@@ -257,14 +258,14 @@ TEST( ...@@ -257,14 +258,14 @@ TEST(
const printing::PrinterSemanticCapsAndDefaults::Papers const printing::PrinterSemanticCapsAndDefaults::Papers
kEmptyUserDefinedPapers{}; kEmptyUserDefinedPapers{};
const std::vector<gfx::Size> kEmptyDpis{}; const std::vector<gfx::Size> kEmptyDpis{};
#if defined(OS_CHROMEOS) #if BUILDFLAG(IS_CHROMEOS_ASH)
const printing::AdvancedCapabilities kEmptyAdvancedCapabilities{}; const printing::AdvancedCapabilities kEmptyAdvancedCapabilities{};
#endif #endif
input.duplex_modes = kEmptyDuplexModes; input.duplex_modes = kEmptyDuplexModes;
input.user_defined_papers = kEmptyUserDefinedPapers; input.user_defined_papers = kEmptyUserDefinedPapers;
input.dpis = kEmptyDpis; input.dpis = kEmptyDpis;
#if defined(OS_CHROMEOS) #if BUILDFLAG(IS_CHROMEOS_ASH)
input.advanced_capabilities = kEmptyAdvancedCapabilities; input.advanced_capabilities = kEmptyAdvancedCapabilities;
#endif #endif
...@@ -274,7 +275,7 @@ TEST( ...@@ -274,7 +275,7 @@ TEST(
EXPECT_EQ(kEmptyDuplexModes, output.duplex_modes); EXPECT_EQ(kEmptyDuplexModes, output.duplex_modes);
EXPECT_EQ(kEmptyUserDefinedPapers, output.user_defined_papers); EXPECT_EQ(kEmptyUserDefinedPapers, output.user_defined_papers);
EXPECT_EQ(kEmptyDpis, output.dpis); EXPECT_EQ(kEmptyDpis, output.dpis);
#if defined(OS_CHROMEOS) #if BUILDFLAG(IS_CHROMEOS_ASH)
EXPECT_EQ(kEmptyAdvancedCapabilities, output.advanced_capabilities); EXPECT_EQ(kEmptyAdvancedCapabilities, output.advanced_capabilities);
#endif #endif
} }
...@@ -331,7 +332,7 @@ TEST( ...@@ -331,7 +332,7 @@ TEST(
EXPECT_FALSE(mojo::test::SerializeAndDeserialize< EXPECT_FALSE(mojo::test::SerializeAndDeserialize<
printing::mojom::PrinterSemanticCapsAndDefaults>(input, output)); printing::mojom::PrinterSemanticCapsAndDefaults>(input, output));
#if defined(OS_CHROMEOS) #if BUILDFLAG(IS_CHROMEOS_ASH)
// Use an advanced capability with same name but different other fields. // Use an advanced capability with same name but different other fields.
printing::AdvancedCapability advancedCapability1Prime = kAdvancedCapability1; printing::AdvancedCapability advancedCapability1Prime = kAdvancedCapability1;
advancedCapability1Prime.type = printing::AdvancedCapability::Type::kInteger; advancedCapability1Prime.type = printing::AdvancedCapability::Type::kInteger;
......
...@@ -45,7 +45,7 @@ bool PrinterBasicInfo::operator==(const PrinterBasicInfo& other) const { ...@@ -45,7 +45,7 @@ bool PrinterBasicInfo::operator==(const PrinterBasicInfo& other) const {
is_default == other.is_default && options == other.options; is_default == other.is_default && options == other.options;
} }
#if BUILDFLAG(IS_ASH) #if BUILDFLAG(IS_CHROMEOS_ASH)
AdvancedCapabilityValue::AdvancedCapabilityValue() = default; AdvancedCapabilityValue::AdvancedCapabilityValue() = default;
...@@ -89,7 +89,7 @@ bool AdvancedCapability::operator==(const AdvancedCapability& other) const { ...@@ -89,7 +89,7 @@ bool AdvancedCapability::operator==(const AdvancedCapability& other) const {
values == other.values; values == other.values;
} }
#endif // BUILDFLAG(IS_ASH) #endif // BUILDFLAG(IS_CHROMEOS_ASH)
bool PrinterSemanticCapsAndDefaults::Paper::operator==( bool PrinterSemanticCapsAndDefaults::Paper::operator==(
const PrinterSemanticCapsAndDefaults::Paper& other) const { const PrinterSemanticCapsAndDefaults::Paper& other) const {
......
...@@ -20,7 +20,7 @@ ...@@ -20,7 +20,7 @@
#include "printing/printing_export.h" #include "printing/printing_export.h"
#include "ui/gfx/geometry/size.h" #include "ui/gfx/geometry/size.h"
#if defined(OS_CHROMEOS) #if BUILDFLAG(IS_CHROMEOS_ASH)
#include <stdint.h> #include <stdint.h>
#endif #endif
...@@ -61,7 +61,7 @@ struct PRINTING_EXPORT PrinterBasicInfo { ...@@ -61,7 +61,7 @@ struct PRINTING_EXPORT PrinterBasicInfo {
using PrinterList = std::vector<PrinterBasicInfo>; using PrinterList = std::vector<PrinterBasicInfo>;
#if BUILDFLAG(IS_ASH) #if BUILDFLAG(IS_CHROMEOS_ASH)
struct PRINTING_EXPORT AdvancedCapabilityValue { struct PRINTING_EXPORT AdvancedCapabilityValue {
AdvancedCapabilityValue(); AdvancedCapabilityValue();
...@@ -111,7 +111,7 @@ struct PRINTING_EXPORT AdvancedCapability { ...@@ -111,7 +111,7 @@ struct PRINTING_EXPORT AdvancedCapability {
using AdvancedCapabilities = std::vector<AdvancedCapability>; using AdvancedCapabilities = std::vector<AdvancedCapability>;
#endif // BUILDFLAG(IS_ASH) #endif // BUILDFLAG(IS_CHROMEOS_ASH)
struct PRINTING_EXPORT PrinterSemanticCapsAndDefaults { struct PRINTING_EXPORT PrinterSemanticCapsAndDefaults {
PrinterSemanticCapsAndDefaults(); PrinterSemanticCapsAndDefaults();
...@@ -149,10 +149,10 @@ struct PRINTING_EXPORT PrinterSemanticCapsAndDefaults { ...@@ -149,10 +149,10 @@ struct PRINTING_EXPORT PrinterSemanticCapsAndDefaults {
std::vector<gfx::Size> dpis; std::vector<gfx::Size> dpis;
gfx::Size default_dpi; gfx::Size default_dpi;
#if BUILDFLAG(IS_ASH) #if BUILDFLAG(IS_CHROMEOS_ASH)
bool pin_supported = false; bool pin_supported = false;
AdvancedCapabilities advanced_capabilities; AdvancedCapabilities advanced_capabilities;
#endif // BUILDFLAG(IS_ASH) #endif // BUILDFLAG(IS_CHROMEOS_ASH)
}; };
struct PRINTING_EXPORT PrinterCapsAndDefaults { struct PRINTING_EXPORT PrinterCapsAndDefaults {
......
...@@ -8,14 +8,14 @@ ...@@ -8,14 +8,14 @@
namespace printing { namespace printing {
#if BUILDFLAG(IS_ASH) #if BUILDFLAG(IS_CHROMEOS_ASH)
const char kAllowedColorModes[] = "allowedColorModes"; const char kAllowedColorModes[] = "allowedColorModes";
const char kAllowedDuplexModes[] = "allowedDuplexModes"; const char kAllowedDuplexModes[] = "allowedDuplexModes";
const char kAllowedPinModes[] = "allowedPinModes"; const char kAllowedPinModes[] = "allowedPinModes";
const char kDefaultColorMode[] = "defaultColorMode"; const char kDefaultColorMode[] = "defaultColorMode";
const char kDefaultDuplexMode[] = "defaultDuplexMode"; const char kDefaultDuplexMode[] = "defaultDuplexMode";
const char kDefaultPinMode[] = "defaultPinMode"; const char kDefaultPinMode[] = "defaultPinMode";
#endif // BUILDFLAG(IS_ASH) #endif // BUILDFLAG(IS_CHROMEOS_ASH)
const char kPaperSizeName[] = "name"; const char kPaperSizeName[] = "name";
const char kPaperSizeNameCustomOption[] = "custom"; const char kPaperSizeNameCustomOption[] = "custom";
......
...@@ -10,7 +10,7 @@ ...@@ -10,7 +10,7 @@
namespace printing { namespace printing {
#if BUILDFLAG(IS_ASH) #if BUILDFLAG(IS_CHROMEOS_ASH)
// Allowed printing modes as a bitmask. // Allowed printing modes as a bitmask.
// This is used in pref file and should never change. // This is used in pref file and should never change.
enum class ColorModeRestriction { enum class ColorModeRestriction {
...@@ -46,7 +46,7 @@ PRINTING_EXPORT extern const char kAllowedPinModes[]; ...@@ -46,7 +46,7 @@ PRINTING_EXPORT extern const char kAllowedPinModes[];
PRINTING_EXPORT extern const char kDefaultColorMode[]; PRINTING_EXPORT extern const char kDefaultColorMode[];
PRINTING_EXPORT extern const char kDefaultDuplexMode[]; PRINTING_EXPORT extern const char kDefaultDuplexMode[];
PRINTING_EXPORT extern const char kDefaultPinMode[]; PRINTING_EXPORT extern const char kDefaultPinMode[];
#endif // BUILDFLAG(IS_ASH) #endif // BUILDFLAG(IS_CHROMEOS_ASH)
// Allowed background graphics modes. // Allowed background graphics modes.
// This is used in pref file and should never change. // This is used in pref file and should never change.
......
...@@ -4,6 +4,7 @@ ...@@ -4,6 +4,7 @@
import("//build/config/chromecast_build.gni") import("//build/config/chromecast_build.gni")
import("//build/config/chromeos/args.gni") import("//build/config/chromeos/args.gni")
import("//build/config/chromeos/ui_mode.gni")
import("//build/config/features.gni") import("//build/config/features.gni")
import("//build/config/sanitizers/sanitizers.gni") import("//build/config/sanitizers/sanitizers.gni")
...@@ -24,7 +25,7 @@ declare_args() { ...@@ -24,7 +25,7 @@ declare_args() {
# For fuzzing, just restrict to chromeos and linux. # For fuzzing, just restrict to chromeos and linux.
use_cups = true use_cups = true
} else { } else {
use_cups = (is_chromeos_device || is_linux || is_mac) && !is_chromecast && use_cups = (is_chromeos_device || (is_linux || is_chromeos_lacros) ||
!is_fuchsia is_mac) && !is_chromecast && !is_fuchsia
} }
} }
...@@ -10,7 +10,7 @@ ...@@ -10,7 +10,7 @@
#include "build/chromeos_buildflags.h" #include "build/chromeos_buildflags.h"
#include "printing/units.h" #include "printing/units.h"
#if defined(USE_CUPS) && (defined(OS_MAC) || BUILDFLAG(IS_ASH)) #if defined(USE_CUPS) && (defined(OS_MAC) || BUILDFLAG(IS_CHROMEOS_ASH))
#include <cups/cups.h> #include <cups/cups.h>
#endif #endif
...@@ -183,7 +183,7 @@ void GetColorModelForModel(mojom::ColorModel color_model, ...@@ -183,7 +183,7 @@ void GetColorModelForModel(mojom::ColorModel color_model,
// all ColorModel values are determinantly handled. // all ColorModel values are determinantly handled.
} }
#if defined(OS_MAC) || BUILDFLAG(IS_ASH) #if defined(OS_MAC) || BUILDFLAG(IS_CHROMEOS_ASH)
std::string GetIppColorModelForModel(mojom::ColorModel color_model) { std::string GetIppColorModelForModel(mojom::ColorModel color_model) {
// Accept |kUnknownColorModel| for consistency with GetColorModelForModel(). // Accept |kUnknownColorModel| for consistency with GetColorModelForModel().
if (color_model == mojom::ColorModel::kUnknownColorModel) if (color_model == mojom::ColorModel::kUnknownColorModel)
...@@ -198,7 +198,7 @@ std::string GetIppColorModelForModel(mojom::ColorModel color_model) { ...@@ -198,7 +198,7 @@ std::string GetIppColorModelForModel(mojom::ColorModel color_model) {
return is_color.value() ? CUPS_PRINT_COLOR_MODE_COLOR return is_color.value() ? CUPS_PRINT_COLOR_MODE_COLOR
: CUPS_PRINT_COLOR_MODE_MONOCHROME; : CUPS_PRINT_COLOR_MODE_MONOCHROME;
} }
#endif // defined(OS_MAC) || BUILDFLAG(IS_ASH) #endif // defined(OS_MAC) || BUILDFLAG(IS_CHROMEOS_ASH)
#endif // defined(USE_CUPS) #endif // defined(USE_CUPS)
base::Optional<bool> IsColorModelSelected(mojom::ColorModel color_model) { base::Optional<bool> IsColorModelSelected(mojom::ColorModel color_model) {
...@@ -281,11 +281,11 @@ void PrintSettings::Clear() { ...@@ -281,11 +281,11 @@ void PrintSettings::Clear() {
#if defined(OS_LINUX) || defined(OS_CHROMEOS) #if defined(OS_LINUX) || defined(OS_CHROMEOS)
advanced_settings_.clear(); advanced_settings_.clear();
#endif // defined(OS_LINUX) || defined(OS_CHROMEOS) #endif // defined(OS_LINUX) || defined(OS_CHROMEOS)
#if BUILDFLAG(IS_ASH) #if BUILDFLAG(IS_CHROMEOS_ASH)
send_user_info_ = false; send_user_info_ = false;
username_.clear(); username_.clear();
pin_value_.clear(); pin_value_.clear();
#endif // BUILDFLAG(IS_ASH) #endif // BUILDFLAG(IS_CHROMEOS_ASH)
} }
void PrintSettings::SetPrinterPrintableArea( void PrintSettings::SetPrinterPrintableArea(
......
...@@ -44,7 +44,7 @@ PRINTING_EXPORT void GetColorModelForModel(mojom::ColorModel color_model, ...@@ -44,7 +44,7 @@ PRINTING_EXPORT void GetColorModelForModel(mojom::ColorModel color_model,
std::string* color_setting_name, std::string* color_setting_name,
std::string* color_value); std::string* color_value);
#if defined(OS_MAC) || BUILDFLAG(IS_ASH) #if defined(OS_MAC) || BUILDFLAG(IS_CHROMEOS_ASH)
// Convert from |color_model| to a print-color-mode value from PWG 5100.13. // Convert from |color_model| to a print-color-mode value from PWG 5100.13.
PRINTING_EXPORT std::string GetIppColorModelForModel( PRINTING_EXPORT std::string GetIppColorModelForModel(
mojom::ColorModel color_model); mojom::ColorModel color_model);
...@@ -229,7 +229,7 @@ class PRINTING_EXPORT PrintSettings { ...@@ -229,7 +229,7 @@ class PRINTING_EXPORT PrintSettings {
} }
#endif // defined(OS_LINUX) || defined(OS_CHROMEOS) #endif // defined(OS_LINUX) || defined(OS_CHROMEOS)
#if BUILDFLAG(IS_ASH) #if BUILDFLAG(IS_CHROMEOS_ASH)
void set_send_user_info(bool send_user_info) { void set_send_user_info(bool send_user_info) {
send_user_info_ = send_user_info; send_user_info_ = send_user_info;
} }
...@@ -240,7 +240,7 @@ class PRINTING_EXPORT PrintSettings { ...@@ -240,7 +240,7 @@ class PRINTING_EXPORT PrintSettings {
void set_pin_value(const std::string& pin_value) { pin_value_ = pin_value; } void set_pin_value(const std::string& pin_value) { pin_value_ = pin_value; }
const std::string& pin_value() const { return pin_value_; } const std::string& pin_value() const { return pin_value_; }
#endif // BUILDFLAG(IS_ASH) #endif // BUILDFLAG(IS_CHROMEOS_ASH)
// Cookie generator. It is used to initialize PrintedDocument with its // Cookie generator. It is used to initialize PrintedDocument with its
// associated PrintSettings, to be sure that each generated PrintedPage is // associated PrintSettings, to be sure that each generated PrintedPage is
...@@ -326,7 +326,7 @@ class PRINTING_EXPORT PrintSettings { ...@@ -326,7 +326,7 @@ class PRINTING_EXPORT PrintSettings {
AdvancedSettings advanced_settings_; AdvancedSettings advanced_settings_;
#endif // defined(OS_LINUX) || defined(OS_CHROMEOS) #endif // defined(OS_LINUX) || defined(OS_CHROMEOS)
#if BUILDFLAG(IS_ASH) #if BUILDFLAG(IS_CHROMEOS_ASH)
// Whether to send user info. // Whether to send user info.
bool send_user_info_; bool send_user_info_;
......
...@@ -211,16 +211,21 @@ std::unique_ptr<PrintSettings> PrintSettingsFromJobSettings( ...@@ -211,16 +211,21 @@ std::unique_ptr<PrintSettings> PrintSettingsFromJobSettings(
#endif #endif
} }
#if defined(OS_CHROMEOS) || (defined(OS_LINUX) && defined(USE_CUPS)) // TODO(crbug.com/1052397): Revisit once build flag switch of lacros-chrome is
// complete.
#if defined(OS_CHROMEOS) || \
((defined(OS_LINUX) || BUILDFLAG(IS_CHROMEOS_LACROS)) && \
defined(USE_CUPS))
const base::Value* advanced_settings = const base::Value* advanced_settings =
job_settings.FindDictKey(kSettingAdvancedSettings); job_settings.FindDictKey(kSettingAdvancedSettings);
if (advanced_settings) { if (advanced_settings) {
for (const auto& item : advanced_settings->DictItems()) for (const auto& item : advanced_settings->DictItems())
settings->advanced_settings().emplace(item.first, item.second.Clone()); settings->advanced_settings().emplace(item.first, item.second.Clone());
} }
#endif // defined(OS_CHROMEOS) || (defined(OS_LINUX) && defined(USE_CUPS)) #endif // defined(OS_CHROMEOS) || ((defined(OS_LINUX) ||
// BUILDFLAG(IS_CHROMEOS_LACROS)) && defined(USE_CUPS))
#if BUILDFLAG(IS_ASH) #if BUILDFLAG(IS_CHROMEOS_ASH)
bool send_user_info = bool send_user_info =
job_settings.FindBoolKey(kSettingSendUserInfo).value_or(false); job_settings.FindBoolKey(kSettingSendUserInfo).value_or(false);
settings->set_send_user_info(send_user_info); settings->set_send_user_info(send_user_info);
...@@ -233,7 +238,7 @@ std::unique_ptr<PrintSettings> PrintSettingsFromJobSettings( ...@@ -233,7 +238,7 @@ std::unique_ptr<PrintSettings> PrintSettingsFromJobSettings(
const std::string* pin_value = job_settings.FindStringKey(kSettingPinValue); const std::string* pin_value = job_settings.FindStringKey(kSettingPinValue);
if (pin_value) if (pin_value)
settings->set_pin_value(*pin_value); settings->set_pin_value(*pin_value);
#endif // BUILDFLAG(IS_ASH) #endif // BUILDFLAG(IS_CHROMEOS_ASH)
return settings; return settings;
} }
......
...@@ -61,7 +61,7 @@ TEST(PrintSettingsConversionTest, ConversionTest) { ...@@ -61,7 +61,7 @@ TEST(PrintSettingsConversionTest, ConversionTest) {
std::unique_ptr<PrintSettings> settings = std::unique_ptr<PrintSettings> settings =
PrintSettingsFromJobSettings(value.value()); PrintSettingsFromJobSettings(value.value());
ASSERT_TRUE(settings); ASSERT_TRUE(settings);
#if BUILDFLAG(IS_ASH) #if BUILDFLAG(IS_CHROMEOS_ASH)
EXPECT_TRUE(settings->send_user_info()); EXPECT_TRUE(settings->send_user_info());
EXPECT_EQ("username@domain.net", settings->username()); EXPECT_EQ("username@domain.net", settings->username());
EXPECT_EQ("0000", settings->pin_value()); EXPECT_EQ("0000", settings->pin_value());
...@@ -78,7 +78,7 @@ TEST(PrintSettingsConversionTest, ConversionTest) { ...@@ -78,7 +78,7 @@ TEST(PrintSettingsConversionTest, ConversionTest) {
EXPECT_FALSE(settings); EXPECT_FALSE(settings);
} }
#if BUILDFLAG(IS_ASH) #if BUILDFLAG(IS_CHROMEOS_ASH)
TEST(PrintSettingsConversionTest, ConversionTest_DontSendUsername) { TEST(PrintSettingsConversionTest, ConversionTest_DontSendUsername) {
base::Optional<base::Value> value = base::JSONReader::Read(kPrinterSettings); base::Optional<base::Value> value = base::JSONReader::Read(kPrinterSettings);
ASSERT_TRUE(value.has_value()); ASSERT_TRUE(value.has_value());
......
...@@ -56,7 +56,7 @@ TEST(PrintSettingsTest, GetColorModelForModel) { ...@@ -56,7 +56,7 @@ TEST(PrintSettingsTest, GetColorModelForModel) {
} }
} }
#if defined(OS_MAC) || BUILDFLAG(IS_ASH) #if defined(OS_MAC) || BUILDFLAG(IS_CHROMEOS_ASH)
TEST(PrintSettingsTest, GetIppColorModelForModel) { TEST(PrintSettingsTest, GetIppColorModelForModel) {
for (int model = static_cast<int>(mojom::ColorModel::kUnknownColorModel); for (int model = static_cast<int>(mojom::ColorModel::kUnknownColorModel);
model <= static_cast<int>(mojom::ColorModel::kColorModelLast); ++model) { model <= static_cast<int>(mojom::ColorModel::kColorModelLast); ++model) {
...@@ -64,7 +64,7 @@ TEST(PrintSettingsTest, GetIppColorModelForModel) { ...@@ -64,7 +64,7 @@ TEST(PrintSettingsTest, GetIppColorModelForModel) {
.empty()); .empty());
} }
} }
#endif // defined(OS_MAC) || BUILDFLAG(IS_ASH) #endif // defined(OS_MAC) || BUILDFLAG(IS_CHROMEOS_ASH)
#endif // defined(USE_CUPS) #endif // defined(USE_CUPS)
} // namespace printing } // namespace printing
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
#include "build/chromeos_buildflags.h" #include "build/chromeos_buildflags.h"
#include "printing/printing_context_linux.h" #include "printing/printing_context_linux.h"
#if defined(OS_ANDROID) || BUILDFLAG(IS_ASH) #if defined(OS_ANDROID) || BUILDFLAG(IS_CHROMEOS_ASH)
#error "This file is not used on Android / ChromeOS ash-chrome" #error "This file is not used on Android / ChromeOS ash-chrome"
#endif #endif
......
...@@ -146,7 +146,7 @@ PrintingContext::Result PrintingContext::UpdatePrintSettings( ...@@ -146,7 +146,7 @@ PrintingContext::Result PrintingContext::UpdatePrintSettings(
job_settings.FindIntKey(kSettingPreviewPageCount).value_or(0)); job_settings.FindIntKey(kSettingPreviewPageCount).value_or(0));
} }
#if BUILDFLAG(IS_ASH) #if BUILDFLAG(IS_CHROMEOS_ASH)
PrintingContext::Result PrintingContext::UpdatePrintSettingsFromPOD( PrintingContext::Result PrintingContext::UpdatePrintSettingsFromPOD(
std::unique_ptr<PrintSettings> job_settings) { std::unique_ptr<PrintSettings> job_settings) {
ResetSettings(); ResetSettings();
......
...@@ -87,7 +87,7 @@ class PRINTING_EXPORT PrintingContext { ...@@ -87,7 +87,7 @@ class PRINTING_EXPORT PrintingContext {
// settings information. // settings information.
Result UpdatePrintSettings(base::Value job_settings); Result UpdatePrintSettings(base::Value job_settings);
#if BUILDFLAG(IS_ASH) #if BUILDFLAG(IS_CHROMEOS_ASH)
// Updates Print Settings. // Updates Print Settings.
Result UpdatePrintSettingsFromPOD( Result UpdatePrintSettingsFromPOD(
std::unique_ptr<PrintSettings> job_settings); std::unique_ptr<PrintSettings> job_settings);
......
...@@ -9,11 +9,11 @@ ...@@ -9,11 +9,11 @@
namespace printing { namespace printing {
namespace features { namespace features {
#if BUILDFLAG(IS_ASH) #if BUILDFLAG(IS_CHROMEOS_ASH)
// Enables Advanced PPD Attributes. // Enables Advanced PPD Attributes.
const base::Feature kAdvancedPpdAttributes{"AdvancedPpdAttributes", const base::Feature kAdvancedPpdAttributes{"AdvancedPpdAttributes",
base::FEATURE_ENABLED_BY_DEFAULT}; base::FEATURE_ENABLED_BY_DEFAULT};
#endif // BUILDFLAG(IS_ASH) #endif // BUILDFLAG(IS_CHROMEOS_ASH)
#if defined(OS_MAC) #if defined(OS_MAC)
// Use the CUPS IPP printing backend instead of the original CUPS backend that // Use the CUPS IPP printing backend instead of the original CUPS backend that
......
...@@ -16,9 +16,9 @@ namespace features { ...@@ -16,9 +16,9 @@ namespace features {
// The following features are declared alphabetically. The features should be // The following features are declared alphabetically. The features should be
// documented with descriptions of their behaviors in the .cc file. // documented with descriptions of their behaviors in the .cc file.
#if BUILDFLAG(IS_ASH) #if BUILDFLAG(IS_CHROMEOS_ASH)
PRINTING_EXPORT extern const base::Feature kAdvancedPpdAttributes; PRINTING_EXPORT extern const base::Feature kAdvancedPpdAttributes;
#endif // BUILDFLAG(IS_ASH) #endif // BUILDFLAG(IS_CHROMEOS_ASH)
#if defined(OS_MAC) #if defined(OS_MAC)
PRINTING_EXPORT extern const base::Feature kCupsIppPrintingBackend; PRINTING_EXPORT extern const base::Feature kCupsIppPrintingBackend;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment