Commit af6a5927 authored by Lei Zhang's avatar Lei Zhang Committed by Commit Bot

Do not build chrome/service on POSIX if CUPS is disabled.

The code, used for the Cloud Print Proxy, is useless without CUPS.

BUG=793801

Change-Id: Icb4605ae15d758366c5c0b1e52a56afcfe5334a1
Reviewed-on: https://chromium-review.googlesource.com/961862
Commit-Queue: Lei Zhang <thestig@chromium.org>
Reviewed-by: default avatarSean Kau <skau@chromium.org>
Cr-Commit-Position: refs/heads/master@{#587921}
parent 72ecaf0c
......@@ -1437,9 +1437,9 @@ group("browser_dependencies") {
if (enable_basic_printing) {
public_deps += [ "//printing" ]
if (enable_print_preview && !is_chromeos) {
public_deps += [ "//chrome/service" ]
}
if (enable_print_preview && (is_win || (use_cups && !is_chromeos))) {
public_deps += [ "//chrome/service" ]
}
if (!is_component_build) {
......
......@@ -386,6 +386,10 @@ static_library("test_support") {
"//services/ws/public/mojom:constants",
]
}
if (use_cups) {
configs += [ "//printing:cups" ]
}
}
service_manifest("chrome_manifest") {
......
......@@ -174,7 +174,7 @@ base::LazyInstance<ChromeCrashReporterClient>::Leaky g_chrome_crash_client =
extern int NaClMain(const content::MainFunctionParams&);
#if !defined(OS_CHROMEOS)
#if defined(OS_WIN) || (defined(USE_CUPS) && !defined(OS_CHROMEOS))
extern int CloudPrintServiceProcessMain(const content::MainFunctionParams&);
#endif
......@@ -950,13 +950,9 @@ void ChromeMainDelegate::SandboxInitialized(const std::string& process_type) {
int ChromeMainDelegate::RunProcess(
const std::string& process_type,
const content::MainFunctionParams& main_function_params) {
// ANDROID doesn't support "service", so no CloudPrintServiceProcessMain, and
// arraysize doesn't support empty array. So we comment out the block for
// Android.
#if !defined(OS_ANDROID)
static const MainFunction kMainFunctions[] = {
#if BUILDFLAG(ENABLE_PRINT_PREVIEW) && !defined(CHROME_MULTIPLE_DLL_CHILD) && \
!defined(OS_CHROMEOS)
(defined(OS_WIN) || (defined(USE_CUPS) && !defined(OS_CHROMEOS)))
{switches::kCloudPrintServiceProcess, CloudPrintServiceProcessMain},
#endif
......@@ -970,7 +966,7 @@ int ChromeMainDelegate::RunProcess(
!defined(OS_LINUX)
{switches::kNaClLoaderProcess, NaClMain},
#else
{"<invalid>", NULL}, // To avoid constant array of size 0
{"<invalid>", nullptr}, // To avoid constant array of size 0
// when NaCl disabled and CHROME_MULTIPLE_DLL_CHILD
#endif
};
......@@ -979,8 +975,6 @@ int ChromeMainDelegate::RunProcess(
if (process_type == kMainFunctions[i].name)
return kMainFunctions[i].function(main_function_params);
}
#endif
return -1;
}
......
......@@ -78,14 +78,15 @@ static_library("service") {
"//chrome/common:service_process_mojom",
]
if (use_cups) {
sources += [ "cloud_print/print_system_cups.cc" ]
configs += [ "//printing:cups" ]
} else if (is_win) {
if (is_win) {
sources += [
"service_utility_process_host.cc",
"service_utility_process_host.h",
]
} else {
assert(use_cups)
sources += [ "cloud_print/print_system_cups.cc" ]
configs += [ "//printing:cups" ]
}
}
......
......@@ -36,11 +36,4 @@ std::string PrintSystem::GenerateProxyId() {
return base::GenerateGUID();
}
#if defined(OS_LINUX) && !defined(USE_CUPS)
scoped_refptr<PrintSystem> PrintSystem::CreateInstance(
const base::DictionaryValue*) {
return nullptr;
}
#endif
} // namespace cloud_print
......@@ -316,7 +316,7 @@ static_library("test_support") {
public_deps += [ "//ppapi/shared_impl" ]
}
if (enable_print_preview && !is_chromeos) {
if (enable_print_preview && (is_win || (use_cups && !is_chromeos))) {
public_deps += [ "//chrome/service" ]
}
}
......@@ -2106,7 +2106,7 @@ test("browser_tests") {
"../browser/printing/cloud_print/test/cloud_print_policy_browsertest.cc",
]
}
if (!is_chromeos) {
if (is_win || (use_cups && !is_chromeos)) {
sources += [
# Not intended to run on ChromeOS.
"../browser/printing/cloud_print/test/cloud_print_proxy_process_browsertest.cc",
......@@ -4000,7 +4000,7 @@ test("unit_tests") {
"//printing:test_support",
]
if (!is_chromeos) {
if (is_win || (use_cups && !is_chromeos)) {
sources += [
"../browser/printing/cloud_print/cloud_print_proxy_service_unittest.cc",
"../common/cloud_print/cloud_print_helpers_unittest.cc",
......
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