Skip to content

Commit

Permalink
Renamed enable_printing and printing_mode in *.gyp* and .*gn* files.
Browse files Browse the repository at this point in the history
enable_printing and printing_mode replaced with
enable_basic_printing and enable_print_preview.

BUG=430281

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

Cr-Commit-Position: refs/heads/master@{#302905}
  • Loading branch information
vitalybuka authored and Commit bot committed Nov 5, 2014
1 parent 571a81f commit 93eea40
Show file tree
Hide file tree
Showing 29 changed files with 101 additions and 84 deletions.
2 changes: 1 addition & 1 deletion build/all.gyp
Original file line number Diff line number Diff line change
Expand Up @@ -423,7 +423,7 @@
'../google_apis/gcm/gcm.gyp:gcm_unit_tests',
],
}],
['enable_printing!=0', {
['enable_basic_printing==1 or enable_print_preview==1', {
'dependencies': [
'../printing/printing.gyp:printing_unittests',
],
Expand Down
41 changes: 26 additions & 15 deletions build/common.gypi
Original file line number Diff line number Diff line change
Expand Up @@ -487,12 +487,12 @@
# Enable Google Now.
'enable_google_now%': 1,

# Enable printing support and UI. This variable is used to configure
# which parts of printing will be built. 0 disables printing completely,
# 1 enables it 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.
'enable_printing%': 1,
# Enable basic printing support and UI.
'enable_basic_printing%': 1,

# Enable printing with print preview. It does not imply
# enable_basic_printing. It's possible to build Chrome with preview only.
'enable_print_preview%': 1,

# Set the version of CLD.
# 0: Don't specify the version. This option is for the Finch testing.
Expand Down Expand Up @@ -770,7 +770,8 @@
'arm_neon_optional%': 1,
'native_discardable_memory%': 1,
'native_memory_pressure_signals%': 1,
'enable_printing%': 2,
'enable_basic_printing%': 1,
'enable_print_preview%': 0,
'enable_task_manager%':0,
'video_hole%': 1,
}],
Expand Down Expand Up @@ -809,7 +810,8 @@
'enable_extensions%': 0,
'enable_google_now%': 0,
'cld_version%': 1,
'enable_printing%': 0,
'enable_basic_printing%': 0,
'enable_print_preview%': 0,
'enable_session_service%': 0,
'enable_themes%': 0,
'enable_webrtc%': 0,
Expand Down Expand Up @@ -979,7 +981,8 @@
# Disable various features by default on embedded.
['embedded==1', {
'remoting%': 0,
'enable_printing%': 0,
'enable_basic_printing%': 0,
'enable_print_preview%': 0,
}],

# By default, use ICU data file (icudtl.dat) on all platforms
Expand Down Expand Up @@ -1175,7 +1178,8 @@
'test_isolation_mode%': '<(test_isolation_mode)',
'test_isolation_outdir%': '<(test_isolation_outdir)',
'test_isolation_fail_on_missing': '<(test_isolation_fail_on_missing)',
'enable_printing%': '<(enable_printing)',
'enable_basic_printing%': '<(enable_basic_printing)',
'enable_print_preview%': '<(enable_print_preview)',
'enable_spellcheck%': '<(enable_spellcheck)',
'enable_google_now%': '<(enable_google_now)',
'cld_version%': '<(cld_version)',
Expand Down Expand Up @@ -2096,10 +2100,10 @@
['enable_plugins!=0', {
'grit_defines': ['-D', 'enable_plugins'],
}],
['enable_printing!=0', {
['enable_basic_printing==1 or enable_print_preview==1', {
'grit_defines': ['-D', 'enable_printing'],
}],
['enable_printing==1', {
['enable_print_preview==1', {
'grit_defines': ['-D', 'enable_print_preview'],
}],
['enable_themes==1', {
Expand Down Expand Up @@ -2923,10 +2927,17 @@
# chrome://translate-internals
'defines': ['CLD2_DATA_SOURCE=<(cld2_data_source)'],
}],
['enable_printing!=0', {
'defines': ['ENABLE_PRINTING=1', 'ENABLE_BASIC_PRINTING=1'],
['enable_basic_printing==1 or enable_print_preview==1', {
# Convenience define for ENABLE_BASIC_PRINTING || ENABLE_PRINT_PREVIEW.
'defines': ['ENABLE_PRINTING=1'],
}],
['enable_basic_printing==1', {
# Enable basic printing support and UI.
'defines': ['ENABLE_BASIC_PRINTING=1'],
}],
['enable_printing==1', {
['enable_print_preview==1', {
# Enable printing with print preview.
# Can be defined without ENABLE_BASIC_PRINTING.
'defines': ['ENABLE_PRINT_PREVIEW=1'],
}],
['enable_spellcheck==1', {
Expand Down
13 changes: 10 additions & 3 deletions build/config/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -54,9 +54,16 @@ config("feature_flags") {
if (enable_plugins) {
defines += [ "ENABLE_PLUGINS=1" ]
}
if (printing_mode > 0) {
defines += [ "ENABLE_PRINTING=1", "ENABLE_BASIC_PRINTING=1" ]
if (printing_mode < 2) {
if (enable_basic_printing || enable_print_preview) {
# Convenience define for ENABLE_BASIC_PRINTING || ENABLE_PRINT_PREVIEW.
defines += [ "ENABLE_PRINTING=1" ]
if (enable_basic_printing) {
# Enable basic printing support and UI.
defines += [ "ENABLE_BASIC_PRINTING=1" ]
}
if (enable_print_preview) {
# Enable printing with print preview.
# Can be defined without ENABLE_BASIC_PRINTING.
defines += [ "ENABLE_PRINT_PREVIEW=1" ]
}
}
Expand Down
15 changes: 6 additions & 9 deletions build/config/features.gni
Original file line number Diff line number Diff line change
Expand Up @@ -63,15 +63,12 @@ enable_pepper_cdms = enable_plugins && (is_linux || is_mac || is_win)

enable_browser_cdms = is_android

# Enable printing support and UI. This variable is used to configure which
# parts of printing will be built. 0 disables printing completely, 1 enables it
# 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) {
printing_mode = 2
} else {
printing_mode = 1
}
# Enable basic printing support and UI.
enable_basic_printing = true

# Enable printing with print preview. It does not imply
# enable_basic_printing. It's possible to build Chrome with preview only.
enable_print_preview = !is_android

# The seccomp-bpf sandbox is only supported on three architectures
# currently.
Expand Down
4 changes: 2 additions & 2 deletions build/secondary/tools/grit/grit_rule.gni
Original file line number Diff line number Diff line change
Expand Up @@ -159,9 +159,9 @@ if (enable_extensions) {
if (enable_plugins) {
grit_defines += [ "-D", "enable_plugins" ]
}
if (printing_mode != 0) {
if (enable_basic_printing || enable_print_preview) {
grit_defines += [ "-D", "enable_printing" ]
if (printing_mode == 1) {
if (enable_print_preview) {
grit_defines += [ "-D", "enable_print_preview" ]
}
}
Expand Down
4 changes: 2 additions & 2 deletions chrome/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -218,9 +218,9 @@ group("browser_dependencies") {
]
}

if (printing_mode != 0) {
if (enable_basic_printing || enable_print_preview) {
deps += [ "//printing" ]
if (printing_mode == 1) {
if (enable_print_preview) {
deps += [ "//chrome/service" ]
}
}
Expand Down
6 changes: 3 additions & 3 deletions chrome/browser/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -449,7 +449,7 @@ static_library("browser") {
".", "//chrome")
}

if (printing_mode != 0) {
if (enable_basic_printing || enable_print_preview) {
# Some form of printing support.
sources += rebase_path(gypi_values.chrome_browser_basic_printing_sources,
".", "//chrome")
Expand All @@ -460,11 +460,11 @@ static_library("browser") {
sources += rebase_path(gypi_values.chrome_browser_printing_emf_sources,
".", "//chrome")
}
if (printing_mode == 1) {
if (enable_print_preview) {
# Full printing on top of the above.
sources += rebase_path(gypi_values.chrome_browser_full_printing_sources,
".", "//chrome")
} else if (printing_mode == 2) {
} else {
# Partial-only printing support.
sources += rebase_path(
gypi_values.chrome_browser_basic_only_printing_sources,
Expand Down
3 changes: 2 additions & 1 deletion chrome/browser/chromeos/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,8 @@ source_set("chromeos") {
"//media",
"//net",
"//ppapi:ppapi_ipc", # For PpapiMsg_LoadPlugin
"//printing", # TODO: care about enable_printing
# TODO: care about enable_basic_printing and enable_print_preview.
"//printing",
"//skia",
"//storage/browser",
"//storage/common",
Expand Down
4 changes: 2 additions & 2 deletions chrome/browser/ui/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ static_library("ui") {
deps += [ "//device/bluetooth" ]
}

if (printing_mode != 0) {
if (enable_basic_printing || enable_print_preview) {
deps += [ "//printing" ]
}

Expand Down Expand Up @@ -275,7 +275,7 @@ static_library("ui") {
if (!enable_themes) {
sources -= [ "webui/theme_source.cc" ]
}
if (printing_mode == 1) {
if (enable_print_preview) {
sources += rebase_path(gypi_values.chrome_browser_ui_print_preview_sources,
".", "//chrome")
}
Expand Down
6 changes: 3 additions & 3 deletions chrome/chrome.gyp
Original file line number Diff line number Diff line change
Expand Up @@ -40,12 +40,12 @@
'../third_party/WebKit/public/blink_devtools.gyp:blink_devtools_frontend_resources',
],
}],
['enable_printing!=0', {
['enable_basic_printing==1 or enable_print_preview==1', {
'chromium_browser_dependencies': [
'../printing/printing.gyp:printing',
],
}],
['enable_printing==1', {
['enable_print_preview==1', {
'chromium_browser_dependencies': [
'service',
],
Expand Down Expand Up @@ -675,7 +675,7 @@
'chrome_browser_extensions.gypi',
],
}],
['enable_printing==1', {
['enable_print_preview==1', {
'targets': [
{
# GN version: //chrome/service
Expand Down
24 changes: 12 additions & 12 deletions chrome/chrome_browser.gypi
Original file line number Diff line number Diff line change
Expand Up @@ -1826,7 +1826,7 @@
'browser/themes/theme_syncable_service.cc',
'browser/themes/theme_syncable_service.h',
],
# Used both when enable_printing == 1 (full) and == 2 (basic)
# Used both when (enable_basic_printing==1 or enable_print_preview==1).
'chrome_browser_basic_printing_sources': [
'browser/printing/print_job.cc',
'browser/printing/print_job.h',
Expand All @@ -1843,7 +1843,7 @@
'browser/printing/printing_message_filter.cc',
'browser/printing/printing_message_filter.h',
],
# Used on top of the "basic" sources when enable_printing == 1 (full).
# Used on top of the "basic" sources when enable_print_preview==1.
'chrome_browser_full_printing_sources': [
'browser/local_discovery/pwg_raster_converter.cc',
'browser/local_discovery/pwg_raster_converter.h',
Expand Down Expand Up @@ -1878,7 +1878,7 @@
'browser/task_manager/printing_information.cc',
'browser/task_manager/printing_information.h',
],
# Used only in basic printing (enable_printing == 2) mode.
# Used only in (enable_basic_printing==1 and enable_print_preview==0) mode.
'chrome_browser_basic_only_printing_sources': [
'browser/printing/print_view_manager_basic.cc',
'browser/printing/print_view_manager_basic.h',
Expand Down Expand Up @@ -3256,7 +3256,7 @@
'sources': [ '<@(chrome_browser_themes_sources)' ],
}],
# Some form of printing support.
['enable_printing!=0', {
['enable_basic_printing==1 or enable_print_preview==1', {
'dependencies': [
'../printing/printing.gyp:printing',
],
Expand All @@ -3265,16 +3265,16 @@
['OS=="win"', {
'sources': [ '<@(chrome_browser_printing_emf_sources)' ],
}],
# Full printing on top of the above.
['enable_printing==1', {
'sources': [ '<@(chrome_browser_full_printing_sources)' ],
}],
# Partial-only printing support.
['enable_printing==2', {
'sources': [ '<@(chrome_browser_basic_only_printing_sources)' ],
}],
],
}],
# Full printing on top of the above.
['enable_print_preview==1', {
'sources': [ '<@(chrome_browser_full_printing_sources)' ],
}],
# Partial-only printing support.
['enable_basic_printing==1 and enable_print_preview==0', {
'sources': [ '<@(chrome_browser_basic_only_printing_sources)' ],
}],
['enable_captive_portal_detection==1', {
'sources': [ '<@(chrome_browser_captive_portal_sources)' ]
}],
Expand Down
2 changes: 1 addition & 1 deletion chrome/chrome_browser_chromeos.gypi
Original file line number Diff line number Diff line change
Expand Up @@ -1214,7 +1214,7 @@
'../ui/gfx/x/gfx_x11.gyp:gfx_x11',
],
}],
['enable_printing != 0', {
['enable_basic_printing==1 or enable_print_preview==1', {
'dependencies': [
'../printing/printing.gyp:printing',
],
Expand Down
4 changes: 2 additions & 2 deletions chrome/chrome_browser_ui.gypi
Original file line number Diff line number Diff line change
Expand Up @@ -2690,7 +2690,7 @@
'../net/net.gyp:net',
],
}],
['enable_printing!=0', {
['enable_basic_printing==1 or enable_print_preview==1', {
'dependencies': [
'../printing/printing.gyp:printing',
],
Expand Down Expand Up @@ -2848,7 +2848,7 @@
'browser/ui/webui/theme_source.cc',
],
}],
['enable_printing==1', {
['enable_print_preview==1', {
'sources': [ '<@(chrome_browser_ui_print_preview_sources)' ],
}],
['OS=="linux" or OS=="android"', {
Expand Down
4 changes: 2 additions & 2 deletions chrome/chrome_common.gypi
Original file line number Diff line number Diff line change
Expand Up @@ -414,7 +414,7 @@
'common/pepper_permission_util.h',
],
}],
['enable_printing==0', {
['enable_basic_printing==0 and enable_print_preview==0', {
'sources!': [
'common/print_messages.cc',
'common/print_messages.h',
Expand All @@ -424,7 +424,7 @@
'<(DEPTH)/printing/printing.gyp:printing',
],
}],
['enable_printing==1', {
['enable_print_preview==1', {
'sources': [ '<@(chrome_common_service_process_sources)' ],
}],
['enable_service_discovery==1', {
Expand Down
2 changes: 1 addition & 1 deletion chrome/chrome_dll.gypi
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,7 @@
'<(allocator_target)',
],
}],
['enable_printing!=0', {
['enable_basic_printing==1 or enable_print_preview==1', {
'dependencies': [
'../printing/printing.gyp:printing',
],
Expand Down
4 changes: 2 additions & 2 deletions chrome/chrome_renderer.gypi
Original file line number Diff line number Diff line change
Expand Up @@ -371,15 +371,15 @@
'../third_party/mach_override/mach_override.gyp:mach_override',
],
}],
['enable_printing!=0', {
['enable_basic_printing==1 or enable_print_preview==1', {
'dependencies': [
'../printing/printing.gyp:printing',
],
'sources': [
'<@(chrome_renderer_printing_sources)',
],
}],
['enable_printing==1', {
['enable_print_preview==1', {
'sources': [
'<@(chrome_renderer_full_printing_sources)',
],
Expand Down
Loading

0 comments on commit 93eea40

Please sign in to comment.