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" ]
} }
......
This diff is collapsed.
...@@ -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",
] ]
}
} }
This diff is collapsed.
...@@ -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