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") {
"//chrome/test:telemetry_perf_unittests",
"//chrome/test:unit_tests",
"//components:components_browsertests",
"//components/policy:policy_templates",
"//content/shell:content_shell",
"//content/test:content_browsertests",
"//content/test:content_perftests",
......@@ -384,10 +385,6 @@ group("both_gn_and_gyp") {
deps += [ "//tools/xdisplaycheck" ]
}
if (enable_configuration_policy) {
deps += [ "//components/policy:policy_templates" ]
}
if (v8_use_external_startup_data) {
deps += [ "//gin:gin_v8_snapshot_fingerprint" ]
}
......
......@@ -488,6 +488,8 @@ source_set("common") {
"//components/metrics:profiler",
"//components/metrics:ui",
"//components/navigation_interception",
"//components/policy:generated",
"//components/policy/core/browser",
"//components/prefs",
"//components/printing/browser",
"//components/printing/common",
......@@ -526,13 +528,6 @@ source_set("common") {
"//v8",
]
if (enable_configuration_policy) {
deps += [
"//components/policy:generated",
"//components/policy/core/browser",
]
}
if (enable_spellcheck) {
deps += [
"//components/spellcheck/browser",
......@@ -617,6 +612,7 @@ android_library("android_webview_java") {
"//base:base_java",
"//components/autofill/android:autofill_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_restrictions:web_restrictions_java",
"//content/public/android:content_java",
......@@ -628,10 +624,6 @@ android_library("android_webview_java") {
google_play_services_resources,
]
if (enable_configuration_policy) {
deps += [ "//components/policy/android:policy_java" ]
}
if (enable_spellcheck) {
deps += [ "//components/spellcheck/browser/android:java" ]
}
......
......@@ -89,8 +89,6 @@ enable_rlz = is_chrome_branded && enable_rlz_support
# Chrome OS: whether to also build the upcoming version of
# ChromeVox, which can then be enabled via a command-line switch.
enable_chromevox_next = false
enable_configuration_policy = !is_ios
#
# =============================================
# PLEASE DO NOT ADD MORE FLAGS TO THIS FILE
......
......@@ -4063,11 +4063,9 @@ if (is_win) {
]
deps = [
"//base",
"//chrome/browser/policy:path_parser",
"//chrome/common:constants",
]
if (enable_configuration_policy) {
deps += [ "//chrome/browser/policy:path_parser" ]
}
}
}
......@@ -4192,6 +4190,8 @@ static_library("test_support") {
"notifications/notification_test_util.h",
"notifications/stub_notification_platform_bridge.cc",
"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.h",
"search_engines/template_url_service_test_util.cc",
......@@ -4234,6 +4234,7 @@ static_library("test_support") {
"//components/invalidation/impl",
"//components/invalidation/impl:test_support",
"//components/password_manager/core/browser:test_support",
"//components/policy/core/browser:test_support",
"//components/prefs:test_support",
"//components/search_engines:test_support",
"//components/sessions:test_support",
......@@ -4332,14 +4333,6 @@ static_library("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) {
sources += [
"extensions/fake_safe_browsing_database_manager.cc",
......
......@@ -198,6 +198,8 @@ test("components_unittests") {
"//components/offline_pages/content/background_loader:unit_tests",
"//components/packed_ct_ev_whitelist: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/safe_browsing_db:unit_tests",
"//components/safe_json:unit_tests",
......@@ -236,6 +238,7 @@ test("components_unittests") {
"//components/gcm_driver/instance_id/android:instance_id_driver_test_support_java",
"//components/invalidation/impl",
"//components/invalidation/impl:java",
"//components/policy/android:policy_java",
"//components/safe_json",
"//components/safe_json/android:safe_json_java",
"//components/signin/core/browser",
......@@ -253,10 +256,6 @@ test("components_unittests") {
"//ui/gfx",
"//v8:v8_external_startup_data_assets",
]
if (enable_configuration_policy) {
deps += [ "//components/policy/android:policy_java" ]
}
}
# Desktop-only deps.
......@@ -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) {
deps += [ "//components/constrained_window:unit_tests" ]
}
......
......@@ -9,6 +9,8 @@ import("//components/policy/resources/policy_templates.gni")
import("//third_party/protobuf/proto_library.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
# enable these flags (but don't check that in!).
gen_policy_templates_common = true
......@@ -44,23 +46,22 @@ config("component_implementation") {
defines = [ "POLICY_COMPONENT_IMPLEMENTATION" ]
}
if (enable_configuration_policy) {
# 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
# and compiled.
cloud_policy_proto_path = "$target_gen_dir/proto/cloud_policy.proto"
# 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
# and compiled.
cloud_policy_proto_path = "$target_gen_dir/proto/cloud_policy.proto"
# This is the "full" protobuf, which defines one protobuf message per
# policy. It is also the format currently used by the server.
chrome_settings_proto_path = "$target_gen_dir/proto/chrome_settings.proto"
# This is the "full" protobuf, which defines one protobuf message per
# policy. It is also the format currently used by the server.
chrome_settings_proto_path = "$target_gen_dir/proto/chrome_settings.proto"
constants_header_path = "$target_gen_dir/policy_constants.h"
constants_source_path = "$target_gen_dir/policy_constants.cc"
protobuf_decoder_path = "$target_gen_dir/cloud_policy_generated.cc"
app_restrictions_path = "$target_gen_dir/app_restrictions.xml"
risk_tag_header_path = "$target_gen_dir/risk_tag.h"
constants_header_path = "$target_gen_dir/policy_constants.h"
constants_source_path = "$target_gen_dir/policy_constants.cc"
protobuf_decoder_path = "$target_gen_dir/cloud_policy_generated.cc"
app_restrictions_path = "$target_gen_dir/app_restrictions.xml"
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"
chrome_version_abspath = "//chrome/VERSION"
chrome_version_path = rebase_path(chrome_version_abspath, root_build_dir)
......@@ -108,11 +109,11 @@ if (enable_configuration_policy) {
chromeos_flag,
rebase_path("resources/policy_templates.json", root_build_dir),
]
}
}
policy_templates_grd_file = "resources/policy_templates.grd"
policy_templates_grd_file = "resources/policy_templates.grd"
grit("grit_policy_templates") {
grit("grit_policy_templates") {
source = policy_templates_grd_file
use_qualified_include = true
output_dir = "$root_gen_dir/chrome"
......@@ -142,9 +143,9 @@ if (enable_configuration_policy) {
outputs += policy_templates_windows_outputs
defines += [ "gen_policy_templates_win" ]
}
}
}
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'
# category used for Chrome, Chrome OS and possibly external tools, see
# crbug.com/665400.
......@@ -173,24 +174,24 @@ if (enable_configuration_policy) {
"gen_policy_templates_win",
] + grit_defines
}
}
}
group("policy_templates") {
group("policy_templates") {
public_deps = [
":grit_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.
component("cloud_policy_proto_generated_compile") {
# Run the proto compiler over the generated file and make it a component.
component("cloud_policy_proto_generated_compile") {
public_deps = [
":cloud_policy_proto_generated_compile_proto",
]
}
proto_library("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,
......@@ -205,10 +206,10 @@ if (enable_configuration_policy) {
deps = [
":cloud_policy_code_generate",
]
}
}
# This target builds the "full" protobuf, used for tests only.
proto_library("chrome_settings_proto") {
# This target builds the "full" protobuf, used for tests only.
proto_library("chrome_settings_proto") {
testonly = true
sources = [
chrome_settings_proto_path,
......@@ -219,9 +220,9 @@ if (enable_configuration_policy) {
":cloud_policy_code_generate",
":cloud_policy_proto_generated_compile",
]
}
}
static_library("generated") {
static_library("generated") {
sources = [
constants_header_path,
constants_source_path,
......@@ -236,9 +237,9 @@ if (enable_configuration_policy) {
"//base",
"//third_party/protobuf:protobuf_lite",
]
}
}
if (gen_policy_templates_android && is_android) {
if (gen_policy_templates_android && is_android) {
import("//build/config/android/rules.gni")
_generated_resources_dir = "$root_gen_dir/chrome/app/policy/android"
......@@ -270,7 +271,7 @@ if (enable_configuration_policy) {
":grit_policy_templates",
]
}
} else if (gen_policy_templates_mac && is_mac) {
} else if (gen_policy_templates_mac && is_mac) {
action("convert_mcx_plist") {
script = "//build/config/mac/xcrun.py"
sources = [
......@@ -337,9 +338,9 @@ if (enable_configuration_policy) {
":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_path = "$policy_templates_base_dir/$version_file"
......@@ -355,8 +356,7 @@ if (enable_configuration_policy) {
action("pack_policy_templates") {
output_zip_file = "$root_out_dir/policy_templates.zip"
script = "tools/make_policy_zip.py"
inputs =
[
inputs = [
version_path,
policy_templates_grd_file,
grit_info_script,
......@@ -390,5 +390,4 @@ if (enable_configuration_policy) {
":policy_templates",
]
}
}
}
......@@ -4,6 +4,8 @@
import("//build/config/features.gni")
assert(!is_ios, "Policy should not be referenced on iOS")
group("browser") {
if (is_component_build) {
public_deps = [
......@@ -19,11 +21,30 @@ group("browser") {
source_set("internal") {
visibility = [ "//components/policy/*" ]
sources = [
# Note that these sources are always included, even for builds that disable
# policy. Most source files should go in the conditional sources list
# below. url_blacklist_manager.h is used by managed mode.
"autofill_policy_handler.cc",
"autofill_policy_handler.h",
"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.h",
"url_blacklist_policy_handler.cc",
"url_blacklist_policy_handler.h",
]
configs += [ "//components/policy:component_implementation" ]
......@@ -56,32 +77,6 @@ source_set("internal") {
deps += [ "//components/policy/android:jni_headers" ]
}
if (enable_configuration_policy) {
sources += [
"autofill_policy_handler.cc",
"autofill_policy_handler.h",
"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_policy_handler.cc",
"url_blacklist_policy_handler.h",
]
public_deps += [ "//components/policy/core/common:internal" ]
deps += [
"//components/autofill/core/common",
......@@ -90,11 +85,9 @@ source_set("internal") {
"//net",
"//third_party/icu",
]
}
}
if (enable_configuration_policy) {
static_library("test_support") {
static_library("test_support") {
testonly = true
sources = [
"configuration_policy_pref_store_test.cc",
......@@ -114,9 +107,9 @@ if (enable_configuration_policy) {
deps = [
"//testing/gtest",
]
}
}
source_set("unit_tests") {
source_set("unit_tests") {
testonly = true
sources = [
"android/android_combined_policy_provider_unittest.cc",
......@@ -142,5 +135,4 @@ if (enable_configuration_policy) {
"//testing/gmock",
"//testing/gtest",
]
}
}
......@@ -21,7 +21,6 @@ source_set("internal") {
configs += [ "//components/policy:component_implementation" ]
if (enable_configuration_policy) {
sources = [
"../../policy_export.h",
"async_policy_loader.cc",
......@@ -208,33 +207,9 @@ source_set("internal") {
"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 (enable_configuration_policy) {
static_library("test_support") {
static_library("test_support") {
testonly = true
sources = [
"cloud/mock_cloud_external_data_manager.cc",
......@@ -290,9 +265,9 @@ if (enable_configuration_policy) {
"//testing/gmock",
"//testing/gtest",
]
}
}
source_set("unit_tests") {
source_set("unit_tests") {
testonly = true
sources = [
"//extensions/features",
......@@ -371,5 +346,4 @@ if (enable_configuration_policy) {
"//testing/gmock",
"//testing/gtest",
]
}
}
......@@ -83,7 +83,7 @@ static_library("search_engines") {
"//url",
]
if (enable_configuration_policy) {
if (!is_ios) {
sources += [
"default_search_policy_handler.cc",
"default_search_policy_handler.h",
......@@ -140,7 +140,7 @@ source_set("unit_tests") {
"//url",
]
if (enable_configuration_policy) {
if (!is_ios) {
sources += [ "default_search_policy_handler_unittest.cc" ]
deps += [
......
......@@ -623,7 +623,7 @@ static_library("sync") {
]
}
if (enable_configuration_policy) {
if (!is_ios) {
sources += [
"driver/sync_policy_handler.cc",
"driver/sync_policy_handler.h",
......@@ -990,7 +990,7 @@ source_set("unit_tests") {
sources += [ "engine_impl/loopback_server/loopback_server_unittest.cc" ]
}
if (enable_configuration_policy) {
if (!is_ios) {
sources += [ "driver/sync_policy_handler_unittest.cc" ]
deps += [
"//components/policy:generated",
......
......@@ -26,10 +26,7 @@ static_library("sync_preferences") {
"//components/sync",
]
if (enable_configuration_policy) {
# This define is only used for compiling the .cc files in this target.
defines = [ "SYNC_PREFERENCES_USE_POLICY" ]
if (!is_ios) {
deps += [ "//components/policy/core/browser" ]
}
}
......
......@@ -5,13 +5,14 @@
#include "components/sync_preferences/pref_service_syncable_factory.h"
#include "base/trace_event/trace_event.h"
#include "build/build_config.h"
#include "components/pref_registry/pref_registry_syncable.h"
#include "components/prefs/default_pref_store.h"
#include "components/prefs/pref_notifier_impl.h"
#include "components/prefs/pref_value_store.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/configuration_policy_pref_store.h"
#include "components/policy/core/common/policy_service.h" // nogncheck
......@@ -27,7 +28,7 @@ PrefServiceSyncableFactory::~PrefServiceSyncableFactory() {}
void PrefServiceSyncableFactory::SetManagedPolicies(
policy::PolicyService* service,
policy::BrowserPolicyConnector* connector) {
#if defined(SYNC_PREFERENCES_USE_POLICY)
#if !defined(OS_IOS)
set_managed_prefs(new policy::ConfigurationPolicyPrefStore(
service, connector->GetHandlerList(), policy::POLICY_LEVEL_MANDATORY));
#else
......@@ -38,7 +39,7 @@ void PrefServiceSyncableFactory::SetManagedPolicies(
void PrefServiceSyncableFactory::SetRecommendedPolicies(
policy::PolicyService* service,
policy::BrowserPolicyConnector* connector) {
#if defined(SYNC_PREFERENCES_USE_POLICY)
#if !defined(OS_IOS)
set_recommended_prefs(new policy::ConfigurationPolicyPrefStore(
service, connector->GetHandlerList(), policy::POLICY_LEVEL_RECOMMENDED));
#else
......
......@@ -118,7 +118,7 @@ group("test_support") {
"//testing/gtest",
]
if (enable_configuration_policy) {
if (!is_ios) {
deps += [ "//components/policy/core/browser:test_support" ]
}
......@@ -177,10 +177,6 @@ test("remoting_unittests") {
"wtsapi32.lib",
]
}
if (enable_configuration_policy) {
#deps += [ "//components/policy/core/browser:test_support" ]
}
}
if (enable_remoting_host) {
......
......@@ -325,7 +325,7 @@ static_library("host") {
public_deps = []
if (enable_configuration_policy) {
if (!is_ios) {
deps += [ "//components/policy:generated" ]
}
......@@ -567,7 +567,7 @@ source_set("unit_tests") {
deps += [ "//remoting/host/win:unit_tests" ]
}
if (enable_configuration_policy) {
if (!is_ios) {
deps += [ "//components/policy/core/browser:test_support" ]
}
}
......@@ -737,7 +737,7 @@ if (enable_me2me_host) {
"//third_party/webrtc/modules/desktop_capture",
]
if (enable_configuration_policy) {
if (!is_ios) {
deps += [ "//components/policy:generated" ]
}
......
......@@ -132,7 +132,7 @@ source_set("win") {
"//ui/events/platform",
]
if (enable_configuration_policy) {
if (!is_ios) {
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