Commit 3865a71a authored by brettw's avatar brettw Committed by Commit bot

Remove enable_configuration_policy build define.

This build flag is always set for non-iOS platforms. The flag is not
overridable in the build and we never test other settings of it. The policy
code is stable and doesn't change.

This patch removes the flag and replaces it with !ios conditionals.

BUG=671706

Review-Url: https://codereview.chromium.org/2558043004
Cr-Commit-Position: refs/heads/master@{#437759}
parent bf4f82b8
...@@ -287,6 +287,7 @@ group("both_gn_and_gyp") { ...@@ -287,6 +287,7 @@ group("both_gn_and_gyp") {
"//chrome/test:telemetry_perf_unittests", "//chrome/test:telemetry_perf_unittests",
"//chrome/test:unit_tests", "//chrome/test:unit_tests",
"//components:components_browsertests", "//components:components_browsertests",
"//components/policy:policy_templates",
"//content/shell:content_shell", "//content/shell:content_shell",
"//content/test:content_browsertests", "//content/test:content_browsertests",
"//content/test:content_perftests", "//content/test:content_perftests",
...@@ -384,10 +385,6 @@ group("both_gn_and_gyp") { ...@@ -384,10 +385,6 @@ group("both_gn_and_gyp") {
deps += [ "//tools/xdisplaycheck" ] deps += [ "//tools/xdisplaycheck" ]
} }
if (enable_configuration_policy) {
deps += [ "//components/policy:policy_templates" ]
}
if (v8_use_external_startup_data) { if (v8_use_external_startup_data) {
deps += [ "//gin:gin_v8_snapshot_fingerprint" ] deps += [ "//gin:gin_v8_snapshot_fingerprint" ]
} }
......
...@@ -488,6 +488,8 @@ source_set("common") { ...@@ -488,6 +488,8 @@ source_set("common") {
"//components/metrics:profiler", "//components/metrics:profiler",
"//components/metrics:ui", "//components/metrics:ui",
"//components/navigation_interception", "//components/navigation_interception",
"//components/policy:generated",
"//components/policy/core/browser",
"//components/prefs", "//components/prefs",
"//components/printing/browser", "//components/printing/browser",
"//components/printing/common", "//components/printing/common",
...@@ -526,13 +528,6 @@ source_set("common") { ...@@ -526,13 +528,6 @@ source_set("common") {
"//v8", "//v8",
] ]
if (enable_configuration_policy) {
deps += [
"//components/policy:generated",
"//components/policy/core/browser",
]
}
if (enable_spellcheck) { if (enable_spellcheck) {
deps += [ deps += [
"//components/spellcheck/browser", "//components/spellcheck/browser",
...@@ -617,6 +612,7 @@ android_library("android_webview_java") { ...@@ -617,6 +612,7 @@ android_library("android_webview_java") {
"//base:base_java", "//base:base_java",
"//components/autofill/android:autofill_java", "//components/autofill/android:autofill_java",
"//components/navigation_interception/android:navigation_interception_java", "//components/navigation_interception/android:navigation_interception_java",
"//components/policy/android:policy_java",
"//components/web_contents_delegate_android:web_contents_delegate_android_java", "//components/web_contents_delegate_android:web_contents_delegate_android_java",
"//components/web_restrictions:web_restrictions_java", "//components/web_restrictions:web_restrictions_java",
"//content/public/android:content_java", "//content/public/android:content_java",
...@@ -628,10 +624,6 @@ android_library("android_webview_java") { ...@@ -628,10 +624,6 @@ android_library("android_webview_java") {
google_play_services_resources, google_play_services_resources,
] ]
if (enable_configuration_policy) {
deps += [ "//components/policy/android:policy_java" ]
}
if (enable_spellcheck) { if (enable_spellcheck) {
deps += [ "//components/spellcheck/browser/android:java" ] deps += [ "//components/spellcheck/browser/android:java" ]
} }
......
...@@ -89,8 +89,6 @@ enable_rlz = is_chrome_branded && enable_rlz_support ...@@ -89,8 +89,6 @@ enable_rlz = is_chrome_branded && enable_rlz_support
# Chrome OS: whether to also build the upcoming version of # Chrome OS: whether to also build the upcoming version of
# ChromeVox, which can then be enabled via a command-line switch. # ChromeVox, which can then be enabled via a command-line switch.
enable_chromevox_next = false enable_chromevox_next = false
enable_configuration_policy = !is_ios
# #
# ============================================= # =============================================
# PLEASE DO NOT ADD MORE FLAGS TO THIS FILE # PLEASE DO NOT ADD MORE FLAGS TO THIS FILE
......
...@@ -4063,11 +4063,9 @@ if (is_win) { ...@@ -4063,11 +4063,9 @@ if (is_win) {
] ]
deps = [ deps = [
"//base", "//base",
"//chrome/browser/policy:path_parser",
"//chrome/common:constants", "//chrome/common:constants",
] ]
if (enable_configuration_policy) {
deps += [ "//chrome/browser/policy:path_parser" ]
}
} }
} }
...@@ -4192,6 +4190,8 @@ static_library("test_support") { ...@@ -4192,6 +4190,8 @@ static_library("test_support") {
"notifications/notification_test_util.h", "notifications/notification_test_util.h",
"notifications/stub_notification_platform_bridge.cc", "notifications/stub_notification_platform_bridge.cc",
"notifications/stub_notification_platform_bridge.h", "notifications/stub_notification_platform_bridge.h",
"policy/test/local_policy_test_server.cc",
"policy/test/local_policy_test_server.h",
"search_engines/template_url_service_factory_test_util.cc", "search_engines/template_url_service_factory_test_util.cc",
"search_engines/template_url_service_factory_test_util.h", "search_engines/template_url_service_factory_test_util.h",
"search_engines/template_url_service_test_util.cc", "search_engines/template_url_service_test_util.cc",
...@@ -4234,6 +4234,7 @@ static_library("test_support") { ...@@ -4234,6 +4234,7 @@ static_library("test_support") {
"//components/invalidation/impl", "//components/invalidation/impl",
"//components/invalidation/impl:test_support", "//components/invalidation/impl:test_support",
"//components/password_manager/core/browser:test_support", "//components/password_manager/core/browser:test_support",
"//components/policy/core/browser:test_support",
"//components/prefs:test_support", "//components/prefs:test_support",
"//components/search_engines:test_support", "//components/search_engines:test_support",
"//components/sessions:test_support", "//components/sessions:test_support",
...@@ -4332,14 +4333,6 @@ static_library("test_support") { ...@@ -4332,14 +4333,6 @@ static_library("test_support") {
deps += [ "//chromeos:test_support" ] deps += [ "//chromeos:test_support" ]
} }
if (enable_configuration_policy) {
sources += [
"policy/test/local_policy_test_server.cc",
"policy/test/local_policy_test_server.h",
]
public_deps += [ "//components/policy/core/browser:test_support" ]
}
if (safe_browsing_mode == 1) { if (safe_browsing_mode == 1) {
sources += [ sources += [
"extensions/fake_safe_browsing_database_manager.cc", "extensions/fake_safe_browsing_database_manager.cc",
......
...@@ -198,6 +198,8 @@ test("components_unittests") { ...@@ -198,6 +198,8 @@ test("components_unittests") {
"//components/offline_pages/content/background_loader:unit_tests", "//components/offline_pages/content/background_loader:unit_tests",
"//components/packed_ct_ev_whitelist:unit_tests", "//components/packed_ct_ev_whitelist:unit_tests",
"//components/password_manager/content/browser:unit_tests", "//components/password_manager/content/browser:unit_tests",
"//components/policy/core/browser:unit_tests",
"//components/policy/core/common:unit_tests",
"//components/precache/content:unit_tests", "//components/precache/content:unit_tests",
"//components/safe_browsing_db:unit_tests", "//components/safe_browsing_db:unit_tests",
"//components/safe_json:unit_tests", "//components/safe_json:unit_tests",
...@@ -236,6 +238,7 @@ test("components_unittests") { ...@@ -236,6 +238,7 @@ test("components_unittests") {
"//components/gcm_driver/instance_id/android:instance_id_driver_test_support_java", "//components/gcm_driver/instance_id/android:instance_id_driver_test_support_java",
"//components/invalidation/impl", "//components/invalidation/impl",
"//components/invalidation/impl:java", "//components/invalidation/impl:java",
"//components/policy/android:policy_java",
"//components/safe_json", "//components/safe_json",
"//components/safe_json/android:safe_json_java", "//components/safe_json/android:safe_json_java",
"//components/signin/core/browser", "//components/signin/core/browser",
...@@ -253,10 +256,6 @@ test("components_unittests") { ...@@ -253,10 +256,6 @@ test("components_unittests") {
"//ui/gfx", "//ui/gfx",
"//v8:v8_external_startup_data_assets", "//v8:v8_external_startup_data_assets",
] ]
if (enable_configuration_policy) {
deps += [ "//components/policy/android:policy_java" ]
}
} }
# Desktop-only deps. # Desktop-only deps.
...@@ -285,13 +284,6 @@ test("components_unittests") { ...@@ -285,13 +284,6 @@ test("components_unittests") {
] ]
} }
if (enable_configuration_policy) {
deps += [
"//components/policy/core/browser:unit_tests",
"//components/policy/core/common:unit_tests",
]
}
if (toolkit_views) { if (toolkit_views) {
deps += [ "//components/constrained_window:unit_tests" ] deps += [ "//components/constrained_window:unit_tests" ]
} }
......
...@@ -9,6 +9,8 @@ import("//components/policy/resources/policy_templates.gni") ...@@ -9,6 +9,8 @@ import("//components/policy/resources/policy_templates.gni")
import("//third_party/protobuf/proto_library.gni") import("//third_party/protobuf/proto_library.gni")
import("//tools/grit/grit_rule.gni") import("//tools/grit/grit_rule.gni")
assert(!is_ios, "Policy should not be referenced on iOS")
# To test policy generation for platforms different than your OS, override and # To test policy generation for platforms different than your OS, override and
# enable these flags (but don't check that in!). # enable these flags (but don't check that in!).
gen_policy_templates_common = true gen_policy_templates_common = true
...@@ -44,351 +46,348 @@ config("component_implementation") { ...@@ -44,351 +46,348 @@ config("component_implementation") {
defines = [ "POLICY_COMPONENT_IMPLEMENTATION" ] defines = [ "POLICY_COMPONENT_IMPLEMENTATION" ]
} }
if (enable_configuration_policy) { # This protobuf is equivalent to chrome_settings.proto but shares messages
# This protobuf is equivalent to chrome_settings.proto but shares messages # for policies of the same type, so that less classes have to be generated
# for policies of the same type, so that less classes have to be generated # and compiled.
# and compiled. cloud_policy_proto_path = "$target_gen_dir/proto/cloud_policy.proto"
cloud_policy_proto_path = "$target_gen_dir/proto/cloud_policy.proto"
# This is the "full" protobuf, which defines one protobuf message per
# This is the "full" protobuf, which defines one protobuf message per # policy. It is also the format currently used by the server.
# policy. It is also the format currently used by the server. chrome_settings_proto_path = "$target_gen_dir/proto/chrome_settings.proto"
chrome_settings_proto_path = "$target_gen_dir/proto/chrome_settings.proto"
constants_header_path = "$target_gen_dir/policy_constants.h"
constants_header_path = "$target_gen_dir/policy_constants.h" constants_source_path = "$target_gen_dir/policy_constants.cc"
constants_source_path = "$target_gen_dir/policy_constants.cc" protobuf_decoder_path = "$target_gen_dir/cloud_policy_generated.cc"
protobuf_decoder_path = "$target_gen_dir/cloud_policy_generated.cc" app_restrictions_path = "$target_gen_dir/app_restrictions.xml"
app_restrictions_path = "$target_gen_dir/app_restrictions.xml" risk_tag_header_path = "$target_gen_dir/risk_tag.h"
risk_tag_header_path = "$target_gen_dir/risk_tag.h"
action("cloud_policy_code_generate") {
action("cloud_policy_code_generate") { script = "tools/generate_policy_source.py"
script = "tools/generate_policy_source.py" chrome_version_abspath = "//chrome/VERSION"
chrome_version_abspath = "//chrome/VERSION" chrome_version_path = rebase_path(chrome_version_abspath, root_build_dir)
chrome_version_path = rebase_path(chrome_version_abspath, root_build_dir)
if (is_chromeos) {
if (is_chromeos) { chromeos_flag = "1"
chromeos_flag = "1" } else {
} else { chromeos_flag = "0"
chromeos_flag = "0" }
}
inputs = [ inputs = [
chrome_version_abspath, chrome_version_abspath,
"resources/policy_templates.json", "resources/policy_templates.json",
] ]
outputs = [ outputs = [
constants_header_path, constants_header_path,
constants_source_path, constants_source_path,
protobuf_decoder_path, protobuf_decoder_path,
chrome_settings_proto_path, chrome_settings_proto_path,
cloud_policy_proto_path, cloud_policy_proto_path,
app_restrictions_path, app_restrictions_path,
risk_tag_header_path, risk_tag_header_path,
] ]
if (target_os != "android") {
outputs -= [ app_restrictions_path ]
}
if (target_os != "android") { args = [
outputs -= [ app_restrictions_path ] "--policy-constants-header=" +
} rebase_path(constants_header_path, root_build_dir),
"--policy-constants-source=" +
rebase_path(constants_source_path, root_build_dir),
"--chrome-settings-protobuf=" +
rebase_path(chrome_settings_proto_path, root_build_dir),
"--cloud-policy-protobuf=" +
rebase_path(cloud_policy_proto_path, root_build_dir),
"--cloud-policy-decoder=" +
rebase_path(protobuf_decoder_path, root_build_dir),
"--app-restrictions-definition=" +
rebase_path(app_restrictions_path, root_build_dir),
"--risk-tag-header=" + rebase_path(risk_tag_header_path, root_build_dir),
chrome_version_path,
target_os,
chromeos_flag,
rebase_path("resources/policy_templates.json", root_build_dir),
]
}
args = [ policy_templates_grd_file = "resources/policy_templates.grd"
"--policy-constants-header=" +
rebase_path(constants_header_path, root_build_dir), grit("grit_policy_templates") {
"--policy-constants-source=" + source = policy_templates_grd_file
rebase_path(constants_source_path, root_build_dir), use_qualified_include = true
"--chrome-settings-protobuf=" + output_dir = "$root_gen_dir/chrome"
rebase_path(chrome_settings_proto_path, root_build_dir), outputs = []
"--cloud-policy-protobuf=" + defines = []
rebase_path(cloud_policy_proto_path, root_build_dir),
"--cloud-policy-decoder=" + if (gen_policy_templates_common) {
rebase_path(protobuf_decoder_path, root_build_dir), outputs += policy_templates_doc_outputs
"--app-restrictions-definition=" + defines += [ "gen_policy_templates_common" ]
rebase_path(app_restrictions_path, root_build_dir), }
"--risk-tag-header=" + rebase_path(risk_tag_header_path, root_build_dir), if (gen_policy_templates_android) {
chrome_version_path, outputs += policy_templates_android_outputs
target_os, defines += [ "gen_policy_templates_android" ]
chromeos_flag, }
rebase_path("resources/policy_templates.json", root_build_dir), if (gen_policy_templates_linux) {
outputs += policy_templates_linux_outputs
defines += [ "gen_policy_templates_linux" ]
}
if (gen_policy_templates_mac) {
outputs += policy_templates_mac_outputs
defines += [
"mac_bundle_id=$chrome_mac_bundle_id",
"gen_policy_templates_mac",
] ]
} }
if (gen_policy_templates_win) {
outputs += policy_templates_windows_outputs
defines += [ "gen_policy_templates_win" ]
}
}
policy_templates_grd_file = "resources/policy_templates.grd" if (gen_policy_templates_win && is_chrome_branded) {
# Creates google.admx and google.adml files that define a common 'Google'
grit("grit_policy_templates") { # category used for Chrome, Chrome OS and possibly external tools, see
source = policy_templates_grd_file # crbug.com/665400.
use_qualified_include = true action("create_google_admx") {
output_dir = "$root_gen_dir/chrome" script = "tools/create_google_admx.py"
outputs = [] inputs = [
defines = [] policy_templates_grd_file,
grit_info_script,
] + policy_templates_windows_outputs
outputs = policy_templates_windows_google_outputs
deps = [
":grit_policy_templates",
]
if (gen_policy_templates_common) { # Don't pass in outputs directly, it would exceed a limit on Windows!
outputs += policy_templates_doc_outputs args = [
defines += [ "gen_policy_templates_common" ] "--basedir",
} rebase_path(policy_templates_base_dir, root_build_dir),
if (gen_policy_templates_android) { "--grd_strip_path_prefix",
outputs += policy_templates_android_outputs "app/policy/",
defines += [ "gen_policy_templates_android" ] "--grd_input",
} rebase_path(policy_templates_grd_file, root_build_dir),
if (gen_policy_templates_linux) { "--grit_info",
outputs += policy_templates_linux_outputs rebase_path(grit_info_script, root_build_dir),
defines += [ "gen_policy_templates_linux" ] "-D",
} "gen_policy_templates_win",
if (gen_policy_templates_mac) { ] + grit_defines
outputs += policy_templates_mac_outputs
defines += [
"mac_bundle_id=$chrome_mac_bundle_id",
"gen_policy_templates_mac",
]
}
if (gen_policy_templates_win) {
outputs += policy_templates_windows_outputs
defines += [ "gen_policy_templates_win" ]
}
} }
}
group("policy_templates") {
public_deps = [
":grit_policy_templates",
]
if (gen_policy_templates_win && is_chrome_branded) { if (gen_policy_templates_win && is_chrome_branded) {
# Creates google.admx and google.adml files that define a common 'Google' public_deps += [ ":create_google_admx" ]
# category used for Chrome, Chrome OS and possibly external tools, see
# crbug.com/665400.
action("create_google_admx") {
script = "tools/create_google_admx.py"
inputs = [
policy_templates_grd_file,
grit_info_script,
] + policy_templates_windows_outputs
outputs = policy_templates_windows_google_outputs
deps = [
":grit_policy_templates",
]
# Don't pass in outputs directly, it would exceed a limit on Windows!
args = [
"--basedir",
rebase_path(policy_templates_base_dir, root_build_dir),
"--grd_strip_path_prefix",
"app/policy/",
"--grd_input",
rebase_path(policy_templates_grd_file, root_build_dir),
"--grit_info",
rebase_path(grit_info_script, root_build_dir),
"-D",
"gen_policy_templates_win",
] + grit_defines
}
} }
}
group("policy_templates") { # Run the proto compiler over the generated file and make it a component.
public_deps = [ component("cloud_policy_proto_generated_compile") {
":grit_policy_templates", public_deps = [
":cloud_policy_proto_generated_compile_proto",
]
}
proto_library("cloud_policy_proto_generated_compile_proto") {
visibility = [ ":cloud_policy_proto_generated_compile" ]
sources = [
cloud_policy_proto_path,
]
proto_out_dir = "components/policy/proto"
cc_generator_options = "dllexport_decl=POLICY_PROTO_EXPORT:"
cc_include = "components/policy/proto/policy_proto_export.h"
component_build_force_source_set = true
defines = [ "POLICY_PROTO_COMPILATION" ]
deps = [
":cloud_policy_code_generate",
]
}
# This target builds the "full" protobuf, used for tests only.
proto_library("chrome_settings_proto") {
testonly = true
sources = [
chrome_settings_proto_path,
]
proto_out_dir = "components/policy/proto"
deps = [
":cloud_policy_code_generate",
":cloud_policy_proto_generated_compile",
]
}
static_library("generated") {
sources = [
constants_header_path,
constants_source_path,
protobuf_decoder_path,
risk_tag_header_path,
]
defines = [ "POLICY_COMPONENT_IMPLEMENTATION" ]
public_deps = [
":cloud_policy_code_generate",
":cloud_policy_proto_generated_compile",
"//base",
"//third_party/protobuf:protobuf_lite",
]
}
if (gen_policy_templates_android && is_android) {
import("//build/config/android/rules.gni")
_generated_resources_dir = "$root_gen_dir/chrome/app/policy/android"
copy("app_restrictions_resources_copy") {
sources = [
app_restrictions_path,
]
outputs = [
"$_generated_resources_dir/xml-v21/app_restrictions.xml",
]
deps = [
":cloud_policy_code_generate",
":policy_templates",
] ]
if (gen_policy_templates_win && is_chrome_branded) {
public_deps += [ ":create_google_admx" ]
}
} }
# Run the proto compiler over the generated file and make it a component. android_resources("app_restrictions_resources") {
component("cloud_policy_proto_generated_compile") { resource_dirs = []
public_deps = [ generated_resource_dirs = [
":cloud_policy_proto_generated_compile_proto", "$policy_templates_base_dir/android",
_generated_resources_dir,
]
generated_resource_files =
policy_templates_android_outputs +
[ "$_generated_resources_dir/xml-v21/app_restrictions.xml" ]
deps = [
":app_restrictions_resources_copy",
":grit_policy_templates",
] ]
} }
proto_library("cloud_policy_proto_generated_compile_proto") { } else if (gen_policy_templates_mac && is_mac) {
visibility = [ ":cloud_policy_proto_generated_compile" ] action("convert_mcx_plist") {
script = "//build/config/mac/xcrun.py"
sources = [ sources = [
cloud_policy_proto_path, "$policy_templates_base_dir/mac/app-Manifest.plist",
]
inputs = [
script,
]
outputs = [
"$target_gen_dir/$chrome_mac_bundle_id.manifest",
] ]
proto_out_dir = "components/policy/proto" if (use_system_xcode) {
cc_generator_options = "dllexport_decl=POLICY_PROTO_EXPORT:" args = []
cc_include = "components/policy/proto/policy_proto_export.h" } else {
component_build_force_source_set = true args = [
defines = [ "POLICY_PROTO_COMPILATION" ] "--developer_dir",
hermetic_xcode_path,
]
}
args += [
"plutil",
"-convert",
"xml1",
] + rebase_path(sources, root_out_dir) + [ "-o" ] +
rebase_path(outputs, root_out_dir)
deps = [ deps = [
":cloud_policy_code_generate", ":policy_templates",
] ]
} }
# This target builds the "full" protobuf, used for tests only. bundle_data("manifest_bundle_data") {
proto_library("chrome_settings_proto") { sources = get_target_outputs(":convert_mcx_plist")
testonly = true outputs = [
sources = [ "{{bundle_resources_dir}}/{{source_file_part}}",
chrome_settings_proto_path,
] ]
proto_out_dir = "components/policy/proto" public_deps = [
":convert_mcx_plist",
deps = [
":cloud_policy_code_generate",
":cloud_policy_proto_generated_compile",
] ]
} }
static_library("generated") { # The reason we are not enumerating all the locales is that
# the translations would eat up 3.5MB disk space in the
# application bundle.
bundle_data("manifest_strings_bundle_data") {
sources = [ sources = [
constants_header_path, "$policy_templates_base_dir/mac/strings/en.lproj/Localizable.strings",
constants_source_path, ]
protobuf_decoder_path, outputs = [
risk_tag_header_path, "{{bundle_resources_dir}}/en.lproj/{{source_file_part}}",
] ]
defines = [ "POLICY_COMPONENT_IMPLEMENTATION" ]
public_deps = [ public_deps = [
":cloud_policy_code_generate", ":policy_templates",
":cloud_policy_proto_generated_compile",
"//base",
"//third_party/protobuf:protobuf_lite",
] ]
} }
if (gen_policy_templates_android && is_android) { create_bundle("chrome_manifest_bundle") {
import("//build/config/android/rules.gni") bundle_root_dir = "$root_out_dir/$chrome_mac_bundle_id.manifest/Contents"
bundle_resources_dir = "$bundle_root_dir/Resources"
_generated_resources_dir = "$root_gen_dir/chrome/app/policy/android"
copy("app_restrictions_resources_copy") {
sources = [
app_restrictions_path,
]
outputs = [
"$_generated_resources_dir/xml-v21/app_restrictions.xml",
]
deps = [
":cloud_policy_code_generate",
":policy_templates",
]
}
android_resources("app_restrictions_resources") {
resource_dirs = []
generated_resource_dirs = [
"$policy_templates_base_dir/android",
_generated_resources_dir,
]
generated_resource_files =
policy_templates_android_outputs +
[ "$_generated_resources_dir/xml-v21/app_restrictions.xml" ]
deps = [
":app_restrictions_resources_copy",
":grit_policy_templates",
]
}
} else if (gen_policy_templates_mac && is_mac) {
action("convert_mcx_plist") {
script = "//build/config/mac/xcrun.py"
sources = [
"$policy_templates_base_dir/mac/app-Manifest.plist",
]
inputs = [
script,
]
outputs = [
"$target_gen_dir/$chrome_mac_bundle_id.manifest",
]
if (use_system_xcode) {
args = []
} else {
args = [
"--developer_dir",
hermetic_xcode_path,
]
}
args += [
"plutil",
"-convert",
"xml1",
] + rebase_path(sources, root_out_dir) + [ "-o" ] +
rebase_path(outputs, root_out_dir)
deps = [
":policy_templates",
]
}
bundle_data("manifest_bundle_data") { deps = [
sources = get_target_outputs(":convert_mcx_plist") ":manifest_bundle_data",
outputs = [ ":manifest_strings_bundle_data",
"{{bundle_resources_dir}}/{{source_file_part}}", ]
]
public_deps = [
":convert_mcx_plist",
]
}
# The reason we are not enumerating all the locales is that
# the translations would eat up 3.5MB disk space in the
# application bundle.
bundle_data("manifest_strings_bundle_data") {
sources = [
"$policy_templates_base_dir/mac/strings/en.lproj/Localizable.strings",
]
outputs = [
"{{bundle_resources_dir}}/en.lproj/{{source_file_part}}",
]
public_deps = [
":policy_templates",
]
}
create_bundle("chrome_manifest_bundle") {
bundle_root_dir = "$root_out_dir/$chrome_mac_bundle_id.manifest/Contents"
bundle_resources_dir = "$bundle_root_dir/Resources"
deps = [
":manifest_bundle_data",
":manifest_strings_bundle_data",
]
}
} }
}
if (gen_policy_templates_common && gen_policy_templates_win) { if (gen_policy_templates_common && gen_policy_templates_win) {
version_file = "VERSION" version_file = "VERSION"
version_path = "$policy_templates_base_dir/$version_file" version_path = "$policy_templates_base_dir/$version_file"
copy("add_version") { copy("add_version") {
sources = [ sources = [
"//chrome/VERSION", "//chrome/VERSION",
] ]
outputs = [ outputs = [
version_path, version_path,
] ]
} }
action("pack_policy_templates") { action("pack_policy_templates") {
output_zip_file = "$root_out_dir/policy_templates.zip" output_zip_file = "$root_out_dir/policy_templates.zip"
script = "tools/make_policy_zip.py" script = "tools/make_policy_zip.py"
inputs = inputs = [
[ version_path,
version_path, policy_templates_grd_file,
policy_templates_grd_file, grit_info_script,
grit_info_script, ] + policy_templates_windows_outputs + policy_templates_doc_outputs
] + policy_templates_windows_outputs + policy_templates_doc_outputs outputs = [
outputs = [ output_zip_file,
output_zip_file, ]
] args = [
args = [ "--output",
"--output", rebase_path(output_zip_file, root_build_dir),
rebase_path(output_zip_file, root_build_dir), "--basedir",
"--basedir", rebase_path(policy_templates_base_dir, root_build_dir),
rebase_path(policy_templates_base_dir, root_build_dir), "--grd_input",
"--grd_input", rebase_path(policy_templates_grd_file, root_build_dir),
rebase_path(policy_templates_grd_file, root_build_dir), "--grd_strip_path_prefix",
"--grd_strip_path_prefix", "app/policy",
"app/policy", "--extra_input",
"--extra_input", version_file,
version_file, "--grit_info",
"--grit_info", rebase_path(grit_info_script, root_build_dir),
rebase_path(grit_info_script, root_build_dir), "-D",
"-D", "gen_policy_templates_common",
"gen_policy_templates_common", "-D",
"-D", "gen_policy_templates_win",
"gen_policy_templates_win", ] + grit_defines
] + grit_defines if (is_chrome_branded) {
if (is_chrome_branded) { args += [ "--include_google_admx" ]
args += [ "--include_google_admx" ]
}
deps = [
":add_version",
":policy_templates",
]
} }
deps = [
":add_version",
":policy_templates",
]
} }
} }
...@@ -4,6 +4,8 @@ ...@@ -4,6 +4,8 @@
import("//build/config/features.gni") import("//build/config/features.gni")
assert(!is_ios, "Policy should not be referenced on iOS")
group("browser") { group("browser") {
if (is_component_build) { if (is_component_build) {
public_deps = [ public_deps = [
...@@ -19,11 +21,30 @@ group("browser") { ...@@ -19,11 +21,30 @@ group("browser") {
source_set("internal") { source_set("internal") {
visibility = [ "//components/policy/*" ] visibility = [ "//components/policy/*" ]
sources = [ sources = [
# Note that these sources are always included, even for builds that disable "autofill_policy_handler.cc",
# policy. Most source files should go in the conditional sources list "autofill_policy_handler.h",
# below. url_blacklist_manager.h is used by managed mode. "browser_policy_connector.cc",
"browser_policy_connector.h",
"browser_policy_connector_base.cc",
"browser_policy_connector_base.h",
"browser_policy_connector_ios.h",
"browser_policy_connector_ios.mm",
"cloud/message_util.cc",
"cloud/message_util.h",
"configuration_policy_handler.cc",
"configuration_policy_handler.h",
"configuration_policy_handler_list.cc",
"configuration_policy_handler_list.h",
"configuration_policy_pref_store.cc",
"configuration_policy_pref_store.h",
"policy_error_map.cc",
"policy_error_map.h",
"proxy_policy_handler.cc",
"proxy_policy_handler.h",
"url_blacklist_manager.cc", "url_blacklist_manager.cc",
"url_blacklist_manager.h", "url_blacklist_manager.h",
"url_blacklist_policy_handler.cc",
"url_blacklist_policy_handler.h",
] ]
configs += [ "//components/policy:component_implementation" ] configs += [ "//components/policy:component_implementation" ]
...@@ -56,91 +77,62 @@ source_set("internal") { ...@@ -56,91 +77,62 @@ source_set("internal") {
deps += [ "//components/policy/android:jni_headers" ] deps += [ "//components/policy/android:jni_headers" ]
} }
if (enable_configuration_policy) { public_deps += [ "//components/policy/core/common:internal" ]
sources += [ deps += [
"autofill_policy_handler.cc", "//components/autofill/core/common",
"autofill_policy_handler.h", "//components/proxy_config",
"browser_policy_connector.cc", "//google_apis",
"browser_policy_connector.h", "//net",
"browser_policy_connector_base.cc", "//third_party/icu",
"browser_policy_connector_base.h", ]
"browser_policy_connector_ios.h",
"browser_policy_connector_ios.mm",
"cloud/message_util.cc",
"cloud/message_util.h",
"configuration_policy_handler.cc",
"configuration_policy_handler.h",
"configuration_policy_handler_list.cc",
"configuration_policy_handler_list.h",
"configuration_policy_pref_store.cc",
"configuration_policy_pref_store.h",
"policy_error_map.cc",
"policy_error_map.h",
"proxy_policy_handler.cc",
"proxy_policy_handler.h",
"url_blacklist_policy_handler.cc",
"url_blacklist_policy_handler.h",
]
public_deps += [ "//components/policy/core/common:internal" ]
deps += [
"//components/autofill/core/common",
"//components/proxy_config",
"//google_apis",
"//net",
"//third_party/icu",
]
}
} }
if (enable_configuration_policy) { static_library("test_support") {
static_library("test_support") { testonly = true
testonly = true sources = [
sources = [ "configuration_policy_pref_store_test.cc",
"configuration_policy_pref_store_test.cc", "configuration_policy_pref_store_test.h",
"configuration_policy_pref_store_test.h", ]
]
public_deps = [ public_deps = [
":browser", ":browser",
"//base", "//base",
# Explicitly link in the generated policy target into the test support # Explicitly link in the generated policy target into the test support
# so it will be linked to dependent targets. Otherwise in component # so it will be linked to dependent targets. Otherwise in component
# build, it will be hidden inside the policy component. # build, it will be hidden inside the policy component.
"//components/policy:generated", "//components/policy:generated",
"//components/policy/core/common:test_support", "//components/policy/core/common:test_support",
] ]
deps = [ deps = [
"//testing/gtest", "//testing/gtest",
] ]
} }
source_set("unit_tests") { source_set("unit_tests") {
testonly = true testonly = true
sources = [ sources = [
"android/android_combined_policy_provider_unittest.cc", "android/android_combined_policy_provider_unittest.cc",
"android/policy_converter_unittest.cc", "android/policy_converter_unittest.cc",
"autofill_policy_handler_unittest.cc", "autofill_policy_handler_unittest.cc",
"browser_policy_connector_unittest.cc", "browser_policy_connector_unittest.cc",
"configuration_policy_handler_unittest.cc", "configuration_policy_handler_unittest.cc",
"configuration_policy_pref_store_unittest.cc", "configuration_policy_pref_store_unittest.cc",
"proxy_policy_handler_unittest.cc", "proxy_policy_handler_unittest.cc",
"url_blacklist_manager_unittest.cc", "url_blacklist_manager_unittest.cc",
"url_blacklist_policy_handler_unittest.cc", "url_blacklist_policy_handler_unittest.cc",
] ]
deps = [ deps = [
":test_support", ":test_support",
"//base", "//base",
"//components/autofill/core/common", "//components/autofill/core/common",
"//components/policy:generated", "//components/policy:generated",
"//components/prefs:test_support", "//components/prefs:test_support",
"//components/proxy_config", "//components/proxy_config",
"//components/url_formatter", "//components/url_formatter",
"//google_apis", "//google_apis",
"//net", "//net",
"//testing/gmock", "//testing/gmock",
"//testing/gtest", "//testing/gtest",
] ]
}
} }
...@@ -21,355 +21,329 @@ source_set("internal") { ...@@ -21,355 +21,329 @@ source_set("internal") {
configs += [ "//components/policy:component_implementation" ] configs += [ "//components/policy:component_implementation" ]
if (enable_configuration_policy) { sources = [
sources = [ "../../policy_export.h",
"../../policy_export.h", "async_policy_loader.cc",
"async_policy_loader.cc", "async_policy_loader.h",
"async_policy_loader.h", "async_policy_provider.cc",
"async_policy_provider.cc", "async_policy_provider.h",
"async_policy_provider.h", "cloud/cloud_external_data_manager.cc",
"cloud/cloud_external_data_manager.cc", "cloud/cloud_external_data_manager.h",
"cloud/cloud_external_data_manager.h", "cloud/cloud_policy_client.cc",
"cloud/cloud_policy_client.cc", "cloud/cloud_policy_client.h",
"cloud/cloud_policy_client.h", "cloud/cloud_policy_client_registration_helper.cc",
"cloud/cloud_policy_client_registration_helper.cc", "cloud/cloud_policy_client_registration_helper.h",
"cloud/cloud_policy_client_registration_helper.h", "cloud/cloud_policy_constants.cc",
"cloud/cloud_policy_constants.cc", "cloud/cloud_policy_constants.h",
"cloud/cloud_policy_constants.h", "cloud/cloud_policy_core.cc",
"cloud/cloud_policy_core.cc", "cloud/cloud_policy_core.h",
"cloud/cloud_policy_core.h", "cloud/cloud_policy_manager.cc",
"cloud/cloud_policy_manager.cc", "cloud/cloud_policy_manager.h",
"cloud/cloud_policy_manager.h", "cloud/cloud_policy_refresh_scheduler.cc",
"cloud/cloud_policy_refresh_scheduler.cc", "cloud/cloud_policy_refresh_scheduler.h",
"cloud/cloud_policy_refresh_scheduler.h", "cloud/cloud_policy_service.cc",
"cloud/cloud_policy_service.cc", "cloud/cloud_policy_service.h",
"cloud/cloud_policy_service.h", "cloud/cloud_policy_store.cc",
"cloud/cloud_policy_store.cc", "cloud/cloud_policy_store.h",
"cloud/cloud_policy_store.h", "cloud/cloud_policy_validator.cc",
"cloud/cloud_policy_validator.cc", "cloud/cloud_policy_validator.h",
"cloud/cloud_policy_validator.h", "cloud/component_cloud_policy_service.cc",
"cloud/component_cloud_policy_service.h",
"cloud/component_cloud_policy_store.cc",
"cloud/component_cloud_policy_store.h",
"cloud/component_cloud_policy_updater.cc",
"cloud/component_cloud_policy_updater.h",
"cloud/device_management_service.cc",
"cloud/device_management_service.h",
"cloud/enterprise_metrics.cc",
"cloud/enterprise_metrics.h",
"cloud/external_policy_data_fetcher.cc",
"cloud/external_policy_data_fetcher.h",
"cloud/external_policy_data_updater.cc",
"cloud/external_policy_data_updater.h",
"cloud/policy_header_io_helper.cc",
"cloud/policy_header_io_helper.h",
"cloud/policy_header_service.cc",
"cloud/policy_header_service.h",
"cloud/resource_cache.cc",
"cloud/resource_cache.h",
"cloud/signing_service.h",
"cloud/user_cloud_policy_manager.cc",
"cloud/user_cloud_policy_manager.h",
"cloud/user_cloud_policy_store.cc",
"cloud/user_cloud_policy_store.h",
"cloud/user_cloud_policy_store_base.cc",
"cloud/user_cloud_policy_store_base.h",
"cloud/user_info_fetcher.cc",
"cloud/user_info_fetcher.h",
"config_dir_policy_loader.cc",
"config_dir_policy_loader.h",
"configuration_policy_provider.cc",
"configuration_policy_provider.h",
"external_data_fetcher.cc",
"external_data_fetcher.h",
"external_data_manager.h",
"policy_bundle.cc",
"policy_bundle.h",
"policy_details.h",
"policy_load_status.cc",
"policy_load_status.h",
"policy_loader_ios.h",
"policy_loader_ios.mm",
"policy_loader_mac.h",
"policy_loader_mac.mm",
"policy_loader_win.cc",
"policy_loader_win.h",
"policy_map.cc",
"policy_map.h",
"policy_namespace.cc",
"policy_namespace.h",
"policy_pref_names.cc",
"policy_pref_names.h",
"policy_service.cc",
"policy_service.h",
"policy_service_impl.cc",
"policy_service_impl.h",
"policy_statistics_collector.cc",
"policy_statistics_collector.h",
"policy_switches.cc",
"policy_switches.h",
"policy_types.h",
"preferences_mac.cc",
"preferences_mac.h",
"remote_commands/remote_command_job.cc",
"remote_commands/remote_command_job.h",
"remote_commands/remote_commands_factory.cc",
"remote_commands/remote_commands_factory.h",
"remote_commands/remote_commands_queue.cc",
"remote_commands/remote_commands_queue.h",
"remote_commands/remote_commands_service.cc",
"remote_commands/remote_commands_service.h",
"schema.cc",
"schema.h",
"schema_internal.h",
"schema_map.cc",
"schema_map.h",
"schema_registry.cc",
"schema_registry.h",
"schema_registry_tracking_policy_provider.cc",
"schema_registry_tracking_policy_provider.h",
]
configs += [ "//build/config:precompiled_headers" ]
public_deps = [
"//components/policy:generated",
"//components/policy/proto",
]
deps = [
"//base:i18n",
"//base/third_party/dynamic_annotations",
"//components/data_use_measurement/core",
"//components/json_schema",
"//components/prefs",
"//extensions/features",
"//google_apis",
"//net",
"//third_party/re2",
"//url",
]
if (is_win) {
libs = [
"shlwapi.lib",
"userenv.lib",
"ntdsapi.lib",
]
}
if (is_win || is_chromeos) {
sources += [
"preg_parser.cc",
"preg_parser.h",
"registry_dict.cc",
"registry_dict.h",
]
}
if (is_android) {
sources += [ "cloud/component_cloud_policy_service_stub.cc" ]
sources -= [
"cloud/component_cloud_policy_service.cc", "cloud/component_cloud_policy_service.cc",
"cloud/component_cloud_policy_service.h",
"cloud/component_cloud_policy_store.cc", "cloud/component_cloud_policy_store.cc",
"cloud/component_cloud_policy_store.h", "cloud/component_cloud_policy_store.h",
"cloud/component_cloud_policy_updater.cc", "cloud/component_cloud_policy_updater.cc",
"cloud/component_cloud_policy_updater.h", "cloud/component_cloud_policy_updater.h",
"cloud/device_management_service.cc",
"cloud/device_management_service.h",
"cloud/enterprise_metrics.cc",
"cloud/enterprise_metrics.h",
"cloud/external_policy_data_fetcher.cc", "cloud/external_policy_data_fetcher.cc",
"cloud/external_policy_data_fetcher.h", "cloud/external_policy_data_fetcher.h",
"cloud/external_policy_data_updater.cc", "cloud/external_policy_data_updater.cc",
"cloud/external_policy_data_updater.h", "cloud/external_policy_data_updater.h",
"cloud/policy_header_io_helper.cc",
"cloud/policy_header_io_helper.h",
"cloud/policy_header_service.cc",
"cloud/policy_header_service.h",
"cloud/resource_cache.cc", "cloud/resource_cache.cc",
"cloud/resource_cache.h", "cloud/resource_cache.h",
"cloud/signing_service.h",
"cloud/user_cloud_policy_manager.cc",
"cloud/user_cloud_policy_manager.h",
"cloud/user_cloud_policy_store.cc",
"cloud/user_cloud_policy_store.h",
"cloud/user_cloud_policy_store_base.cc",
"cloud/user_cloud_policy_store_base.h",
"cloud/user_info_fetcher.cc",
"cloud/user_info_fetcher.h",
"config_dir_policy_loader.cc", "config_dir_policy_loader.cc",
"config_dir_policy_loader.h", "config_dir_policy_loader.h",
"configuration_policy_provider.cc",
"configuration_policy_provider.h",
"external_data_fetcher.cc",
"external_data_fetcher.h",
"external_data_manager.h",
"policy_bundle.cc",
"policy_bundle.h",
"policy_details.h",
"policy_load_status.cc", "policy_load_status.cc",
"policy_load_status.h", "policy_load_status.h",
"policy_loader_ios.h",
"policy_loader_ios.mm",
"policy_loader_mac.h",
"policy_loader_mac.mm",
"policy_loader_win.cc",
"policy_loader_win.h",
"policy_map.cc",
"policy_map.h",
"policy_namespace.cc",
"policy_namespace.h",
"policy_pref_names.cc",
"policy_pref_names.h",
"policy_service.cc",
"policy_service.h",
"policy_service_impl.cc",
"policy_service_impl.h",
"policy_statistics_collector.cc",
"policy_statistics_collector.h",
"policy_switches.cc",
"policy_switches.h",
"policy_types.h",
"preferences_mac.cc",
"preferences_mac.h",
"remote_commands/remote_command_job.cc",
"remote_commands/remote_command_job.h",
"remote_commands/remote_commands_factory.cc",
"remote_commands/remote_commands_factory.h",
"remote_commands/remote_commands_queue.cc",
"remote_commands/remote_commands_queue.h",
"remote_commands/remote_commands_service.cc",
"remote_commands/remote_commands_service.h",
"schema.cc",
"schema.h",
"schema_internal.h",
"schema_map.cc",
"schema_map.h",
"schema_registry.cc",
"schema_registry.h",
"schema_registry_tracking_policy_provider.cc",
"schema_registry_tracking_policy_provider.h",
]
configs += [ "//build/config:precompiled_headers" ]
public_deps = [
"//components/policy:generated",
"//components/policy/proto",
] ]
deps = [ }
"//base:i18n", if (is_chromeos) {
"//base/third_party/dynamic_annotations", sources += [
"//components/data_use_measurement/core", "proxy_policy_provider.cc",
"//components/json_schema", "proxy_policy_provider.h",
"//components/prefs",
"//extensions/features",
"//google_apis",
"//net",
"//third_party/re2",
"//url",
] ]
sources -= [
if (is_win) { "cloud/cloud_policy_client_registration_helper.cc",
libs = [ "cloud/cloud_policy_client_registration_helper.h",
"shlwapi.lib", "cloud/user_cloud_policy_manager.cc",
"userenv.lib", "cloud/user_cloud_policy_manager.h",
"ntdsapi.lib", "cloud/user_cloud_policy_store.cc",
] "cloud/user_cloud_policy_store.h",
}
if (is_win || is_chromeos) {
sources += [
"preg_parser.cc",
"preg_parser.h",
"registry_dict.cc",
"registry_dict.h",
]
}
if (is_android) {
sources += [ "cloud/component_cloud_policy_service_stub.cc" ]
sources -= [
"cloud/component_cloud_policy_service.cc",
"cloud/component_cloud_policy_store.cc",
"cloud/component_cloud_policy_store.h",
"cloud/component_cloud_policy_updater.cc",
"cloud/component_cloud_policy_updater.h",
"cloud/external_policy_data_fetcher.cc",
"cloud/external_policy_data_fetcher.h",
"cloud/external_policy_data_updater.cc",
"cloud/external_policy_data_updater.h",
"cloud/resource_cache.cc",
"cloud/resource_cache.h",
"config_dir_policy_loader.cc",
"config_dir_policy_loader.h",
"policy_load_status.cc",
"policy_load_status.h",
]
}
if (is_chromeos) {
sources += [
"proxy_policy_provider.cc",
"proxy_policy_provider.h",
]
sources -= [
"cloud/cloud_policy_client_registration_helper.cc",
"cloud/cloud_policy_client_registration_helper.h",
"cloud/user_cloud_policy_manager.cc",
"cloud/user_cloud_policy_manager.h",
"cloud/user_cloud_policy_store.cc",
"cloud/user_cloud_policy_store.h",
]
}
if (is_mac) {
libs = [ "CoreFoundation.framework" ]
}
if (is_ios || is_mac) {
sources += [
"mac_util.cc",
"mac_util.h",
]
}
} else {
# Some of the policy code is always enabled, so that other parts of Chrome
# can always interface with the PolicyService without having to #ifdef on
# ENABLE_CONFIGURATION_POLICY.
sources = [
"external_data_fetcher.cc",
"external_data_fetcher.h",
"external_data_manager.h",
"policy_map.cc",
"policy_map.h",
"policy_namespace.cc",
"policy_namespace.h",
"policy_pref_names.cc",
"policy_pref_names.h",
"policy_service.cc",
"policy_service.h",
"policy_service_stub.cc",
"policy_service_stub.h",
] ]
deps = [ }
"//base", if (is_mac) {
libs = [ "CoreFoundation.framework" ]
}
if (is_ios || is_mac) {
sources += [
"mac_util.cc",
"mac_util.h",
] ]
} }
} }
if (enable_configuration_policy) { static_library("test_support") {
static_library("test_support") { testonly = true
testonly = true sources = [
sources = [ "cloud/mock_cloud_external_data_manager.cc",
"cloud/mock_cloud_external_data_manager.cc", "cloud/mock_cloud_external_data_manager.h",
"cloud/mock_cloud_external_data_manager.h", "cloud/mock_cloud_policy_client.cc",
"cloud/mock_cloud_policy_client.cc", "cloud/mock_cloud_policy_client.h",
"cloud/mock_cloud_policy_client.h", "cloud/mock_cloud_policy_store.cc",
"cloud/mock_cloud_policy_store.cc", "cloud/mock_cloud_policy_store.h",
"cloud/mock_cloud_policy_store.h", "cloud/mock_device_management_service.cc",
"cloud/mock_device_management_service.cc", "cloud/mock_device_management_service.h",
"cloud/mock_device_management_service.h", "cloud/mock_signing_service.cc",
"cloud/mock_signing_service.cc", "cloud/mock_signing_service.h",
"cloud/mock_signing_service.h", "cloud/mock_user_cloud_policy_store.cc",
"cloud/mock_user_cloud_policy_store.h",
"cloud/policy_builder.cc",
"cloud/policy_builder.h",
"configuration_policy_provider_test.cc",
"configuration_policy_provider_test.h",
"fake_async_policy_loader.cc",
"fake_async_policy_loader.h",
"mock_configuration_policy_provider.cc",
"mock_configuration_policy_provider.h",
"mock_policy_service.cc",
"mock_policy_service.h",
"policy_test_utils.cc",
"policy_test_utils.h",
"preferences_mock_mac.cc",
"preferences_mock_mac.h",
"remote_commands/test_remote_command_job.cc",
"remote_commands/test_remote_command_job.h",
"remote_commands/testing_remote_commands_server.cc",
"remote_commands/testing_remote_commands_server.h",
]
if (is_chromeos) {
sources -= [
"cloud/mock_user_cloud_policy_store.cc", "cloud/mock_user_cloud_policy_store.cc",
"cloud/mock_user_cloud_policy_store.h", "cloud/mock_user_cloud_policy_store.h",
"cloud/policy_builder.cc",
"cloud/policy_builder.h",
"configuration_policy_provider_test.cc",
"configuration_policy_provider_test.h",
"fake_async_policy_loader.cc",
"fake_async_policy_loader.h",
"mock_configuration_policy_provider.cc",
"mock_configuration_policy_provider.h",
"mock_policy_service.cc",
"mock_policy_service.h",
"policy_test_utils.cc",
"policy_test_utils.h",
"preferences_mock_mac.cc",
"preferences_mock_mac.h",
"remote_commands/test_remote_command_job.cc",
"remote_commands/test_remote_command_job.h",
"remote_commands/testing_remote_commands_server.cc",
"remote_commands/testing_remote_commands_server.h",
] ]
}
if (is_chromeos) { public_deps = [
sources -= [ ":common",
"cloud/mock_user_cloud_policy_store.cc", "//base",
"cloud/mock_user_cloud_policy_store.h",
]
}
public_deps = [ # Explicitly link in the generated policy target into the test support
":common", # so it will be linked to dependent targets. Otherwise in component
"//base", # build, it will be hidden inside the policy component.
"//components/policy:generated",
"//components/policy/proto",
"//crypto",
"//net",
"//testing/gmock",
"//testing/gtest",
]
}
# Explicitly link in the generated policy target into the test support source_set("unit_tests") {
# so it will be linked to dependent targets. Otherwise in component testonly = true
# build, it will be hidden inside the policy component. sources = [
"//components/policy:generated", "//extensions/features",
"//components/policy/proto", "cloud/cloud_policy_client_unittest.cc",
"//crypto", "cloud/cloud_policy_core_unittest.cc",
"//net", "cloud/cloud_policy_manager_unittest.cc",
"//testing/gmock", "cloud/cloud_policy_refresh_scheduler_unittest.cc",
"//testing/gtest", "cloud/cloud_policy_service_unittest.cc",
"cloud/cloud_policy_validator_unittest.cc",
"cloud/device_management_service_unittest.cc",
"cloud/policy_header_io_helper_unittest.cc",
"cloud/policy_header_service_unittest.cc",
"cloud/user_info_fetcher_unittest.cc",
"generate_policy_source_unittest.cc",
"policy_bundle_unittest.cc",
"policy_loader_ios_unittest.mm",
"policy_loader_mac_unittest.cc",
"policy_loader_win_unittest.cc",
"policy_map_unittest.cc",
"policy_service_impl_unittest.cc",
"policy_statistics_collector_unittest.cc",
"remote_commands/remote_commands_queue_unittest.cc",
"remote_commands/remote_commands_service_unittest.cc",
"schema_map_unittest.cc",
"schema_registry_tracking_policy_provider_unittest.cc",
"schema_registry_unittest.cc",
"schema_unittest.cc",
]
if (is_win || is_chromeos) {
sources += [
"preg_parser_unittest.cc",
"registry_dict_unittest.cc",
] ]
} }
if (is_chromeos) {
source_set("unit_tests") { sources += [ "proxy_policy_provider_unittest.cc" ]
testonly = true } else {
sources = [ sources += [
"//extensions/features", "cloud/user_cloud_policy_manager_unittest.cc",
"cloud/cloud_policy_client_unittest.cc", "cloud/user_cloud_policy_store_unittest.cc",
"cloud/cloud_policy_core_unittest.cc",
"cloud/cloud_policy_manager_unittest.cc",
"cloud/cloud_policy_refresh_scheduler_unittest.cc",
"cloud/cloud_policy_service_unittest.cc",
"cloud/cloud_policy_validator_unittest.cc",
"cloud/device_management_service_unittest.cc",
"cloud/policy_header_io_helper_unittest.cc",
"cloud/policy_header_service_unittest.cc",
"cloud/user_info_fetcher_unittest.cc",
"generate_policy_source_unittest.cc",
"policy_bundle_unittest.cc",
"policy_loader_ios_unittest.mm",
"policy_loader_mac_unittest.cc",
"policy_loader_win_unittest.cc",
"policy_map_unittest.cc",
"policy_service_impl_unittest.cc",
"policy_statistics_collector_unittest.cc",
"remote_commands/remote_commands_queue_unittest.cc",
"remote_commands/remote_commands_service_unittest.cc",
"schema_map_unittest.cc",
"schema_registry_tracking_policy_provider_unittest.cc",
"schema_registry_unittest.cc",
"schema_unittest.cc",
] ]
if (is_win || is_chromeos) { }
sources += [ if (!is_android) {
"preg_parser_unittest.cc", sources += [ "async_policy_provider_unittest.cc" ]
"registry_dict_unittest.cc", }
] if (!is_android && !is_ios) {
} sources += [
if (is_chromeos) { "cloud/component_cloud_policy_service_unittest.cc",
sources += [ "proxy_policy_provider_unittest.cc" ] "cloud/component_cloud_policy_store_unittest.cc",
} else { "cloud/component_cloud_policy_updater_unittest.cc",
sources += [ "cloud/external_policy_data_fetcher_unittest.cc",
"cloud/user_cloud_policy_manager_unittest.cc", "cloud/external_policy_data_updater_unittest.cc",
"cloud/user_cloud_policy_store_unittest.cc", "cloud/resource_cache_unittest.cc",
] "config_dir_policy_loader_unittest.cc",
}
if (!is_android) {
sources += [ "async_policy_provider_unittest.cc" ]
}
if (!is_android && !is_ios) {
sources += [
"cloud/component_cloud_policy_service_unittest.cc",
"cloud/component_cloud_policy_store_unittest.cc",
"cloud/component_cloud_policy_updater_unittest.cc",
"cloud/external_policy_data_fetcher_unittest.cc",
"cloud/external_policy_data_updater_unittest.cc",
"cloud/resource_cache_unittest.cc",
"config_dir_policy_loader_unittest.cc",
]
}
if (is_mac || is_ios) {
sources += [ "mac_util_unittest.cc" ]
}
if (is_win || is_chromeos) {
# Needed by policy_loader_win_unittest.cc and preg_parser_unittest.cc
data = [
"//chrome/test/data/policy/",
]
}
deps = [
":test_support",
"//base",
"//base/test:test_support",
"//components/policy:generated",
"//components/prefs:test_support",
"//extensions/features",
"//google_apis",
"//net:test_support",
"//testing/gmock",
"//testing/gtest",
] ]
} }
if (is_mac || is_ios) {
sources += [ "mac_util_unittest.cc" ]
}
if (is_win || is_chromeos) {
# Needed by policy_loader_win_unittest.cc and preg_parser_unittest.cc
data = [
"//chrome/test/data/policy/",
]
}
deps = [
":test_support",
"//base",
"//base/test:test_support",
"//components/policy:generated",
"//components/prefs:test_support",
"//extensions/features",
"//google_apis",
"//net:test_support",
"//testing/gmock",
"//testing/gtest",
]
} }
...@@ -83,7 +83,7 @@ static_library("search_engines") { ...@@ -83,7 +83,7 @@ static_library("search_engines") {
"//url", "//url",
] ]
if (enable_configuration_policy) { if (!is_ios) {
sources += [ sources += [
"default_search_policy_handler.cc", "default_search_policy_handler.cc",
"default_search_policy_handler.h", "default_search_policy_handler.h",
...@@ -140,7 +140,7 @@ source_set("unit_tests") { ...@@ -140,7 +140,7 @@ source_set("unit_tests") {
"//url", "//url",
] ]
if (enable_configuration_policy) { if (!is_ios) {
sources += [ "default_search_policy_handler_unittest.cc" ] sources += [ "default_search_policy_handler_unittest.cc" ]
deps += [ deps += [
......
...@@ -623,7 +623,7 @@ static_library("sync") { ...@@ -623,7 +623,7 @@ static_library("sync") {
] ]
} }
if (enable_configuration_policy) { if (!is_ios) {
sources += [ sources += [
"driver/sync_policy_handler.cc", "driver/sync_policy_handler.cc",
"driver/sync_policy_handler.h", "driver/sync_policy_handler.h",
...@@ -990,7 +990,7 @@ source_set("unit_tests") { ...@@ -990,7 +990,7 @@ source_set("unit_tests") {
sources += [ "engine_impl/loopback_server/loopback_server_unittest.cc" ] sources += [ "engine_impl/loopback_server/loopback_server_unittest.cc" ]
} }
if (enable_configuration_policy) { if (!is_ios) {
sources += [ "driver/sync_policy_handler_unittest.cc" ] sources += [ "driver/sync_policy_handler_unittest.cc" ]
deps += [ deps += [
"//components/policy:generated", "//components/policy:generated",
......
...@@ -26,10 +26,7 @@ static_library("sync_preferences") { ...@@ -26,10 +26,7 @@ static_library("sync_preferences") {
"//components/sync", "//components/sync",
] ]
if (enable_configuration_policy) { if (!is_ios) {
# This define is only used for compiling the .cc files in this target.
defines = [ "SYNC_PREFERENCES_USE_POLICY" ]
deps += [ "//components/policy/core/browser" ] deps += [ "//components/policy/core/browser" ]
} }
} }
......
...@@ -5,13 +5,14 @@ ...@@ -5,13 +5,14 @@
#include "components/sync_preferences/pref_service_syncable_factory.h" #include "components/sync_preferences/pref_service_syncable_factory.h"
#include "base/trace_event/trace_event.h" #include "base/trace_event/trace_event.h"
#include "build/build_config.h"
#include "components/pref_registry/pref_registry_syncable.h" #include "components/pref_registry/pref_registry_syncable.h"
#include "components/prefs/default_pref_store.h" #include "components/prefs/default_pref_store.h"
#include "components/prefs/pref_notifier_impl.h" #include "components/prefs/pref_notifier_impl.h"
#include "components/prefs/pref_value_store.h" #include "components/prefs/pref_value_store.h"
#include "components/sync_preferences/pref_service_syncable.h" #include "components/sync_preferences/pref_service_syncable.h"
#if defined(SYNC_PREFERENCES_USE_POLICY) #if !defined(OS_IOS)
#include "components/policy/core/browser/browser_policy_connector.h" #include "components/policy/core/browser/browser_policy_connector.h"
#include "components/policy/core/browser/configuration_policy_pref_store.h" #include "components/policy/core/browser/configuration_policy_pref_store.h"
#include "components/policy/core/common/policy_service.h" // nogncheck #include "components/policy/core/common/policy_service.h" // nogncheck
...@@ -27,7 +28,7 @@ PrefServiceSyncableFactory::~PrefServiceSyncableFactory() {} ...@@ -27,7 +28,7 @@ PrefServiceSyncableFactory::~PrefServiceSyncableFactory() {}
void PrefServiceSyncableFactory::SetManagedPolicies( void PrefServiceSyncableFactory::SetManagedPolicies(
policy::PolicyService* service, policy::PolicyService* service,
policy::BrowserPolicyConnector* connector) { policy::BrowserPolicyConnector* connector) {
#if defined(SYNC_PREFERENCES_USE_POLICY) #if !defined(OS_IOS)
set_managed_prefs(new policy::ConfigurationPolicyPrefStore( set_managed_prefs(new policy::ConfigurationPolicyPrefStore(
service, connector->GetHandlerList(), policy::POLICY_LEVEL_MANDATORY)); service, connector->GetHandlerList(), policy::POLICY_LEVEL_MANDATORY));
#else #else
...@@ -38,7 +39,7 @@ void PrefServiceSyncableFactory::SetManagedPolicies( ...@@ -38,7 +39,7 @@ void PrefServiceSyncableFactory::SetManagedPolicies(
void PrefServiceSyncableFactory::SetRecommendedPolicies( void PrefServiceSyncableFactory::SetRecommendedPolicies(
policy::PolicyService* service, policy::PolicyService* service,
policy::BrowserPolicyConnector* connector) { policy::BrowserPolicyConnector* connector) {
#if defined(SYNC_PREFERENCES_USE_POLICY) #if !defined(OS_IOS)
set_recommended_prefs(new policy::ConfigurationPolicyPrefStore( set_recommended_prefs(new policy::ConfigurationPolicyPrefStore(
service, connector->GetHandlerList(), policy::POLICY_LEVEL_RECOMMENDED)); service, connector->GetHandlerList(), policy::POLICY_LEVEL_RECOMMENDED));
#else #else
......
...@@ -118,7 +118,7 @@ group("test_support") { ...@@ -118,7 +118,7 @@ group("test_support") {
"//testing/gtest", "//testing/gtest",
] ]
if (enable_configuration_policy) { if (!is_ios) {
deps += [ "//components/policy/core/browser:test_support" ] deps += [ "//components/policy/core/browser:test_support" ]
} }
...@@ -177,10 +177,6 @@ test("remoting_unittests") { ...@@ -177,10 +177,6 @@ test("remoting_unittests") {
"wtsapi32.lib", "wtsapi32.lib",
] ]
} }
if (enable_configuration_policy) {
#deps += [ "//components/policy/core/browser:test_support" ]
}
} }
if (enable_remoting_host) { if (enable_remoting_host) {
......
...@@ -325,7 +325,7 @@ static_library("host") { ...@@ -325,7 +325,7 @@ static_library("host") {
public_deps = [] public_deps = []
if (enable_configuration_policy) { if (!is_ios) {
deps += [ "//components/policy:generated" ] deps += [ "//components/policy:generated" ]
} }
...@@ -567,7 +567,7 @@ source_set("unit_tests") { ...@@ -567,7 +567,7 @@ source_set("unit_tests") {
deps += [ "//remoting/host/win:unit_tests" ] deps += [ "//remoting/host/win:unit_tests" ]
} }
if (enable_configuration_policy) { if (!is_ios) {
deps += [ "//components/policy/core/browser:test_support" ] deps += [ "//components/policy/core/browser:test_support" ]
} }
} }
...@@ -737,7 +737,7 @@ if (enable_me2me_host) { ...@@ -737,7 +737,7 @@ if (enable_me2me_host) {
"//third_party/webrtc/modules/desktop_capture", "//third_party/webrtc/modules/desktop_capture",
] ]
if (enable_configuration_policy) { if (!is_ios) {
deps += [ "//components/policy:generated" ] deps += [ "//components/policy:generated" ]
} }
......
...@@ -132,7 +132,7 @@ source_set("win") { ...@@ -132,7 +132,7 @@ source_set("win") {
"//ui/events/platform", "//ui/events/platform",
] ]
if (enable_configuration_policy) { if (!is_ios) {
deps += [ "//components/policy:generated" ] deps += [ "//components/policy:generated" ]
} }
......
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