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" ]
}
......
This diff is collapsed.
......@@ -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,91 +77,62 @@ 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",
"//components/proxy_config",
"//google_apis",
"//net",
"//third_party/icu",
]
}
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") {
testonly = true
sources = [
"configuration_policy_pref_store_test.cc",
"configuration_policy_pref_store_test.h",
]
static_library("test_support") {
testonly = true
sources = [
"configuration_policy_pref_store_test.cc",
"configuration_policy_pref_store_test.h",
]
public_deps = [
":browser",
"//base",
public_deps = [
":browser",
"//base",
# Explicitly link in the generated policy target into the test support
# so it will be linked to dependent targets. Otherwise in component
# build, it will be hidden inside the policy component.
"//components/policy:generated",
"//components/policy/core/common:test_support",
]
deps = [
"//testing/gtest",
]
}
# Explicitly link in the generated policy target into the test support
# so it will be linked to dependent targets. Otherwise in component
# build, it will be hidden inside the policy component.
"//components/policy:generated",
"//components/policy/core/common:test_support",
]
deps = [
"//testing/gtest",
]
}
source_set("unit_tests") {
testonly = true
sources = [
"android/android_combined_policy_provider_unittest.cc",
"android/policy_converter_unittest.cc",
"autofill_policy_handler_unittest.cc",
"browser_policy_connector_unittest.cc",
"configuration_policy_handler_unittest.cc",
"configuration_policy_pref_store_unittest.cc",
"proxy_policy_handler_unittest.cc",
"url_blacklist_manager_unittest.cc",
"url_blacklist_policy_handler_unittest.cc",
]
deps = [
":test_support",
"//base",
"//components/autofill/core/common",
"//components/policy:generated",
"//components/prefs:test_support",
"//components/proxy_config",
"//components/url_formatter",
"//google_apis",
"//net",
"//testing/gmock",
"//testing/gtest",
]
}
source_set("unit_tests") {
testonly = true
sources = [
"android/android_combined_policy_provider_unittest.cc",
"android/policy_converter_unittest.cc",
"autofill_policy_handler_unittest.cc",
"browser_policy_connector_unittest.cc",
"configuration_policy_handler_unittest.cc",
"configuration_policy_pref_store_unittest.cc",
"proxy_policy_handler_unittest.cc",
"url_blacklist_manager_unittest.cc",
"url_blacklist_policy_handler_unittest.cc",
]
deps = [
":test_support",
"//base",
"//components/autofill/core/common",
"//components/policy:generated",
"//components/prefs:test_support",
"//components/proxy_config",
"//components/url_formatter",
"//google_apis",
"//net",
"//testing/gmock",
"//testing/gtest",
]
}
This diff is collapsed.
......@@ -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