Commit b46e7e96 authored by brettw@chromium.org's avatar brettw@chromium.org

GN chrome/common build, rename enable_printing.

This adds the missing conditions to the chrome/common GN build file (previously
only the basic files were there). Some refactoring of the GYP file to make this
possible.

Renames the enable_printing flag to printing_mode since this is an integer
tri-state.

Minor improvements to chrome/renderer

TBR=jamesr@chromium.org
Original review=https://codereview.chromium.org/400243003/

BUG=

Review URL: https://codereview.chromium.org/409683003

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@284783 0039d316-1c4b-4281-b951-d872f2087c98
parent ae15b406
......@@ -52,9 +52,9 @@ config("feature_flags") {
if (enable_plugins) {
defines += [ "ENABLE_PLUGINS=1" ]
}
if (enable_printing > 0) {
if (printing_mode > 0) {
defines += [ "ENABLE_PRINTING=1" ]
if (enable_printing < 2) {
if (printing_mode < 2) {
defines += [ "ENABLE_FULL_PRINTING=1" ]
}
}
......
......@@ -56,9 +56,9 @@ enable_pepper_cdms = enable_plugins && (is_linux || is_mac || is_win)
# fully, and 2 enables only the codepath to generate a Metafile (e.g. usually
# a PDF or EMF) and disables print preview, cloud print, UI, etc.
if (is_android) {
enable_printing = 2
printing_mode = 2
} else {
enable_printing = 1
printing_mode = 1
}
# The seccomp-bpf sandbox is only supported on three architectures
......
......@@ -138,9 +138,9 @@ if (enable_extensions) {
if (enable_plugins) {
grit_defines += [ "-D", "enable_plugins" ]
}
if (enable_printing != 0) {
if (printing_mode != 0) {
grit_defines += [ "-D", "enable_printing" ]
if (enable_printing == 1) {
if (printing_mode == 1) {
grit_defines += [ "-D", "enable_full_printing" ]
}
}
......
......@@ -404,7 +404,7 @@ static_library("browser") {
".", "//chrome")
}
if (enable_printing != 0) {
if (printing_mode != 0) {
# Some form of printing support.
sources += rebase_path(gypi_values.chrome_browser_basic_printing_sources,
".", "//chrome")
......@@ -415,11 +415,11 @@ static_library("browser") {
sources += rebase_path(gypi_values.chrome_browser_printing_emf_sources,
".", "//chrome")
}
if (enable_printing == 1) {
if (printing_mode == 1) {
# Full printing on top of the above.
sources += rebase_path(gypi_values.chrome_browser_full_printing_sources,
".", "//chrome")
} else if (enable_printing == 2) {
} else if (printing_mode == 2) {
# Partial-only printing support.
sources += rebase_path(
gypi_values.chrome_browser_basic_only_printing_sources,
......
......@@ -126,7 +126,7 @@ static_library("ui") {
deps += [ "//net" ]
}
if (enable_printing != 0) {
if (printing_mode != 0) {
deps += [ "//printing" ]
}
......@@ -258,7 +258,7 @@ static_library("ui") {
if (!enable_themes) {
sources -= [ "webui/theme_source.cc" ]
}
if (enable_printing == 1) {
if (printing_mode == 1) {
sources += rebase_path(gypi_values.chrome_browser_ui_print_preview_sources,
".", "//chrome")
}
......
......@@ -4,6 +4,7 @@
{
'variables': {
# File lists shared with GN build.
'chrome_common_sources': [
'../apps/app_shim/app_shim_launch.h',
'../apps/app_shim/app_shim_messages.h',
......@@ -125,30 +126,6 @@
'common/favicon/favicon_url_parser.h',
'common/icon_with_badge_image_source.cc',
'common/icon_with_badge_image_source.h',
'common/importer/firefox_importer_utils.cc',
'common/importer/firefox_importer_utils.h',
'common/importer/firefox_importer_utils_linux.cc',
'common/importer/firefox_importer_utils_mac.mm',
'common/importer/firefox_importer_utils_win.cc',
'common/importer/ie_importer_test_registry_overrider_win.cc',
'common/importer/ie_importer_test_registry_overrider_win.h',
'common/importer/ie_importer_utils_win.cc',
'common/importer/ie_importer_utils_win.h',
'common/importer/imported_bookmark_entry.cc',
'common/importer/imported_bookmark_entry.h',
'common/importer/imported_favicon_usage.cc',
'common/importer/imported_favicon_usage.h',
'common/importer/importer_bridge.cc',
'common/importer/importer_bridge.h',
'common/importer/importer_data_types.cc',
'common/importer/importer_data_types.h',
'common/importer/importer_type.h',
'common/importer/importer_url_row.cc',
'common/importer/importer_url_row.h',
'common/importer/profile_import_process_messages.cc',
'common/importer/profile_import_process_messages.h',
'common/importer/safari_importer_utils.h',
'common/importer/safari_importer_utils.mm',
'common/instant_restricted_id_cache.h',
'common/instant_types.cc',
'common/instant_types.h',
......@@ -196,14 +173,6 @@
'common/search_types.h',
'common/search_urls.cc',
'common/search_urls.h',
'common/service_messages.h',
'common/service_process_util.cc',
'common/service_process_util.h',
'common/service_process_util_linux.cc',
'common/service_process_util_mac.mm',
'common/service_process_util_posix.cc',
'common/service_process_util_posix.h',
'common/service_process_util_win.cc',
'common/spellcheck_common.cc',
'common/spellcheck_common.h',
'common/spellcheck_marker.h',
......@@ -265,6 +234,56 @@
'common/safe_browsing/zip_analyzer.cc',
'common/safe_browsing/zip_analyzer.h',
],
'chrome_common_importer_sources': [
'common/importer/firefox_importer_utils.cc',
'common/importer/firefox_importer_utils.h',
'common/importer/firefox_importer_utils_linux.cc',
'common/importer/firefox_importer_utils_mac.mm',
'common/importer/firefox_importer_utils_win.cc',
'common/importer/ie_importer_test_registry_overrider_win.cc',
'common/importer/ie_importer_test_registry_overrider_win.h',
'common/importer/ie_importer_utils_win.cc',
'common/importer/ie_importer_utils_win.h',
'common/importer/imported_bookmark_entry.cc',
'common/importer/imported_bookmark_entry.h',
'common/importer/imported_favicon_usage.cc',
'common/importer/imported_favicon_usage.h',
'common/importer/importer_bridge.cc',
'common/importer/importer_bridge.h',
'common/importer/importer_data_types.cc',
'common/importer/importer_data_types.h',
'common/importer/importer_type.h',
'common/importer/importer_url_row.cc',
'common/importer/importer_url_row.h',
'common/importer/profile_import_process_messages.cc',
'common/importer/profile_import_process_messages.h',
'common/importer/safari_importer_utils.h',
'common/importer/safari_importer_utils.mm',
],
'chrome_common_service_process_sources': [
'common/service_messages.h',
'common/service_process_util.cc',
'common/service_process_util.h',
'common/service_process_util_linux.cc',
'common/service_process_util_mac.mm',
'common/service_process_util_posix.cc',
'common/service_process_util_posix.h',
'common/service_process_util_win.cc',
],
'chrome_common_win_mac_sources': [
'common/extensions/api/networking_private/networking_private_crypto_nss.cc',
'common/extensions/api/networking_private/networking_private_crypto_openssl.cc',
'common/extensions/api/networking_private/networking_private_crypto.h',
'common/media_galleries/itunes_library.cc',
'common/media_galleries/itunes_library.h',
'common/media_galleries/picasa_types.cc',
'common/media_galleries/picasa_types.h',
'common/media_galleries/pmp_constants.h',
],
'chrome_common_mac_sources': [
'common/media_galleries/iphoto_library.cc',
'common/media_galleries/iphoto_library.h',
]
},
'targets': [
{
......@@ -327,31 +346,17 @@
],
'conditions': [
['enable_extensions==1', {
'sources': [
'<@(chrome_common_extensions_sources)',
],
'sources': [ '<@(chrome_common_extensions_sources)' ],
'dependencies': [
'../device/bluetooth/bluetooth.gyp:device_bluetooth',
'../device/usb/usb.gyp:device_usb',
],
}],
['OS=="win" or OS=="mac"', {
'sources': [
'common/extensions/api/networking_private/networking_private_crypto_nss.cc',
'common/extensions/api/networking_private/networking_private_crypto_openssl.cc',
'common/extensions/api/networking_private/networking_private_crypto.h',
'common/media_galleries/itunes_library.cc',
'common/media_galleries/itunes_library.h',
'common/media_galleries/picasa_types.cc',
'common/media_galleries/picasa_types.h',
'common/media_galleries/pmp_constants.h',
],
'sources': [ '<@(chrome_common_win_mac_sources)' ],
}],
['OS=="mac"', {
'sources': [
'common/media_galleries/iphoto_library.cc',
'common/media_galleries/iphoto_library.h',
],
'sources': [ '<@(chrome_common_mac_sources)' ],
}],
['OS != "ios"', {
'dependencies': [
......@@ -422,13 +427,8 @@
'<(DEPTH)/printing/printing.gyp:printing',
],
}],
['enable_printing!=1', {
'sources!' : [
'common/service_messages.h',
],
'sources/': [
['exclude', '^common/service_process_util_'],
],
['enable_printing==1', {
'sources': [ '<@(chrome_common_service_process_sources)' ],
}],
['enable_service_discovery==1', {
'sources' : [
......@@ -443,11 +443,6 @@
]
}],
['OS=="android"', {
'sources/': [
['exclude', '^common/importer/'],
['exclude', '^common/media_galleries/'],
['exclude', '^common/service_'],
],
'sources!': [
'common/badge_util.cc',
'common/chrome_version_info_posix.cc',
......@@ -456,9 +451,13 @@
'common/extensions/api/spellcheck/spellcheck_handler.cc',
'common/extensions/manifest_handlers/minimum_chrome_version_checker.cc',
'common/icon_with_badge_image_source.cc',
'common/media_galleries/metadata_types.h',
'common/net/url_util.cc',
'common/spellcheck_common.cc',
],
}, {
# Non-Android.
'sources': [ '<@(chrome_common_importer_sources)' ]
}],
['OS=="win"', {
'include_dirs': [
......@@ -494,11 +493,6 @@
'../remoting/remoting.gyp:remoting_client_plugin',
],
}],
['enable_plugins==0', {
'source!' : [
'common/pepper_permission_util.cc',
],
}],
['enable_webrtc==0', {
'sources!': [
'common/media/webrtc_logging_messages.h',
......@@ -542,6 +536,7 @@
],
},
{
# GN version: //chrome/common:version
'target_name': 'common_version',
'type': 'none',
'conditions': [
......@@ -601,7 +596,7 @@
],
},
{
# GN version: //chrome/common/net:net
# GN version: //chrome/common/net
'target_name': 'common_net',
'type': 'static_library',
'sources': [
......
......@@ -42,6 +42,7 @@ static_library("common") {
"//chrome/common/net",
"//chrome/common/safe_browsing:proto",
"//components/cloud_devices/common",
"//components/json_schema",
"//components/metrics",
"//components/policy:policy_component_common",
"//components/translate/core/common",
......@@ -59,30 +60,63 @@ static_library("common") {
"//ui/resources:resources",
"//url",
#":installer_util", TODO(GYP)
#"//components/json_schema", TODO(GYP)
#"//media/cast/cast.gyp:cast_transport", TODO(GYP)
]
if (!is_ios) {
if (is_ios) {
sources += [
# Use this Mac file that was filtered out.
"chrome_version_info_mac.mm",
]
} else {
# Non-iOS.
deps += [
"//chrome/common/extensions/api",
"//components/visitedlink/common",
"//components/autofill/content/common",
"//components/autofill/core/common",
"//components/password_manager/core/common",
"//components/signin/core/common",
"//components/translate/content/common",
"//extensions/common/api",
"//ipc",
"//third_party/adobe/flash:flapper_version_h",
"//third_party/re2",
"//third_party/widevine/cdm:version_h",
#'<(DEPTH)/components/components.gyp:password_manager_core_common', TODO(GYP)
#'<(DEPTH)/components/components.gyp:signin_core_common', TODO(GYP)
#'<(DEPTH)/components/nacl.gyp:nacl_common', TODO(GYP)
#'<(DEPTH)/extensions/common/api/api.gyp:extensions_api', TODO(GYP)
#'<(DEPTH)/extensions/extensions.gyp:extensions_common', TODO(GYP)
]
}
if (enable_extensions) {
sources += rebase_path(
gypi_values.chrome_common_extensions_sources,
".", "//chrome")
deps += [
"//device/bluetooth",
"//device/usb",
]
}
if (is_win || is_mac) {
sources += rebase_path(
gypi_values.chrome_common_win_mac_sources,
".", "//chrome")
if (use_openssl) {
sources -= [
"extensions/api/networking_private/networking_private_crypto_nss.cc",
]
} else {
sources -= [
"extensions/api/networking_private/networking_private_crypto_openssl.cc",
]
}
}
if (is_mac) {
sources += rebase_path(
gypi_values.chrome_common_mac_sources,
".", "//chrome")
}
if (enable_nacl) {
deps += [
#'<(DEPTH)/components/nacl.gyp:nacl_common', TODO(GYP)
......@@ -93,6 +127,91 @@ static_library("common") {
]
}
# Printing.
if (printing_mode == 0) {
sources -= [
"print_messages.cc",
"print_messages.h",
]
} else {
deps += [ "//printing" ]
if (printing_mode == 1) {
# Full printing support.
sources += rebase_path(
gypi_values.chrome_common_service_process_sources,
".", "//chrome")
}
}
if (enable_service_discovery) {
sources += [
"local_discovery/service_discovery_client.cc",
"local_discovery/service_discovery_client.h",
]
}
if (enable_mdns) {
sources += [
"local_discovery/service_discovery_client_impl.cc",
"local_discovery/service_discovery_client_impl.h",
]
}
if (is_android) {
sources -= [
"badge_util.cc",
"chrome_version_info_posix.cc",
"extensions/api/extension_action/browser_action_handler.cc",
"extensions/api/extension_action/page_action_handler.cc",
"extensions/api/spellcheck/spellcheck_handler.cc",
"extensions/manifest_handlers/minimum_chrome_version_checker.cc",
"icon_with_badge_image_source.cc",
"media_galleries/metadata_types.h",
"net/url_util.cc",
"spellcheck_common.cc",
]
} else {
# Non-Android.
sources += rebase_path(
gypi_values.chrome_common_importer_sources,
".", "//chrome")
}
if (is_win) {
deps += [ "//third_party/wtl" ]
}
if (enable_mdns) {
sources += [ "local_discovery/local_discovery_messages.h" ]
}
if (is_chromeos) {
sources -= [ "chrome_version_info_linux.cc" ]
}
if (is_mac) {
sources -= [
"child_process_logging_posix.cc",
"chrome_version_info_posix.cc",
]
deps += [
"//third_party/mach_override",
#'../third_party/google_toolbox_for_mac/google_toolbox_for_mac.gyp:google_toolbox_for_mac', TODO(GYP)
]
}
if (enable_remoting) {
#deps += [ '../remoting/remoting.gyp:remoting_client_plugin' ] TODO(GYP)
}
if (!enable_plugins) {
sources -= [ "pepper_permission_util.cc" ]
}
if (!enable_webrtc) {
sources -= [ "media/webrtc_logging_messages.h" ]
}
if (enable_configuration_policy) {
deps += [ "//components/policy" ]
}
if (safe_browsing_mode == 1) {
defines += [ "FULL_SAFE_BROWSING" ]
sources += rebase_path(
......@@ -173,8 +292,8 @@ static_library("constants") {
deps = [
"//base",
"//base/third_party/dynamic_annotations",
"//components/bookmarks/common",
"//third_party/widevine/cdm:version_h",
#'../components/components.gyp:bookmarks_common', TODO(GYP)
]
if (enable_nacl) {
......
......@@ -30,10 +30,13 @@ static_library("renderer") {
"//chrome:strings",
"//components/autofill/content/renderer",
"//components/data_reduction_proxy/common",
"//components/plugins/renderer",
"//components/startup_metric_utils",
"//components/translate/core/common",
"//components/translate/core/language_detection",
"//components/visitedlink/renderer",
"//content/public/renderer",
"//extensions:extensions_resources",
"//media/cast/logging/proto",
"//third_party/re2",
"//net",
......@@ -48,10 +51,7 @@ static_library("renderer") {
"//webkit/common",
"//webkit:resources",
#"../components/components.gyp:cdm_renderer", TODO(GYP)
#"../components/components.gyp:startup_metric_utils", TODO(GYP)
#"../components/components.gyp:plugins_renderer", TODO(GYP)
#"../extensions/extensions.gyp:extensions_renderer", TODO(GYP)
#"../extensions/extensions_resources.gyp:extensions_resources", TODO(GYP)
#"../media/cast/cast.gyp:cast_sender", TODO(GYP)
#"../media/cast/cast.gyp:cast_transport", TODO(GYP)
]
......@@ -108,17 +108,12 @@ static_library("renderer") {
if (enable_spellcheck) {
sources += rebase_path(gypi_values.chrome_renderer_spellchecker_sources,
".", "..")
# TODO(GYP) When hunspell is done, the extra defines can be removed.
#deps += [ "//third_party/hunspell" ]
defines += [ "HUNSPELL_STATIC", "HUNSPELL_CHROME_CLIENT", "OPENOFFICEORG" ]
deps += [ "//third_party/hunspell" ]
}
if (enable_printing > 0) {
deps += [
#"//printing", TODO(GYP)
]
if (enable_printing == 1) {
if (printing_mode > 0) {
deps += [ "//printing" ]
if (printing_mode == 1) {
sources += rebase_path(gypi_values.chrome_renderer_printing_sources,
".", "..")
}
......
......@@ -77,7 +77,7 @@ static_library("utility") {
}
}
if (enable_printing != 1) {
if (printing_mode != 1) {
sources -= [
"printing_handler.cc",
"printing_handler.h",
......
......@@ -134,7 +134,7 @@ source_set("browser") {
sources += [ "gamepad/gamepad_platform_data_fetcher.cc" ]
}
if (enable_printing != 0) {
if (printing_mode != 0) {
deps += [ "//printing" ]
}
......
......@@ -9,7 +9,7 @@ if (cpu_arch == "arm") {
}
skia_support_gpu = !is_ios
skia_support_pdf = !is_ios && enable_printing != 0
skia_support_pdf = !is_ios && printing_mode != 0
# The list of Skia defines that are to be set for chromium.
gypi_skia_defines = exec_script(
......@@ -248,14 +248,6 @@ component("skia") {
"ext/benchmarking_canvas.cc",
"ext/benchmarking_canvas.h",
"ext/bitmap_platform_device.h",
"ext/bitmap_platform_device_cairo.cc",
"ext/bitmap_platform_device_cairo.h",
"ext/bitmap_platform_device_mac.cc",
"ext/bitmap_platform_device_mac.h",
#"ext/bitmap_platform_device_skia.cc",
#"ext/bitmap_platform_device_skia.h",
"ext/bitmap_platform_device_win.cc",
"ext/bitmap_platform_device_win.h",
"ext/convolver.cc",
"ext/convolver.h",
"ext/event_tracer_impl.cc",
......@@ -415,7 +407,7 @@ component("skia") {
if (is_win) {
sources -= [ "ext/SkThread_chrome.cc" ]
}
if (is_android && enable_printing == 0) {
if (is_android && printing_mode == 0) {
sources -= [
"ext/skia_utils_base.cc",
"ext/vector_platform_device_skia.cc"
......@@ -469,11 +461,27 @@ component("skia") {
]
}
if (!use_cairo) {
sources -= [
# Select the right BitmapPlatformDevice.
if (is_win) {
sources += [
"ext/bitmap_platform_device_win.cc",
"ext/bitmap_platform_device_win.h",
]
} else if (is_mac) {
sources += [
"ext/bitmap_platform_device_mac.cc",
"ext/bitmap_platform_device_mac.h",
]
} else if (use_cairo) {
sources += [
"ext/bitmap_platform_device_cairo.cc",
"ext/bitmap_platform_device_cairo.h",
]
} else {
sources += [
"ext/bitmap_platform_device_skia.cc",
"ext/bitmap_platform_device_skia.h",
]
}
if (is_clang) {
......
......@@ -21,6 +21,7 @@
},
'sources': [
# Note: file list duplicated in GN build.
'ext/analysis_canvas.cc',
'ext/analysis_canvas.h',
'ext/benchmarking_canvas.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