Add abhijeet.k@samsung.com to AUTHORS list.
[chromium-blink-merge.git] / components / policy / core / common / BUILD.gn
blob27cfe1c57cb4822ed78f95f0469ab94ecebd3fa0
1 # Copyright 2014 The Chromium Authors. All rights reserved.
2 # Use of this source code is governed by a BSD-style license that can be
3 # found in the LICENSE file.
5 import("//build/config/features.gni")
7 source_set("common") {
8   defines = [ "POLICY_COMPONENT_IMPLEMENTATION" ]
10   if (enable_configuration_policy) {
11     sources = [
12       "../../policy_export.h",
13       "async_policy_loader.cc",
14       "async_policy_loader.h",
15       "async_policy_provider.cc",
16       "async_policy_provider.h",
17       "cloud/cloud_external_data_manager.cc",
18       "cloud/cloud_external_data_manager.h",
19       "cloud/cloud_policy_client.cc",
20       "cloud/cloud_policy_client.h",
21       "cloud/cloud_policy_client_registration_helper.cc",
22       "cloud/cloud_policy_client_registration_helper.h",
23       "cloud/cloud_policy_constants.cc",
24       "cloud/cloud_policy_constants.h",
25       "cloud/cloud_policy_core.cc",
26       "cloud/cloud_policy_core.h",
27       "cloud/cloud_policy_manager.cc",
28       "cloud/cloud_policy_manager.h",
29       "cloud/cloud_policy_refresh_scheduler.cc",
30       "cloud/cloud_policy_refresh_scheduler.h",
31       "cloud/cloud_policy_service.cc",
32       "cloud/cloud_policy_service.h",
33       "cloud/cloud_policy_store.cc",
34       "cloud/cloud_policy_store.h",
35       "cloud/cloud_policy_validator.cc",
36       "cloud/cloud_policy_validator.h",
37       "cloud/component_cloud_policy_service.cc",
38       "cloud/component_cloud_policy_service.h",
39       "cloud/component_cloud_policy_store.cc",
40       "cloud/component_cloud_policy_store.h",
41       "cloud/component_cloud_policy_updater.cc",
42       "cloud/component_cloud_policy_updater.h",
43       "cloud/device_management_service.cc",
44       "cloud/device_management_service.h",
45       "cloud/enterprise_metrics.cc",
46       "cloud/enterprise_metrics.h",
47       "cloud/external_policy_data_fetcher.cc",
48       "cloud/external_policy_data_fetcher.h",
49       "cloud/external_policy_data_updater.cc",
50       "cloud/external_policy_data_updater.h",
51       "cloud/policy_header_io_helper.cc",
52       "cloud/policy_header_io_helper.h",
53       "cloud/policy_header_service.cc",
54       "cloud/policy_header_service.h",
55       "cloud/resource_cache.cc",
56       "cloud/resource_cache.h",
57       "cloud/system_policy_request_context.cc",
58       "cloud/system_policy_request_context.h",
59       "cloud/user_cloud_policy_manager.cc",
60       "cloud/user_cloud_policy_manager.h",
61       "cloud/user_cloud_policy_store.cc",
62       "cloud/user_cloud_policy_store.h",
63       "cloud/user_cloud_policy_store_base.cc",
64       "cloud/user_cloud_policy_store_base.h",
65       "cloud/user_info_fetcher.cc",
66       "cloud/user_info_fetcher.h",
67       "cloud/user_policy_request_context.cc",
68       "cloud/user_policy_request_context.h",
69       "config_dir_policy_loader.cc",
70       "config_dir_policy_loader.h",
71       "configuration_policy_provider.cc",
72       "configuration_policy_provider.h",
73       "external_data_fetcher.cc",
74       "external_data_fetcher.h",
75       "external_data_manager.h",
76       "mac_util.cc",
77       "mac_util.h",
78       "policy_bundle.cc",
79       "policy_bundle.h",
80       "policy_details.h",
81       "policy_load_status.cc",
82       "policy_load_status.h",
83       "policy_loader_ios.h",
84       "policy_loader_ios.mm",
85       "policy_loader_mac.h",
86       "policy_loader_mac.mm",
87       "policy_loader_win.cc",
88       "policy_loader_win.h",
89       "policy_map.cc",
90       "policy_map.h",
91       "policy_namespace.cc",
92       "policy_namespace.h",
93       "policy_pref_names.cc",
94       "policy_pref_names.h",
95       "policy_provider_android.cc",
96       "policy_provider_android.h",
97       "policy_provider_android_delegate.h",
98       "policy_service.cc",
99       "policy_service.h",
100       "policy_service_impl.cc",
101       "policy_service_impl.h",
102       "policy_statistics_collector.cc",
103       "policy_statistics_collector.h",
104       "policy_switches.cc",
105       "policy_switches.h",
106       "policy_types.h",
107       "preferences_mac.cc",
108       "preferences_mac.h",
109       "preg_parser_win.cc",
110       "preg_parser_win.h",
111       "registry_dict_win.cc",
112       "registry_dict_win.h",
113       "remote_commands/remote_command_job.cc",
114       "remote_commands/remote_command_job.h",
115       "remote_commands/remote_commands_factory.cc",
116       "remote_commands/remote_commands_factory.h",
117       "remote_commands/remote_commands_queue.cc",
118       "remote_commands/remote_commands_queue.h",
119       "remote_commands/remote_commands_service.cc",
120       "remote_commands/remote_commands_service.h",
121       "schema.cc",
122       "schema.h",
123       "schema_internal.h",
124       "schema_map.cc",
125       "schema_map.h",
126       "schema_registry.cc",
127       "schema_registry.h",
128       "schema_registry_tracking_policy_provider.cc",
129       "schema_registry_tracking_policy_provider.h",
130     ]
132     deps = [
133       "//base:prefs",
134       "//base/third_party/dynamic_annotations",
135       "//components/json_schema",
136       "//components/policy",
137       "//components/policy/proto",
138       "//google_apis",
139       "//net",
140       "//third_party/re2",
141       "//url",
142     ]
144     if (is_win) {
145       libs = [ "netapi32.lib" ]
146     }
147     if (is_android) {
148       sources += [ "cloud/component_cloud_policy_service_stub.cc" ]
149       sources -= [
150         "cloud/component_cloud_policy_service.cc",
151         "cloud/component_cloud_policy_store.cc",
152         "cloud/component_cloud_policy_store.h",
153         "cloud/component_cloud_policy_updater.cc",
154         "cloud/component_cloud_policy_updater.h",
155         "cloud/external_policy_data_fetcher.cc",
156         "cloud/external_policy_data_fetcher.h",
157         "cloud/external_policy_data_updater.cc",
158         "cloud/external_policy_data_updater.h",
159         "cloud/resource_cache.cc",
160         "cloud/resource_cache.h",
161         "config_dir_policy_loader.cc",
162         "config_dir_policy_loader.h",
163         "policy_load_status.cc",
164         "policy_load_status.h",
165       ]
166     }
167     if (is_chromeos) {
168       sources += [
169         "proxy_policy_provider.cc",
170         "proxy_policy_provider.h",
171       ]
172       sources -= [
173         "cloud/cloud_policy_client_registration_helper.cc",
174         "cloud/cloud_policy_client_registration_helper.h",
175         "cloud/user_cloud_policy_manager.cc",
176         "cloud/user_cloud_policy_manager.h",
177         "cloud/user_cloud_policy_store.cc",
178         "cloud/user_cloud_policy_store.h",
179       ]
180     }
181     if (!is_ios && !is_mac) {
182       sources -= [
183         "mac_util.cc",
184         "mac_util.h",
185       ]
186     }
187   } else {
188     # Some of the policy code is always enabled, so that other parts of Chrome
189     # can always interface with the PolicyService without having to #ifdef on
190     # ENABLE_CONFIGURATION_POLICY.
191     sources = [
192       "external_data_fetcher.cc",
193       "external_data_fetcher.h",
194       "external_data_manager.h",
195       "policy_map.cc",
196       "policy_map.h",
197       "policy_namespace.cc",
198       "policy_namespace.h",
199       "policy_pref_names.cc",
200       "policy_pref_names.h",
201       "policy_service.cc",
202       "policy_service.h",
203       "policy_service_stub.cc",
204       "policy_service_stub.h",
205     ]
206     deps = [
207       "//base",
208     ]
209   }