summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjoaodasilva@chromium.org <joaodasilva@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-12-08 21:10:04 +0000
committerjoaodasilva@chromium.org <joaodasilva@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-12-08 21:10:04 +0000
commit76b4b15804dafa5e586738bd7c8ac12fea6ddec2 (patch)
tree4ba2cb5383bb9ef5f610aeffe5d4455149da683b
parent415b2de91f4a96c6779650c2a94e28012c7d61e7 (diff)
downloadchromium_src-76b4b15804dafa5e586738bd7c8ac12fea6ddec2.zip
chromium_src-76b4b15804dafa5e586738bd7c8ac12fea6ddec2.tar.gz
chromium_src-76b4b15804dafa5e586738bd7c8ac12fea6ddec2.tar.bz2
Move policy code into components/policy.
The code moved to component/policy can be included on iOS, but can't depend on chrome/. This move includes an exception for the policy protobufs: - the generic cloud policy protobufs will be moved into a new repository, due to a dependency from a ChromeOS package - the user cloud policy protobuf and its decoding will move into a new component for user policy BUG=271392 TBR=jochen@chromium.org Review URL: https://codereview.chromium.org/109743002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@239399 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r--chrome/browser/android/signin/signin_manager_android.cc4
-rw-r--r--chrome/browser/automation/testing_automation_provider.cc2
-rw-r--r--chrome/browser/browser_process_impl.cc4
-rw-r--r--chrome/browser/chromeos/attestation/attestation_policy_observer.cc6
-rw-r--r--chrome/browser/chromeos/attestation/attestation_policy_observer_unittest.cc2
-rw-r--r--chrome/browser/chromeos/extensions/device_local_account_external_policy_loader.h2
-rw-r--r--chrome/browser/chromeos/extensions/device_local_account_external_policy_loader_unittest.cc2
-rw-r--r--chrome/browser/chromeos/kiosk_mode/kiosk_mode_settings.cc2
-rw-r--r--chrome/browser/chromeos/login/enrollment/enrollment_screen.cc2
-rw-r--r--chrome/browser/chromeos/login/enrollment/enrollment_screen.h2
-rw-r--r--chrome/browser/chromeos/login/existing_user_controller.cc4
-rw-r--r--chrome/browser/chromeos/login/existing_user_controller_browsertest.cc10
-rw-r--r--chrome/browser/chromeos/login/kiosk_browsertest.cc2
-rw-r--r--chrome/browser/chromeos/login/login_utils_browsertest.cc4
-rw-r--r--chrome/browser/chromeos/login/screens/user_image_screen.cc2
-rw-r--r--chrome/browser/chromeos/login/user_image_manager_browsertest.cc6
-rw-r--r--chrome/browser/chromeos/login/version_info_updater.h2
-rw-r--r--chrome/browser/chromeos/policy/auto_enrollment_client.cc4
-rw-r--r--chrome/browser/chromeos/policy/auto_enrollment_client.h2
-rw-r--r--chrome/browser/chromeos/policy/auto_enrollment_client_unittest.cc2
-rw-r--r--chrome/browser/chromeos/policy/cloud_external_data_manager_base.cc6
-rw-r--r--chrome/browser/chromeos/policy/cloud_external_data_manager_base.h2
-rw-r--r--chrome/browser/chromeos/policy/cloud_external_data_manager_base_test_util.cc6
-rw-r--r--chrome/browser/chromeos/policy/cloud_external_data_manager_base_unittest.cc6
-rw-r--r--chrome/browser/chromeos/policy/cloud_external_data_policy_observer.cc6
-rw-r--r--chrome/browser/chromeos/policy/cloud_external_data_policy_observer_unittest.cc12
-rw-r--r--chrome/browser/chromeos/policy/cloud_external_data_store.cc2
-rw-r--r--chrome/browser/chromeos/policy/cloud_external_data_store.h2
-rw-r--r--chrome/browser/chromeos/policy/cloud_external_data_store_unittest.cc2
-rw-r--r--chrome/browser/chromeos/policy/configuration_policy_handler_chromeos.h2
-rw-r--r--chrome/browser/chromeos/policy/device_cloud_policy_manager_chromeos.cc8
-rw-r--r--chrome/browser/chromeos/policy/device_cloud_policy_manager_chromeos.h6
-rw-r--r--chrome/browser/chromeos/policy/device_cloud_policy_manager_chromeos_unittest.cc4
-rw-r--r--chrome/browser/chromeos/policy/device_cloud_policy_store_chromeos.h2
-rw-r--r--chrome/browser/chromeos/policy/device_cloud_policy_validator.h2
-rw-r--r--chrome/browser/chromeos/policy/device_local_account_browsertest.cc10
-rw-r--r--chrome/browser/chromeos/policy/device_local_account_external_data_manager.cc2
-rw-r--r--chrome/browser/chromeos/policy/device_local_account_external_data_service.cc2
-rw-r--r--chrome/browser/chromeos/policy/device_local_account_external_data_service.h2
-rw-r--r--chrome/browser/chromeos/policy/device_local_account_policy_provider.cc4
-rw-r--r--chrome/browser/chromeos/policy/device_local_account_policy_service.cc10
-rw-r--r--chrome/browser/chromeos/policy/device_local_account_policy_service.h4
-rw-r--r--chrome/browser/chromeos/policy/device_local_account_policy_service_unittest.cc10
-rw-r--r--chrome/browser/chromeos/policy/device_local_account_policy_store.cc2
-rw-r--r--chrome/browser/chromeos/policy/device_local_account_policy_store.h2
-rw-r--r--chrome/browser/chromeos/policy/device_policy_builder.cc2
-rw-r--r--chrome/browser/chromeos/policy/device_policy_builder.h2
-rw-r--r--chrome/browser/chromeos/policy/device_status_collector.cc2
-rw-r--r--chrome/browser/chromeos/policy/device_status_collector.h2
-rw-r--r--chrome/browser/chromeos/policy/enrollment_handler_chromeos.cc2
-rw-r--r--chrome/browser/chromeos/policy/enrollment_handler_chromeos.h4
-rw-r--r--chrome/browser/chromeos/policy/enrollment_status_chromeos.h6
-rw-r--r--chrome/browser/chromeos/policy/enterprise_install_attributes.h2
-rw-r--r--chrome/browser/chromeos/policy/login_profile_policy_provider.h2
-rw-r--r--chrome/browser/chromeos/policy/login_screen_power_management_policy.cc2
-rw-r--r--chrome/browser/chromeos/policy/network_configuration_updater.h2
-rw-r--r--chrome/browser/chromeos/policy/network_configuration_updater_unittest.cc2
-rw-r--r--chrome/browser/chromeos/policy/power_policy_browsertest.cc10
-rw-r--r--chrome/browser/chromeos/policy/stub_enterprise_install_attributes.cc2
-rw-r--r--chrome/browser/chromeos/policy/stub_enterprise_install_attributes.h2
-rw-r--r--chrome/browser/chromeos/policy/user_cloud_external_data_manager.cc4
-rw-r--r--chrome/browser/chromeos/policy/user_cloud_external_data_manager_browsertest.cc4
-rw-r--r--chrome/browser/chromeos/policy/user_cloud_policy_manager_chromeos.cc8
-rw-r--r--chrome/browser/chromeos/policy/user_cloud_policy_manager_chromeos.h8
-rw-r--r--chrome/browser/chromeos/policy/user_cloud_policy_manager_chromeos_unittest.cc8
-rw-r--r--chrome/browser/chromeos/policy/user_cloud_policy_manager_factory_chromeos.cc4
-rw-r--r--chrome/browser/chromeos/policy/user_cloud_policy_store_chromeos.h2
-rw-r--r--chrome/browser/chromeos/policy/user_cloud_policy_store_chromeos_unittest.cc6
-rw-r--r--chrome/browser/chromeos/policy/user_cloud_policy_token_forwarder.cc2
-rw-r--r--chrome/browser/chromeos/policy/user_cloud_policy_token_forwarder.h2
-rw-r--r--chrome/browser/chromeos/policy/user_network_configuration_updater_factory.cc2
-rw-r--r--chrome/browser/chromeos/policy/user_policy_disk_cache.cc2
-rw-r--r--chrome/browser/chromeos/policy/user_policy_token_loader.cc2
-rw-r--r--chrome/browser/chromeos/proxy_config_service_impl.cc2
-rw-r--r--chrome/browser/chromeos/settings/cros_settings_unittest.cc2
-rw-r--r--chrome/browser/chromeos/settings/device_settings_provider.cc2
-rw-r--r--chrome/browser/chromeos/settings/device_settings_service.h2
-rw-r--r--chrome/browser/chromeos/settings/session_manager_operation.cc2
-rw-r--r--chrome/browser/chromeos/settings/session_manager_operation_unittest.cc6
-rw-r--r--chrome/browser/chromeos/system/ash_system_tray_delegate.cc2
-rw-r--r--chrome/browser/download/download_dir_policy_handler.h2
-rw-r--r--chrome/browser/download/download_dir_policy_handler_unittest.cc4
-rw-r--r--chrome/browser/extensions/api/enterprise_platform_keys_private/enterprise_platform_keys_private_api_unittest.cc2
-rw-r--r--chrome/browser/extensions/api/storage/managed_value_store_cache.h2
-rw-r--r--chrome/browser/extensions/policy_handlers.h2
-rw-r--r--chrome/browser/io_thread.cc2
-rw-r--r--chrome/browser/net/disk_cache_dir_policy_handler.h2
-rw-r--r--chrome/browser/net/proxy_policy_handler.cc2
-rw-r--r--chrome/browser/net/proxy_policy_handler.h2
-rw-r--r--chrome/browser/net/proxy_policy_handler_unittest.cc6
-rw-r--r--chrome/browser/policy/DEPS60
-rw-r--r--chrome/browser/policy/autofill_policy_handler.h2
-rw-r--r--chrome/browser/policy/browser_policy_connector.cc18
-rw-r--r--chrome/browser/policy/browser_policy_connector.h4
-rw-r--r--chrome/browser/policy/cloud/DEPS29
-rw-r--r--chrome/browser/policy/cloud/cloud_policy_browsertest.cc10
-rw-r--r--chrome/browser/policy/cloud/cloud_policy_invalidator.cc6
-rw-r--r--chrome/browser/policy/cloud/cloud_policy_invalidator.h4
-rw-r--r--chrome/browser/policy/cloud/cloud_policy_invalidator_unittest.cc12
-rw-r--r--chrome/browser/policy/cloud/cloud_policy_manager_browsertest.cc6
-rw-r--r--chrome/browser/policy/cloud/component_cloud_policy_browsertest.cc8
-rw-r--r--chrome/browser/policy/cloud/device_management_service_browsertest.cc6
-rw-r--r--chrome/browser/policy/cloud/message_util.h30
-rw-r--r--chrome/browser/policy/cloud/user_cloud_policy_invalidator.cc2
-rw-r--r--chrome/browser/policy/cloud/user_cloud_policy_manager.cc6
-rw-r--r--chrome/browser/policy/cloud/user_cloud_policy_manager.h2
-rw-r--r--chrome/browser/policy/cloud/user_cloud_policy_manager_factory.cc2
-rw-r--r--chrome/browser/policy/cloud/user_cloud_policy_manager_unittest.cc2
-rw-r--r--chrome/browser/policy/cloud/user_cloud_policy_store_base.cc4
-rw-r--r--chrome/browser/policy/cloud/user_cloud_policy_store_base.h4
-rw-r--r--chrome/browser/policy/cloud/user_cloud_policy_store_unittest.cc6
-rw-r--r--chrome/browser/policy/cloud/user_policy_signin_service.cc2
-rw-r--r--chrome/browser/policy/cloud/user_policy_signin_service_android.cc2
-rw-r--r--chrome/browser/policy/cloud/user_policy_signin_service_base.cc6
-rw-r--r--chrome/browser/policy/cloud/user_policy_signin_service_base.h4
-rw-r--r--chrome/browser/policy/cloud/user_policy_signin_service_unittest.cc6
-rw-r--r--chrome/browser/policy/configuration_policy_handler_android.h2
-rw-r--r--chrome/browser/policy/configuration_policy_handler_list_factory.cc4
-rw-r--r--chrome/browser/policy/configuration_policy_handler_unittest.cc7
-rw-r--r--chrome/browser/policy/configuration_policy_pref_store_test.cc46
-rw-r--r--chrome/browser/policy/configuration_policy_pref_store_test.h (renamed from chrome/browser/policy/configuration_policy_pref_store_unittest.h)11
-rw-r--r--chrome/browser/policy/configuration_policy_pref_store_unittest.cc56
-rw-r--r--chrome/browser/policy/file_selection_dialogs_policy_handler.h2
-rw-r--r--chrome/browser/policy/javascript_policy_handler.h2
-rw-r--r--chrome/browser/policy/javascript_policy_handler_unittest.cc4
-rw-r--r--chrome/browser/policy/policy_browsertest.cc4
-rw-r--r--chrome/browser/policy/profile_policy_connector.cc4
-rw-r--r--chrome/browser/policy/profile_policy_connector_stub.cc2
-rw-r--r--chrome/browser/policy/test/local_policy_test_server.cc2
-rw-r--r--chrome/browser/policy/url_blacklist_policy_handler.h2
-rw-r--r--chrome/browser/prefs/browser_prefs.cc2
-rw-r--r--chrome/browser/prefs/chrome_pref_service_factory.cc2
-rw-r--r--chrome/browser/prefs/chrome_pref_service_unittest.cc2
-rw-r--r--chrome/browser/prefs/pref_service_syncable_factory.cc4
-rw-r--r--chrome/browser/prefs/proxy_policy_unittest.cc2
-rw-r--r--chrome/browser/profiles/incognito_mode_policy_handler.h2
-rw-r--r--chrome/browser/profiles/incognito_mode_policy_handler_unittest.cc4
-rw-r--r--chrome/browser/search_engines/default_search_policy_handler.h2
-rw-r--r--chrome/browser/search_engines/default_search_policy_handler_unittest.cc4
-rw-r--r--chrome/browser/sessions/restore_on_startup_policy_handler.h2
-rw-r--r--chrome/browser/sessions/restore_on_startup_policy_handler_unittest.cc2
-rw-r--r--chrome/browser/sync/sync_policy_handler.h2
-rw-r--r--chrome/browser/ui/webui/chromeos/login/enrollment_screen_handler.cc2
-rw-r--r--chrome/browser/ui/webui/options/browser_options_handler.cc2
-rw-r--r--chrome/browser/ui/webui/policy_ui.cc18
-rw-r--r--chrome/chrome_browser.gypi110
-rw-r--r--chrome/chrome_browser_chromeos.gypi2
-rw-r--r--chrome/chrome_tests.gypi2
-rw-r--r--chrome/chrome_tests_unit.gypi46
-rw-r--r--chrome/test/base/testing_browser_process.cc2
-rw-r--r--chrome/test/base/testing_profile.cc6
-rwxr-xr-xchrome/tools/build/generate_policy_source.py2
-rw-r--r--components/components_tests.gyp29
-rw-r--r--components/policy.gypi149
-rw-r--r--components/policy/core/DEPS9
-rw-r--r--components/policy/core/browser/DEPS2
-rw-r--r--components/policy/core/browser/cloud/message_util.cc (renamed from chrome/browser/policy/cloud/message_util.cc)2
-rw-r--r--components/policy/core/browser/cloud/message_util.h33
-rw-r--r--components/policy/core/browser/configuration_policy_handler.cc (renamed from chrome/browser/policy/configuration_policy_handler.cc)4
-rw-r--r--components/policy/core/browser/configuration_policy_handler.h (renamed from chrome/browser/policy/configuration_policy_handler.h)29
-rw-r--r--components/policy/core/browser/configuration_policy_handler_list.cc (renamed from chrome/browser/policy/configuration_policy_handler_list.cc)4
-rw-r--r--components/policy/core/browser/configuration_policy_handler_list.h (renamed from chrome/browser/policy/configuration_policy_handler_list.h)9
-rw-r--r--components/policy/core/browser/configuration_policy_pref_store.cc (renamed from chrome/browser/policy/configuration_policy_pref_store.cc)4
-rw-r--r--components/policy/core/browser/configuration_policy_pref_store.h (renamed from chrome/browser/policy/configuration_policy_pref_store.h)11
-rw-r--r--components/policy/core/common/DEPS3
-rw-r--r--components/policy/core/common/cloud/cloud_external_data_manager.cc (renamed from chrome/browser/policy/cloud/cloud_external_data_manager.cc)4
-rw-r--r--components/policy/core/common/cloud/cloud_external_data_manager.h (renamed from chrome/browser/policy/cloud/cloud_external_data_manager.h)11
-rw-r--r--components/policy/core/common/cloud/cloud_policy_client.cc (renamed from chrome/browser/policy/cloud/cloud_policy_client.cc)4
-rw-r--r--components/policy/core/common/cloud/cloud_policy_client.h (renamed from chrome/browser/policy/cloud/cloud_policy_client.h)15
-rw-r--r--components/policy/core/common/cloud/cloud_policy_client_registration_helper.cc (renamed from chrome/browser/policy/cloud/cloud_policy_client_registration_helper.cc)2
-rw-r--r--components/policy/core/common/cloud/cloud_policy_client_registration_helper.h (renamed from chrome/browser/policy/cloud/cloud_policy_client_registration_helper.h)16
-rw-r--r--components/policy/core/common/cloud/cloud_policy_client_unittest.cc (renamed from chrome/browser/policy/cloud/cloud_policy_client_unittest.cc)6
-rw-r--r--components/policy/core/common/cloud/cloud_policy_constants.cc (renamed from chrome/browser/policy/cloud/cloud_policy_constants.cc)2
-rw-r--r--components/policy/core/common/cloud/cloud_policy_constants.h (renamed from chrome/browser/policy/cloud/cloud_policy_constants.h)54
-rw-r--r--components/policy/core/common/cloud/cloud_policy_core.cc (renamed from chrome/browser/policy/cloud/cloud_policy_core.cc)10
-rw-r--r--components/policy/core/common/cloud/cloud_policy_core.h (renamed from chrome/browser/policy/cloud/cloud_policy_core.h)13
-rw-r--r--components/policy/core/common/cloud/cloud_policy_core_unittest.cc (renamed from chrome/browser/policy/cloud/cloud_policy_core_unittest.cc)10
-rw-r--r--components/policy/core/common/cloud/cloud_policy_manager.cc (renamed from chrome/browser/policy/cloud/cloud_policy_manager.cc)6
-rw-r--r--components/policy/core/common/cloud/cloud_policy_manager.h (renamed from chrome/browser/policy/cloud/cloud_policy_manager.h)22
-rw-r--r--components/policy/core/common/cloud/cloud_policy_manager_unittest.cc (renamed from chrome/browser/policy/cloud/cloud_policy_manager_unittest.cc)10
-rw-r--r--components/policy/core/common/cloud/cloud_policy_refresh_scheduler.cc (renamed from chrome/browser/policy/cloud/cloud_policy_refresh_scheduler.cc)4
-rw-r--r--components/policy/core/common/cloud/cloud_policy_refresh_scheduler.h (renamed from chrome/browser/policy/cloud/cloud_policy_refresh_scheduler.h)15
-rw-r--r--components/policy/core/common/cloud/cloud_policy_refresh_scheduler_unittest.cc (renamed from chrome/browser/policy/cloud/cloud_policy_refresh_scheduler_unittest.cc)9
-rw-r--r--components/policy/core/common/cloud/cloud_policy_service.cc (renamed from chrome/browser/policy/cloud/cloud_policy_service.cc)2
-rw-r--r--components/policy/core/common/cloud/cloud_policy_service.h (renamed from chrome/browser/policy/cloud/cloud_policy_service.h)19
-rw-r--r--components/policy/core/common/cloud/cloud_policy_service_unittest.cc (renamed from chrome/browser/policy/cloud/cloud_policy_service_unittest.cc)8
-rw-r--r--components/policy/core/common/cloud/cloud_policy_store.cc (renamed from chrome/browser/policy/cloud/cloud_policy_store.cc)4
-rw-r--r--components/policy/core/common/cloud/cloud_policy_store.h (renamed from chrome/browser/policy/cloud/cloud_policy_store.h)13
-rw-r--r--components/policy/core/common/cloud/cloud_policy_validator.cc (renamed from chrome/browser/policy/cloud/cloud_policy_validator.cc)4
-rw-r--r--components/policy/core/common/cloud/cloud_policy_validator.h (renamed from chrome/browser/policy/cloud/cloud_policy_validator.h)11
-rw-r--r--components/policy/core/common/cloud/cloud_policy_validator_unittest.cc (renamed from chrome/browser/policy/cloud/cloud_policy_validator_unittest.cc)6
-rw-r--r--components/policy/core/common/cloud/component_cloud_policy_service.cc (renamed from chrome/browser/policy/cloud/component_cloud_policy_service.cc)14
-rw-r--r--components/policy/core/common/cloud/component_cloud_policy_service.h (renamed from chrome/browser/policy/cloud/component_cloud_policy_service.h)26
-rw-r--r--components/policy/core/common/cloud/component_cloud_policy_service_stub.cc (renamed from chrome/browser/policy/cloud/component_cloud_policy_service_stub.cc)2
-rw-r--r--components/policy/core/common/cloud/component_cloud_policy_service_unittest.cc (renamed from chrome/browser/policy/cloud/component_cloud_policy_service_unittest.cc)12
-rw-r--r--components/policy/core/common/cloud/component_cloud_policy_store.cc (renamed from chrome/browser/policy/cloud/component_cloud_policy_store.cc)6
-rw-r--r--components/policy/core/common/cloud/component_cloud_policy_store.h (renamed from chrome/browser/policy/cloud/component_cloud_policy_store.h)13
-rw-r--r--components/policy/core/common/cloud/component_cloud_policy_store_unittest.cc (renamed from chrome/browser/policy/cloud/component_cloud_policy_store_unittest.cc)8
-rw-r--r--components/policy/core/common/cloud/component_cloud_policy_updater.cc (renamed from chrome/browser/policy/cloud/component_cloud_policy_updater.cc)6
-rw-r--r--components/policy/core/common/cloud/component_cloud_policy_updater.h (renamed from chrome/browser/policy/cloud/component_cloud_policy_updater.h)11
-rw-r--r--components/policy/core/common/cloud/component_cloud_policy_updater_unittest.cc (renamed from chrome/browser/policy/cloud/component_cloud_policy_updater_unittest.cc)12
-rw-r--r--components/policy/core/common/cloud/device_management_service.cc (renamed from chrome/browser/policy/cloud/device_management_service.cc)2
-rw-r--r--components/policy/core/common/cloud/device_management_service.h (renamed from chrome/browser/policy/cloud/device_management_service.h)15
-rw-r--r--components/policy/core/common/cloud/device_management_service_unittest.cc (renamed from chrome/browser/policy/cloud/device_management_service_unittest.cc)6
-rw-r--r--components/policy/core/common/cloud/enterprise_metrics.cc (renamed from chrome/browser/policy/cloud/enterprise_metrics.cc)2
-rw-r--r--components/policy/core/common/cloud/enterprise_metrics.h (renamed from chrome/browser/policy/cloud/enterprise_metrics.h)18
-rw-r--r--components/policy/core/common/cloud/external_policy_data_fetcher.cc (renamed from chrome/browser/policy/cloud/external_policy_data_fetcher.cc)2
-rw-r--r--components/policy/core/common/cloud/external_policy_data_fetcher.h (renamed from chrome/browser/policy/cloud/external_policy_data_fetcher.h)12
-rw-r--r--components/policy/core/common/cloud/external_policy_data_fetcher_unittest.cc (renamed from chrome/browser/policy/cloud/external_policy_data_fetcher_unittest.cc)2
-rw-r--r--components/policy/core/common/cloud/external_policy_data_updater.cc (renamed from chrome/browser/policy/cloud/external_policy_data_updater.cc)4
-rw-r--r--components/policy/core/common/cloud/external_policy_data_updater.h (renamed from chrome/browser/policy/cloud/external_policy_data_updater.h)11
-rw-r--r--components/policy/core/common/cloud/external_policy_data_updater_unittest.cc (renamed from chrome/browser/policy/cloud/external_policy_data_updater_unittest.cc)4
-rw-r--r--components/policy/core/common/cloud/mock_cloud_external_data_manager.cc (renamed from chrome/browser/policy/cloud/mock_cloud_external_data_manager.cc)2
-rw-r--r--components/policy/core/common/cloud/mock_cloud_external_data_manager.h (renamed from chrome/browser/policy/cloud/mock_cloud_external_data_manager.h)8
-rw-r--r--components/policy/core/common/cloud/mock_cloud_policy_client.cc (renamed from chrome/browser/policy/cloud/mock_cloud_policy_client.cc)2
-rw-r--r--components/policy/core/common/cloud/mock_cloud_policy_client.h (renamed from chrome/browser/policy/cloud/mock_cloud_policy_client.h)10
-rw-r--r--components/policy/core/common/cloud/mock_cloud_policy_store.cc (renamed from chrome/browser/policy/cloud/mock_cloud_policy_store.cc)2
-rw-r--r--components/policy/core/common/cloud/mock_cloud_policy_store.h (renamed from chrome/browser/policy/cloud/mock_cloud_policy_store.h)8
-rw-r--r--components/policy/core/common/cloud/mock_device_management_service.cc (renamed from chrome/browser/policy/cloud/mock_device_management_service.cc)2
-rw-r--r--components/policy/core/common/cloud/mock_device_management_service.h (renamed from chrome/browser/policy/cloud/mock_device_management_service.h)8
-rw-r--r--components/policy/core/common/cloud/policy_builder.cc (renamed from chrome/browser/policy/cloud/policy_builder.cc)4
-rw-r--r--components/policy/core/common/cloud/policy_builder.h (renamed from chrome/browser/policy/cloud/policy_builder.h)6
-rw-r--r--components/policy/core/common/cloud/rate_limiter.cc (renamed from chrome/browser/policy/cloud/rate_limiter.cc)2
-rw-r--r--components/policy/core/common/cloud/rate_limiter.h (renamed from chrome/browser/policy/cloud/rate_limiter.h)9
-rw-r--r--components/policy/core/common/cloud/rate_limiter_unittest.cc (renamed from chrome/browser/policy/cloud/rate_limiter_unittest.cc)2
-rw-r--r--components/policy/core/common/cloud/resource_cache.cc (renamed from chrome/browser/policy/cloud/resource_cache.cc)2
-rw-r--r--components/policy/core/common/cloud/resource_cache.h (renamed from chrome/browser/policy/cloud/resource_cache.h)9
-rw-r--r--components/policy/core/common/cloud/resource_cache_unittest.cc (renamed from chrome/browser/policy/cloud/resource_cache_unittest.cc)2
-rw-r--r--components/policy/core/common/cloud/system_policy_request_context.cc (renamed from chrome/browser/policy/cloud/system_policy_request_context.cc)2
-rw-r--r--components/policy/core/common/cloud/system_policy_request_context.h (renamed from chrome/browser/policy/cloud/system_policy_request_context.h)9
-rw-r--r--components/policy/core/common/cloud/user_info_fetcher.cc (renamed from chrome/browser/policy/cloud/user_info_fetcher.cc)2
-rw-r--r--components/policy/core/common/cloud/user_info_fetcher.h (renamed from chrome/browser/policy/cloud/user_info_fetcher.h)11
-rw-r--r--components/policy/core/common/cloud/user_info_fetcher_unittest.cc (renamed from chrome/browser/policy/cloud/user_info_fetcher_unittest.cc)2
-rw-r--r--components/policy/core/common/cloud/user_policy_request_context.cc (renamed from chrome/browser/policy/cloud/user_policy_request_context.cc)2
-rw-r--r--components/policy/core/common/cloud/user_policy_request_context.h (renamed from chrome/browser/policy/cloud/user_policy_request_context.h)9
-rw-r--r--components/policy/core/common/config_dir_policy_loader.cc (renamed from chrome/browser/policy/config_dir_policy_loader.cc)4
-rw-r--r--components/policy/core/common/config_dir_policy_loader.h (renamed from chrome/browser/policy/config_dir_policy_loader.h)9
-rw-r--r--components/policy/core/common/config_dir_policy_loader_unittest.cc (renamed from chrome/browser/policy/config_dir_policy_loader_unittest.cc)2
-rw-r--r--components/policy/core/common/mock_policy_service.cc (renamed from chrome/browser/policy/mock_policy_service.cc)2
-rw-r--r--components/policy/core/common/mock_policy_service.h (renamed from chrome/browser/policy/mock_policy_service.h)8
-rw-r--r--components/policy/core/common/policy_load_status.cc (renamed from chrome/browser/policy/policy_load_status.cc)2
-rw-r--r--components/policy/core/common/policy_load_status.h (renamed from chrome/browser/policy/policy_load_status.h)9
-rw-r--r--components/policy/core/common/policy_loader_mac.cc (renamed from chrome/browser/policy/policy_loader_mac.cc)4
-rw-r--r--components/policy/core/common/policy_loader_mac.h (renamed from chrome/browser/policy/policy_loader_mac.h)9
-rw-r--r--components/policy/core/common/policy_loader_mac_unittest.cc (renamed from chrome/browser/policy/policy_loader_mac_unittest.cc)2
-rw-r--r--components/policy/core/common/policy_loader_win.cc (renamed from chrome/browser/policy/policy_loader_win.cc)6
-rw-r--r--components/policy/core/common/policy_loader_win.h (renamed from chrome/browser/policy/policy_loader_win.h)14
-rw-r--r--components/policy/core/common/policy_loader_win_unittest.cc (renamed from chrome/browser/policy/policy_loader_win_unittest.cc)4
-rw-r--r--components/policy/core/common/policy_service.cc (renamed from chrome/browser/policy/policy_service.cc)2
-rw-r--r--components/policy/core/common/policy_service.h (renamed from chrome/browser/policy/policy_service.h)13
-rw-r--r--components/policy/core/common/policy_service_impl.cc (renamed from chrome/browser/policy/policy_service_impl.cc)2
-rw-r--r--components/policy/core/common/policy_service_impl.h (renamed from chrome/browser/policy/policy_service_impl.h)14
-rw-r--r--components/policy/core/common/policy_service_impl_unittest.cc (renamed from chrome/browser/policy/policy_service_impl_unittest.cc)4
-rw-r--r--components/policy/core/common/policy_service_stub.cc (renamed from chrome/browser/policy/policy_service_stub.cc)2
-rw-r--r--components/policy/core/common/policy_service_stub.h (renamed from chrome/browser/policy/policy_service_stub.h)11
-rw-r--r--components/policy/core/common/policy_statistics_collector.cc (renamed from chrome/browser/policy/policy_statistics_collector.cc)4
-rw-r--r--components/policy/core/common/policy_statistics_collector.h (renamed from chrome/browser/policy/policy_statistics_collector.h)9
-rw-r--r--components/policy/core/common/policy_statistics_collector_unittest.cc (renamed from chrome/browser/policy/policy_statistics_collector_unittest.cc)6
-rw-r--r--components/policy/core/common/policy_test_utils.cc (renamed from chrome/browser/policy/test/policy_test_utils.cc)2
-rw-r--r--components/policy/core/common/policy_test_utils.h (renamed from chrome/browser/policy/test/policy_test_utils.h)10
-rw-r--r--components/policy/core/common/preg_parser_win.cc (renamed from chrome/browser/policy/preg_parser_win.cc)4
-rw-r--r--components/policy/core/common/preg_parser_win.h (renamed from chrome/browser/policy/preg_parser_win.h)17
-rw-r--r--components/policy/core/common/preg_parser_win_unittest.cc (renamed from chrome/browser/policy/preg_parser_win_unittest.cc)4
-rw-r--r--components/policy/core/common/schema_registry.h1
264 files changed, 1006 insertions, 982 deletions
diff --git a/chrome/browser/android/signin/signin_manager_android.cc b/chrome/browser/android/signin/signin_manager_android.cc
index 295900d..3c9fa44 100644
--- a/chrome/browser/android/signin/signin_manager_android.cc
+++ b/chrome/browser/android/signin/signin_manager_android.cc
@@ -29,12 +29,12 @@
#if defined(ENABLE_CONFIGURATION_POLICY)
#include "chrome/browser/policy/browser_policy_connector.h"
-#include "chrome/browser/policy/cloud/cloud_policy_core.h"
-#include "chrome/browser/policy/cloud/cloud_policy_store.h"
#include "chrome/browser/policy/cloud/user_cloud_policy_manager.h"
#include "chrome/browser/policy/cloud/user_cloud_policy_manager_factory.h"
#include "chrome/browser/policy/cloud/user_policy_signin_service_android.h"
#include "chrome/browser/policy/cloud/user_policy_signin_service_factory.h"
+#include "components/policy/core/common/cloud/cloud_policy_core.h"
+#include "components/policy/core/common/cloud/cloud_policy_store.h"
#include "google_apis/gaia/gaia_auth_util.h"
#endif
diff --git a/chrome/browser/automation/testing_automation_provider.cc b/chrome/browser/automation/testing_automation_provider.cc
index 1c4a35f..527dd71 100644
--- a/chrome/browser/automation/testing_automation_provider.cc
+++ b/chrome/browser/automation/testing_automation_provider.cc
@@ -152,7 +152,7 @@
#include "ui/events/keycodes/keyboard_codes.h"
#if defined(ENABLE_CONFIGURATION_POLICY)
-#include "chrome/browser/policy/policy_service.h"
+#include "components/policy/core/common/policy_service.h"
#endif
#if defined(OS_CHROMEOS)
diff --git a/chrome/browser/browser_process_impl.cc b/chrome/browser/browser_process_impl.cc
index 09e20ef..74597c3 100644
--- a/chrome/browser/browser_process_impl.cc
+++ b/chrome/browser/browser_process_impl.cc
@@ -53,7 +53,6 @@
#include "chrome/browser/notifications/notification_ui_manager.h"
#include "chrome/browser/plugins/chrome_plugin_service_filter.h"
#include "chrome/browser/plugins/plugin_finder.h"
-#include "chrome/browser/policy/policy_service.h"
#include "chrome/browser/prefs/browser_prefs.h"
#include "chrome/browser/prefs/chrome_pref_service_factory.h"
#include "chrome/browser/prerender/prerender_tracker.h"
@@ -79,6 +78,7 @@
#include "chrome/common/switch_utils.h"
#include "chrome/common/url_constants.h"
#include "chrome/installer/util/google_update_constants.h"
+#include "components/policy/core/common/policy_service.h"
#include "content/public/browser/browser_thread.h"
#include "content/public/browser/child_process_security_policy.h"
#include "content/public/browser/notification_details.h"
@@ -94,7 +94,7 @@
#if defined(ENABLE_CONFIGURATION_POLICY)
#include "chrome/browser/policy/browser_policy_connector.h"
#else
-#include "chrome/browser/policy/policy_service_stub.h"
+#include "components/policy/core/common/policy_service_stub.h"
#endif // defined(ENABLE_CONFIGURATION_POLICY)
#if defined(OS_WIN)
diff --git a/chrome/browser/chromeos/attestation/attestation_policy_observer.cc b/chrome/browser/chromeos/attestation/attestation_policy_observer.cc
index 9aab264..ee8d5de 100644
--- a/chrome/browser/chromeos/attestation/attestation_policy_observer.cc
+++ b/chrome/browser/chromeos/attestation/attestation_policy_observer.cc
@@ -14,13 +14,13 @@
#include "chrome/browser/chromeos/attestation/attestation_ca_client.h"
#include "chrome/browser/chromeos/attestation/attestation_key_payload.pb.h"
#include "chrome/browser/chromeos/settings/cros_settings.h"
-#include "chrome/browser/policy/cloud/cloud_policy_client.h"
-#include "chrome/browser/policy/cloud/cloud_policy_manager.h"
#include "chromeos/attestation/attestation_flow.h"
#include "chromeos/cryptohome/async_method_caller.h"
#include "chromeos/dbus/cryptohome_client.h"
#include "chromeos/dbus/dbus_method_call_status.h"
#include "chromeos/dbus/dbus_thread_manager.h"
+#include "components/policy/core/common/cloud/cloud_policy_client.h"
+#include "components/policy/core/common/cloud/cloud_policy_manager.h"
#include "content/public/browser/browser_thread.h"
#include "content/public/browser/notification_details.h"
#include "net/cert/x509_certificate.h"
@@ -269,7 +269,7 @@ void AttestationPolicyObserver::GetKeyPayload(
void AttestationPolicyObserver::OnUploadComplete(bool status) {
if (!status)
return;
- LOG(INFO) << "Enterprise Machine Certificate uploaded to DMServer.";
+ VLOG(1) << "Enterprise Machine Certificate uploaded to DMServer.";
GetKeyPayload(base::Bind(&AttestationPolicyObserver::MarkAsUploaded,
weak_factory_.GetWeakPtr()));
}
diff --git a/chrome/browser/chromeos/attestation/attestation_policy_observer_unittest.cc b/chrome/browser/chromeos/attestation/attestation_policy_observer_unittest.cc
index 3e06b1a..1268d10 100644
--- a/chrome/browser/chromeos/attestation/attestation_policy_observer_unittest.cc
+++ b/chrome/browser/chromeos/attestation/attestation_policy_observer_unittest.cc
@@ -12,10 +12,10 @@
#include "chrome/browser/chromeos/settings/cros_settings.h"
#include "chrome/browser/chromeos/settings/device_settings_service.h"
#include "chrome/browser/chromeos/settings/stub_cros_settings_provider.h"
-#include "chrome/browser/policy/cloud/mock_cloud_policy_client.h"
#include "chromeos/attestation/mock_attestation_flow.h"
#include "chromeos/dbus/mock_cryptohome_client.h"
#include "chromeos/settings/cros_settings_names.h"
+#include "components/policy/core/common/cloud/mock_cloud_policy_client.h"
#include "content/public/test/test_browser_thread.h"
#include "crypto/rsa_private_key.h"
#include "net/cert/x509_certificate.h"
diff --git a/chrome/browser/chromeos/extensions/device_local_account_external_policy_loader.h b/chrome/browser/chromeos/extensions/device_local_account_external_policy_loader.h
index c9abf5d..6b5f71a 100644
--- a/chrome/browser/chromeos/extensions/device_local_account_external_policy_loader.h
+++ b/chrome/browser/chromeos/extensions/device_local_account_external_policy_loader.h
@@ -14,7 +14,7 @@
#include "base/sequenced_task_runner.h"
#include "chrome/browser/chromeos/extensions/external_cache.h"
#include "chrome/browser/extensions/external_loader.h"
-#include "chrome/browser/policy/cloud/cloud_policy_store.h"
+#include "components/policy/core/common/cloud/cloud_policy_store.h"
namespace chromeos {
diff --git a/chrome/browser/chromeos/extensions/device_local_account_external_policy_loader_unittest.cc b/chrome/browser/chromeos/extensions/device_local_account_external_policy_loader_unittest.cc
index 9f30f7a..e7c2cc7 100644
--- a/chrome/browser/chromeos/extensions/device_local_account_external_policy_loader_unittest.cc
+++ b/chrome/browser/chromeos/extensions/device_local_account_external_policy_loader_unittest.cc
@@ -19,10 +19,10 @@
#include "chrome/browser/chrome_notification_types.h"
#include "chrome/browser/extensions/external_provider_impl.h"
#include "chrome/browser/extensions/updater/extension_downloader.h"
-#include "chrome/browser/policy/cloud/mock_cloud_policy_store.h"
#include "chrome/common/chrome_paths.h"
#include "chrome/common/extensions/extension_constants.h"
#include "chrome/test/base/testing_browser_process.h"
+#include "components/policy/core/common/cloud/mock_cloud_policy_store.h"
#include "components/policy/core/common/policy_map.h"
#include "components/policy/core/common/policy_types.h"
#include "content/public/browser/notification_service.h"
diff --git a/chrome/browser/chromeos/kiosk_mode/kiosk_mode_settings.cc b/chrome/browser/chromeos/kiosk_mode/kiosk_mode_settings.cc
index 569e143..7734998 100644
--- a/chrome/browser/chromeos/kiosk_mode/kiosk_mode_settings.cc
+++ b/chrome/browser/chromeos/kiosk_mode/kiosk_mode_settings.cc
@@ -15,9 +15,9 @@
#include "chrome/browser/chromeos/settings/cros_settings.h"
#include "chrome/browser/lifetime/application_lifetime.h"
#include "chrome/browser/policy/browser_policy_connector.h"
-#include "chrome/browser/policy/cloud/cloud_policy_constants.h"
#include "chromeos/chromeos_switches.h"
#include "chromeos/settings/cros_settings_names.h"
+#include "components/policy/core/common/cloud/cloud_policy_constants.h"
#include "content/public/browser/browser_thread.h"
namespace chromeos {
diff --git a/chrome/browser/chromeos/login/enrollment/enrollment_screen.cc b/chrome/browser/chromeos/login/enrollment/enrollment_screen.cc
index b08ec37..350d3be 100644
--- a/chrome/browser/chromeos/login/enrollment/enrollment_screen.cc
+++ b/chrome/browser/chromeos/login/enrollment/enrollment_screen.cc
@@ -17,11 +17,11 @@
#include "chrome/browser/chromeos/policy/auto_enrollment_client.h"
#include "chrome/browser/chromeos/policy/device_cloud_policy_manager_chromeos.h"
#include "chrome/browser/policy/browser_policy_connector.h"
-#include "chrome/browser/policy/cloud/enterprise_metrics.h"
#include "chromeos/dbus/cryptohome_client.h"
#include "chromeos/dbus/dbus_method_call_status.h"
#include "chromeos/dbus/dbus_thread_manager.h"
#include "chromeos/dbus/session_manager_client.h"
+#include "components/policy/core/common/cloud/enterprise_metrics.h"
#include "google_apis/gaia/gaia_auth_util.h"
#include "google_apis/gaia/google_service_auth_error.h"
diff --git a/chrome/browser/chromeos/login/enrollment/enrollment_screen.h b/chrome/browser/chromeos/login/enrollment/enrollment_screen.h
index 0db7475..97388826 100644
--- a/chrome/browser/chromeos/login/enrollment/enrollment_screen.h
+++ b/chrome/browser/chromeos/login/enrollment/enrollment_screen.h
@@ -12,7 +12,7 @@
#include "base/memory/weak_ptr.h"
#include "chrome/browser/chromeos/login/enrollment/enrollment_screen_actor.h"
#include "chrome/browser/chromeos/login/screens/wizard_screen.h"
-#include "chrome/browser/policy/cloud/cloud_policy_constants.h"
+#include "components/policy/core/common/cloud/cloud_policy_constants.h"
namespace chromeos {
diff --git a/chrome/browser/chromeos/login/existing_user_controller.cc b/chrome/browser/chromeos/login/existing_user_controller.cc
index b18fbac..443373e 100644
--- a/chrome/browser/chromeos/login/existing_user_controller.cc
+++ b/chrome/browser/chromeos/login/existing_user_controller.cc
@@ -37,7 +37,6 @@
#include "chrome/browser/chromeos/profiles/profile_helper.h"
#include "chrome/browser/chromeos/settings/cros_settings.h"
#include "chrome/browser/google/google_util.h"
-#include "chrome/browser/policy/policy_service.h"
#include "chrome/browser/prefs/session_startup_pref.h"
#include "chrome/common/chrome_switches.h"
#include "chrome/common/chrome_version_info.h"
@@ -48,6 +47,7 @@
#include "chromeos/dbus/power_manager_client.h"
#include "chromeos/dbus/session_manager_client.h"
#include "chromeos/settings/cros_settings_names.h"
+#include "components/policy/core/common/policy_service.h"
#include "content/public/browser/browser_thread.h"
#include "content/public/browser/notification_service.h"
#include "content/public/browser/notification_types.h"
@@ -257,7 +257,7 @@ void ExistingUserController::Observe(
// just after the UI is closed but before the new credentials were stored
// in the profile. Therefore we have to give it some time to make sure it
// has been updated before we copy it.
- LOG(INFO) << "Authentication was entered manually, possibly for proxyauth.";
+ VLOG(1) << "Authentication was entered manually, possibly for proxyauth.";
scoped_refptr<net::URLRequestContextGetter> browser_process_context_getter =
g_browser_process->system_request_context();
Profile* signin_profile = ProfileHelper::GetSigninProfile();
diff --git a/chrome/browser/chromeos/login/existing_user_controller_browsertest.cc b/chrome/browser/chromeos/login/existing_user_controller_browsertest.cc
index 96dfe3a..c5137bb 100644
--- a/chrome/browser/chromeos/login/existing_user_controller_browsertest.cc
+++ b/chrome/browser/chromeos/login/existing_user_controller_browsertest.cc
@@ -28,11 +28,6 @@
#include "chrome/browser/chromeos/policy/device_policy_cros_browser_test.h"
#include "chrome/browser/chromeos/settings/cros_settings.h"
#include "chrome/browser/policy/browser_policy_connector.h"
-#include "chrome/browser/policy/cloud/cloud_policy_constants.h"
-#include "chrome/browser/policy/cloud/cloud_policy_core.h"
-#include "chrome/browser/policy/cloud/cloud_policy_store.h"
-#include "chrome/browser/policy/cloud/mock_cloud_policy_store.h"
-#include "chrome/browser/policy/cloud/policy_builder.h"
#include "chrome/browser/policy/proto/chromeos/chrome_device_policy.pb.h"
#include "chrome/common/chrome_switches.h"
#include "chrome/test/base/testing_browser_process.h"
@@ -41,6 +36,11 @@
#include "chromeos/chromeos_switches.h"
#include "chromeos/dbus/fake_session_manager_client.h"
#include "chromeos/settings/cros_settings_names.h"
+#include "components/policy/core/common/cloud/cloud_policy_constants.h"
+#include "components/policy/core/common/cloud/cloud_policy_core.h"
+#include "components/policy/core/common/cloud/cloud_policy_store.h"
+#include "components/policy/core/common/cloud/mock_cloud_policy_store.h"
+#include "components/policy/core/common/cloud/policy_builder.h"
#include "content/public/test/mock_notification_observer.h"
#include "content/public/test/test_utils.h"
#include "google_apis/gaia/mock_url_fetcher_factory.h"
diff --git a/chrome/browser/chromeos/login/kiosk_browsertest.cc b/chrome/browser/chromeos/login/kiosk_browsertest.cc
index 0189bf1..e66f578 100644
--- a/chrome/browser/chromeos/login/kiosk_browsertest.cc
+++ b/chrome/browser/chromeos/login/kiosk_browsertest.cc
@@ -42,7 +42,6 @@
#include "chrome/browser/extensions/extension_system.h"
#include "chrome/browser/extensions/extension_test_message_listener.h"
#include "chrome/browser/lifetime/application_lifetime.h"
-#include "chrome/browser/policy/cloud/policy_builder.h"
#include "chrome/browser/policy/proto/chromeos/chrome_device_policy.pb.h"
#include "chrome/browser/profiles/profile_manager.h"
#include "chrome/browser/ui/browser.h"
@@ -56,6 +55,7 @@
#include "chrome/test/base/ui_test_utils.h"
#include "chromeos/chromeos_switches.h"
#include "chromeos/settings/cros_settings_names.h"
+#include "components/policy/core/common/cloud/policy_builder.h"
#include "content/public/browser/notification_observer.h"
#include "content/public/browser/notification_registrar.h"
#include "content/public/browser/notification_service.h"
diff --git a/chrome/browser/chromeos/login/login_utils_browsertest.cc b/chrome/browser/chromeos/login/login_utils_browsertest.cc
index 14e423f..0b6365d 100644
--- a/chrome/browser/chromeos/login/login_utils_browsertest.cc
+++ b/chrome/browser/chromeos/login/login_utils_browsertest.cc
@@ -30,8 +30,6 @@
#include "chrome/browser/io_thread.h"
#include "chrome/browser/net/predictor.h"
#include "chrome/browser/policy/browser_policy_connector.h"
-#include "chrome/browser/policy/cloud/device_management_service.h"
-#include "chrome/browser/policy/policy_service.h"
#include "chrome/browser/policy/proto/cloud/device_management_backend.pb.h"
#include "chrome/browser/profiles/chrome_browser_main_extra_parts_profiles.h"
#include "chrome/browser/profiles/profile_manager.h"
@@ -51,6 +49,8 @@
#include "chromeos/network/network_handler.h"
#include "chromeos/system/mock_statistics_provider.h"
#include "chromeos/system/statistics_provider.h"
+#include "components/policy/core/common/cloud/device_management_service.h"
+#include "components/policy/core/common/policy_service.h"
#include "content/public/browser/browser_thread.h"
#include "content/public/test/test_browser_thread.h"
#include "content/public/test/test_utils.h"
diff --git a/chrome/browser/chromeos/login/screens/user_image_screen.cc b/chrome/browser/chromeos/login/screens/user_image_screen.cc
index ebe2fe1..a7a4995 100644
--- a/chrome/browser/chromeos/login/screens/user_image_screen.cc
+++ b/chrome/browser/chromeos/login/screens/user_image_screen.cc
@@ -25,13 +25,13 @@
#include "chrome/browser/chromeos/login/user_image_manager.h"
#include "chrome/browser/chromeos/login/user_manager.h"
#include "chrome/browser/chromeos/login/wizard_controller.h"
-#include "chrome/browser/policy/policy_service.h"
#include "chrome/browser/policy/profile_policy_connector.h"
#include "chrome/browser/policy/profile_policy_connector_factory.h"
#include "chrome/browser/profiles/profile.h"
#include "chrome/common/url_constants.h"
#include "components/policy/core/common/policy_map.h"
#include "components/policy/core/common/policy_namespace.h"
+#include "components/policy/core/common/policy_service.h"
#include "content/public/browser/browser_thread.h"
#include "content/public/browser/notification_service.h"
#include "grit/generated_resources.h"
diff --git a/chrome/browser/chromeos/login/user_image_manager_browsertest.cc b/chrome/browser/chromeos/login/user_image_manager_browsertest.cc
index a1b8f1d..4c1cd24 100644
--- a/chrome/browser/chromeos/login/user_image_manager_browsertest.cc
+++ b/chrome/browser/chromeos/login/user_image_manager_browsertest.cc
@@ -38,9 +38,6 @@
#include "chrome/browser/chromeos/policy/cloud_external_data_manager_base_test_util.h"
#include "chrome/browser/chromeos/policy/user_cloud_policy_manager_chromeos.h"
#include "chrome/browser/chromeos/policy/user_cloud_policy_manager_factory_chromeos.h"
-#include "chrome/browser/policy/cloud/cloud_policy_core.h"
-#include "chrome/browser/policy/cloud/cloud_policy_store.h"
-#include "chrome/browser/policy/cloud/policy_builder.h"
#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/profiles/profile_downloader.h"
#include "chrome/common/chrome_paths.h"
@@ -52,6 +49,9 @@
#include "chromeos/dbus/fake_dbus_thread_manager.h"
#include "chromeos/dbus/fake_session_manager_client.h"
#include "chromeos/dbus/session_manager_client.h"
+#include "components/policy/core/common/cloud/cloud_policy_core.h"
+#include "components/policy/core/common/cloud/cloud_policy_store.h"
+#include "components/policy/core/common/cloud/policy_builder.h"
#include "content/public/browser/notification_service.h"
#include "content/public/browser/notification_source.h"
#include "content/public/test/test_utils.h"
diff --git a/chrome/browser/chromeos/login/version_info_updater.h b/chrome/browser/chromeos/login/version_info_updater.h
index becce6b..bde2594 100644
--- a/chrome/browser/chromeos/login/version_info_updater.h
+++ b/chrome/browser/chromeos/login/version_info_updater.h
@@ -12,7 +12,7 @@
#include "chrome/browser/chromeos/boot_times_loader.h"
#include "chrome/browser/chromeos/settings/cros_settings.h"
#include "chrome/browser/chromeos/version_loader.h"
-#include "chrome/browser/policy/cloud/cloud_policy_store.h"
+#include "components/policy/core/common/cloud/cloud_policy_store.h"
namespace chromeos {
diff --git a/chrome/browser/chromeos/policy/auto_enrollment_client.cc b/chrome/browser/chromeos/policy/auto_enrollment_client.cc
index ba13f75..a0fbc2b 100644
--- a/chrome/browser/chromeos/policy/auto_enrollment_client.cc
+++ b/chrome/browser/chromeos/policy/auto_enrollment_client.cc
@@ -18,10 +18,10 @@
#include "chrome/browser/browser_process.h"
#include "chrome/browser/chromeos/policy/device_cloud_policy_manager_chromeos.h"
#include "chrome/browser/policy/browser_policy_connector.h"
-#include "chrome/browser/policy/cloud/device_management_service.h"
-#include "chrome/browser/policy/cloud/system_policy_request_context.h"
#include "chrome/common/pref_names.h"
#include "chromeos/chromeos_switches.h"
+#include "components/policy/core/common/cloud/device_management_service.h"
+#include "components/policy/core/common/cloud/system_policy_request_context.h"
#include "content/public/browser/browser_thread.h"
#include "content/public/common/content_client.h"
#include "crypto/sha2.h"
diff --git a/chrome/browser/chromeos/policy/auto_enrollment_client.h b/chrome/browser/chromeos/policy/auto_enrollment_client.h
index cac0f68..6d6b877 100644
--- a/chrome/browser/chromeos/policy/auto_enrollment_client.h
+++ b/chrome/browser/chromeos/policy/auto_enrollment_client.h
@@ -12,7 +12,7 @@
#include "base/compiler_specific.h"
#include "base/memory/scoped_ptr.h"
#include "base/time/time.h"
-#include "chrome/browser/policy/cloud/cloud_policy_constants.h"
+#include "components/policy/core/common/cloud/cloud_policy_constants.h"
#include "net/base/network_change_notifier.h"
#include "third_party/protobuf/src/google/protobuf/repeated_field.h"
diff --git a/chrome/browser/chromeos/policy/auto_enrollment_client_unittest.cc b/chrome/browser/chromeos/policy/auto_enrollment_client_unittest.cc
index be1be30..a2f343f 100644
--- a/chrome/browser/chromeos/policy/auto_enrollment_client_unittest.cc
+++ b/chrome/browser/chromeos/policy/auto_enrollment_client_unittest.cc
@@ -11,10 +11,10 @@
#include "base/prefs/testing_pref_service.h"
#include "base/values.h"
#include "chrome/browser/browser_process.h"
-#include "chrome/browser/policy/cloud/mock_device_management_service.h"
#include "chrome/common/pref_names.h"
#include "chrome/test/base/scoped_testing_local_state.h"
#include "chrome/test/base/testing_browser_process.h"
+#include "components/policy/core/common/cloud/mock_device_management_service.h"
#include "content/public/test/test_browser_thread_bundle.h"
#include "crypto/sha2.h"
#include "net/url_request/url_request_context_getter.h"
diff --git a/chrome/browser/chromeos/policy/cloud_external_data_manager_base.cc b/chrome/browser/chromeos/policy/cloud_external_data_manager_base.cc
index 53f68c0..3fcc6b2 100644
--- a/chrome/browser/chromeos/policy/cloud_external_data_manager_base.cc
+++ b/chrome/browser/chromeos/policy/cloud_external_data_manager_base.cc
@@ -18,9 +18,9 @@
#include "base/strings/string_number_conversions.h"
#include "base/values.h"
#include "chrome/browser/chromeos/policy/cloud_external_data_store.h"
-#include "chrome/browser/policy/cloud/cloud_policy_store.h"
-#include "chrome/browser/policy/cloud/external_policy_data_fetcher.h"
-#include "chrome/browser/policy/cloud/external_policy_data_updater.h"
+#include "components/policy/core/common/cloud/cloud_policy_store.h"
+#include "components/policy/core/common/cloud/external_policy_data_fetcher.h"
+#include "components/policy/core/common/cloud/external_policy_data_updater.h"
#include "components/policy/core/common/external_data_fetcher.h"
#include "components/policy/core/common/policy_map.h"
#include "net/url_request/url_request_context_getter.h"
diff --git a/chrome/browser/chromeos/policy/cloud_external_data_manager_base.h b/chrome/browser/chromeos/policy/cloud_external_data_manager_base.h
index 96c80da..dc82ca6 100644
--- a/chrome/browser/chromeos/policy/cloud_external_data_manager_base.h
+++ b/chrome/browser/chromeos/policy/cloud_external_data_manager_base.h
@@ -10,7 +10,7 @@
#include "base/memory/ref_counted.h"
#include "base/memory/scoped_ptr.h"
#include "base/threading/non_thread_safe.h"
-#include "chrome/browser/policy/cloud/cloud_external_data_manager.h"
+#include "components/policy/core/common/cloud/cloud_external_data_manager.h"
#include "components/policy/core/common/policy_details.h"
namespace base {
diff --git a/chrome/browser/chromeos/policy/cloud_external_data_manager_base_test_util.cc b/chrome/browser/chromeos/policy/cloud_external_data_manager_base_test_util.cc
index 2382293..4fa6368 100644
--- a/chrome/browser/chromeos/policy/cloud_external_data_manager_base_test_util.cc
+++ b/chrome/browser/chromeos/policy/cloud_external_data_manager_base_test_util.cc
@@ -9,9 +9,9 @@
#include "base/sha1.h"
#include "base/strings/string_number_conversions.h"
#include "base/values.h"
-#include "chrome/browser/policy/cloud/cloud_external_data_manager.h"
-#include "chrome/browser/policy/cloud/cloud_policy_core.h"
-#include "chrome/browser/policy/cloud/cloud_policy_store.h"
+#include "components/policy/core/common/cloud/cloud_external_data_manager.h"
+#include "components/policy/core/common/cloud/cloud_policy_core.h"
+#include "components/policy/core/common/cloud/cloud_policy_store.h"
#include "components/policy/core/common/external_data_fetcher.h"
#include "components/policy/core/common/policy_map.h"
#include "components/policy/core/common/policy_types.h"
diff --git a/chrome/browser/chromeos/policy/cloud_external_data_manager_base_unittest.cc b/chrome/browser/chromeos/policy/cloud_external_data_manager_base_unittest.cc
index 3618e82..8636f2fa 100644
--- a/chrome/browser/chromeos/policy/cloud_external_data_manager_base_unittest.cc
+++ b/chrome/browser/chromeos/policy/cloud_external_data_manager_base_unittest.cc
@@ -19,11 +19,11 @@
#include "base/test/test_simple_task_runner.h"
#include "base/values.h"
#include "chrome/browser/chromeos/policy/cloud_external_data_store.h"
-#include "chrome/browser/policy/cloud/mock_cloud_policy_store.h"
-#include "chrome/browser/policy/cloud/resource_cache.h"
-#include "chrome/browser/policy/test/policy_test_utils.h"
+#include "components/policy/core/common/cloud/mock_cloud_policy_store.h"
+#include "components/policy/core/common/cloud/resource_cache.h"
#include "components/policy/core/common/external_data_fetcher.h"
#include "components/policy/core/common/policy_map.h"
+#include "components/policy/core/common/policy_test_utils.h"
#include "components/policy/core/common/policy_types.h"
#include "net/http/http_status_code.h"
#include "net/url_request/test_url_fetcher_factory.h"
diff --git a/chrome/browser/chromeos/policy/cloud_external_data_policy_observer.cc b/chrome/browser/chromeos/policy/cloud_external_data_policy_observer.cc
index 12b974c..437c9a6 100644
--- a/chrome/browser/chromeos/policy/cloud_external_data_policy_observer.cc
+++ b/chrome/browser/chromeos/policy/cloud_external_data_policy_observer.cc
@@ -16,16 +16,16 @@
#include "chrome/browser/chromeos/login/user.h"
#include "chrome/browser/chromeos/login/user_manager.h"
#include "chrome/browser/chromeos/policy/device_local_account.h"
-#include "chrome/browser/policy/cloud/cloud_policy_core.h"
-#include "chrome/browser/policy/cloud/cloud_policy_store.h"
-#include "chrome/browser/policy/policy_service.h"
#include "chrome/browser/policy/profile_policy_connector.h"
#include "chrome/browser/policy/profile_policy_connector_factory.h"
#include "chrome/browser/profiles/profile.h"
#include "chromeos/settings/cros_settings_names.h"
#include "chromeos/settings/cros_settings_provider.h"
+#include "components/policy/core/common/cloud/cloud_policy_core.h"
+#include "components/policy/core/common/cloud/cloud_policy_store.h"
#include "components/policy/core/common/external_data_fetcher.h"
#include "components/policy/core/common/policy_namespace.h"
+#include "components/policy/core/common/policy_service.h"
#include "content/public/browser/notification_details.h"
#include "content/public/browser/notification_service.h"
#include "content/public/browser/notification_source.h"
diff --git a/chrome/browser/chromeos/policy/cloud_external_data_policy_observer_unittest.cc b/chrome/browser/chromeos/policy/cloud_external_data_policy_observer_unittest.cc
index c7edbde..1f0464b 100644
--- a/chrome/browser/chromeos/policy/cloud_external_data_policy_observer_unittest.cc
+++ b/chrome/browser/chromeos/policy/cloud_external_data_policy_observer_unittest.cc
@@ -25,19 +25,19 @@
#include "chrome/browser/chromeos/policy/device_local_account_policy_service.h"
#include "chrome/browser/chromeos/settings/device_settings_service.h"
#include "chrome/browser/chromeos/settings/device_settings_test_helper.h"
-#include "chrome/browser/policy/cloud/cloud_policy_core.h"
-#include "chrome/browser/policy/cloud/cloud_policy_store.h"
-#include "chrome/browser/policy/cloud/mock_cloud_external_data_manager.h"
-#include "chrome/browser/policy/cloud/policy_builder.h"
-#include "chrome/browser/policy/policy_service.h"
-#include "chrome/browser/policy/policy_service_impl.h"
#include "chrome/browser/policy/proto/chromeos/chrome_device_policy.pb.h"
#include "chrome/browser/profiles/profile.h"
#include "chrome/common/chrome_paths.h"
#include "chrome/test/base/testing_profile.h"
+#include "components/policy/core/common/cloud/cloud_policy_core.h"
+#include "components/policy/core/common/cloud/cloud_policy_store.h"
+#include "components/policy/core/common/cloud/mock_cloud_external_data_manager.h"
+#include "components/policy/core/common/cloud/policy_builder.h"
#include "components/policy/core/common/external_data_fetcher.h"
#include "components/policy/core/common/mock_configuration_policy_provider.h"
#include "components/policy/core/common/policy_map.h"
+#include "components/policy/core/common/policy_service.h"
+#include "components/policy/core/common/policy_service_impl.h"
#include "components/policy/core/common/policy_types.h"
#include "content/public/browser/notification_details.h"
#include "content/public/browser/notification_service.h"
diff --git a/chrome/browser/chromeos/policy/cloud_external_data_store.cc b/chrome/browser/chromeos/policy/cloud_external_data_store.cc
index a00cd8a..d19c2a9 100644
--- a/chrome/browser/chromeos/policy/cloud_external_data_store.cc
+++ b/chrome/browser/chromeos/policy/cloud_external_data_store.cc
@@ -10,7 +10,7 @@
#include "base/sequenced_task_runner.h"
#include "base/sha1.h"
#include "base/strings/string_number_conversions.h"
-#include "chrome/browser/policy/cloud/resource_cache.h"
+#include "components/policy/core/common/cloud/resource_cache.h"
namespace policy {
diff --git a/chrome/browser/chromeos/policy/cloud_external_data_store.h b/chrome/browser/chromeos/policy/cloud_external_data_store.h
index 079a0db..8f229f5 100644
--- a/chrome/browser/chromeos/policy/cloud_external_data_store.h
+++ b/chrome/browser/chromeos/policy/cloud_external_data_store.h
@@ -9,7 +9,7 @@
#include "base/basictypes.h"
#include "base/memory/ref_counted.h"
-#include "chrome/browser/policy/cloud/cloud_external_data_manager.h"
+#include "components/policy/core/common/cloud/cloud_external_data_manager.h"
namespace base {
class SequencedTaskRunner;
diff --git a/chrome/browser/chromeos/policy/cloud_external_data_store_unittest.cc b/chrome/browser/chromeos/policy/cloud_external_data_store_unittest.cc
index 29bafee..d8333301 100644
--- a/chrome/browser/chromeos/policy/cloud_external_data_store_unittest.cc
+++ b/chrome/browser/chromeos/policy/cloud_external_data_store_unittest.cc
@@ -9,7 +9,7 @@
#include "base/memory/scoped_ptr.h"
#include "base/sha1.h"
#include "base/test/test_simple_task_runner.h"
-#include "chrome/browser/policy/cloud/resource_cache.h"
+#include "components/policy/core/common/cloud/resource_cache.h"
#include "testing/gtest/include/gtest/gtest.h"
namespace policy {
diff --git a/chrome/browser/chromeos/policy/configuration_policy_handler_chromeos.h b/chrome/browser/chromeos/policy/configuration_policy_handler_chromeos.h
index a756a83..7ec6081 100644
--- a/chrome/browser/chromeos/policy/configuration_policy_handler_chromeos.h
+++ b/chrome/browser/chromeos/policy/configuration_policy_handler_chromeos.h
@@ -8,9 +8,9 @@
#include "base/basictypes.h"
#include "base/compiler_specific.h"
#include "chrome/browser/extensions/policy_handlers.h"
-#include "chrome/browser/policy/configuration_policy_handler.h"
#include "chromeos/network/network_ui_data.h"
#include "components/onc/onc_constants.h"
+#include "components/policy/core/browser/configuration_policy_handler.h"
namespace base {
class DictionaryValue;
diff --git a/chrome/browser/chromeos/policy/device_cloud_policy_manager_chromeos.cc b/chrome/browser/chromeos/policy/device_cloud_policy_manager_chromeos.cc
index 1dbbd93..390e874 100644
--- a/chrome/browser/chromeos/policy/device_cloud_policy_manager_chromeos.cc
+++ b/chrome/browser/chromeos/policy/device_cloud_policy_manager_chromeos.cc
@@ -14,14 +14,14 @@
#include "chrome/browser/chromeos/policy/device_cloud_policy_store_chromeos.h"
#include "chrome/browser/chromeos/policy/enrollment_handler_chromeos.h"
#include "chrome/browser/chromeos/policy/enterprise_install_attributes.h"
-#include "chrome/browser/policy/cloud/cloud_policy_constants.h"
-#include "chrome/browser/policy/cloud/cloud_policy_store.h"
-#include "chrome/browser/policy/cloud/device_management_service.h"
-#include "chrome/browser/policy/cloud/system_policy_request_context.h"
#include "chrome/browser/policy/proto/cloud/device_management_backend.pb.h"
#include "chrome/common/pref_names.h"
#include "chromeos/chromeos_constants.h"
#include "chromeos/system/statistics_provider.h"
+#include "components/policy/core/common/cloud/cloud_policy_constants.h"
+#include "components/policy/core/common/cloud/cloud_policy_store.h"
+#include "components/policy/core/common/cloud/device_management_service.h"
+#include "components/policy/core/common/cloud/system_policy_request_context.h"
#include "content/public/browser/browser_thread.h"
#include "content/public/common/content_client.h"
#include "url/gurl.h"
diff --git a/chrome/browser/chromeos/policy/device_cloud_policy_manager_chromeos.h b/chrome/browser/chromeos/policy/device_cloud_policy_manager_chromeos.h
index 1208478..ec1fc04 100644
--- a/chrome/browser/chromeos/policy/device_cloud_policy_manager_chromeos.h
+++ b/chrome/browser/chromeos/policy/device_cloud_policy_manager_chromeos.h
@@ -14,9 +14,9 @@
#include "base/memory/ref_counted.h"
#include "base/memory/scoped_ptr.h"
#include "chrome/browser/chromeos/policy/enrollment_status_chromeos.h"
-#include "chrome/browser/policy/cloud/cloud_policy_client.h"
-#include "chrome/browser/policy/cloud/cloud_policy_manager.h"
-#include "chrome/browser/policy/cloud/cloud_policy_store.h"
+#include "components/policy/core/common/cloud/cloud_policy_client.h"
+#include "components/policy/core/common/cloud/cloud_policy_manager.h"
+#include "components/policy/core/common/cloud/cloud_policy_store.h"
namespace base {
class SequencedTaskRunner;
diff --git a/chrome/browser/chromeos/policy/device_cloud_policy_manager_chromeos_unittest.cc b/chrome/browser/chromeos/policy/device_cloud_policy_manager_chromeos_unittest.cc
index bcf2e40..ce229a1 100644
--- a/chrome/browser/chromeos/policy/device_cloud_policy_manager_chromeos_unittest.cc
+++ b/chrome/browser/chromeos/policy/device_cloud_policy_manager_chromeos_unittest.cc
@@ -18,8 +18,6 @@
#include "chrome/browser/chromeos/settings/device_oauth2_token_service_factory.h"
#include "chrome/browser/chromeos/settings/device_settings_service.h"
#include "chrome/browser/chromeos/settings/device_settings_test_helper.h"
-#include "chrome/browser/policy/cloud/cloud_policy_client.h"
-#include "chrome/browser/policy/cloud/mock_device_management_service.h"
#include "chrome/browser/policy/proto/chromeos/chrome_device_policy.pb.h"
#include "chrome/browser/policy/proto/cloud/device_management_backend.pb.h"
#include "chrome/browser/prefs/browser_prefs.h"
@@ -29,6 +27,8 @@
#include "chromeos/dbus/dbus_thread_manager.h"
#include "chromeos/system/mock_statistics_provider.h"
#include "chromeos/system/statistics_provider.h"
+#include "components/policy/core/common/cloud/cloud_policy_client.h"
+#include "components/policy/core/common/cloud/mock_device_management_service.h"
#include "components/policy/core/common/external_data_fetcher.h"
#include "components/policy/core/common/schema_registry.h"
#include "google_apis/gaia/gaia_oauth_client.h"
diff --git a/chrome/browser/chromeos/policy/device_cloud_policy_store_chromeos.h b/chrome/browser/chromeos/policy/device_cloud_policy_store_chromeos.h
index 6afcd44..cb9c78ab 100644
--- a/chrome/browser/chromeos/policy/device_cloud_policy_store_chromeos.h
+++ b/chrome/browser/chromeos/policy/device_cloud_policy_store_chromeos.h
@@ -12,7 +12,7 @@
#include "base/memory/weak_ptr.h"
#include "chrome/browser/chromeos/policy/device_cloud_policy_validator.h"
#include "chrome/browser/chromeos/settings/device_settings_service.h"
-#include "chrome/browser/policy/cloud/cloud_policy_store.h"
+#include "components/policy/core/common/cloud/cloud_policy_store.h"
namespace base {
class SequencedTaskRunner;
diff --git a/chrome/browser/chromeos/policy/device_cloud_policy_validator.h b/chrome/browser/chromeos/policy/device_cloud_policy_validator.h
index f4ab747..b4b301d 100644
--- a/chrome/browser/chromeos/policy/device_cloud_policy_validator.h
+++ b/chrome/browser/chromeos/policy/device_cloud_policy_validator.h
@@ -5,7 +5,7 @@
#ifndef CHROME_BROWSER_CHROMEOS_POLICY_DEVICE_CLOUD_POLICY_VALIDATOR_H_
#define CHROME_BROWSER_CHROMEOS_POLICY_DEVICE_CLOUD_POLICY_VALIDATOR_H_
-#include "chrome/browser/policy/cloud/cloud_policy_validator.h"
+#include "components/policy/core/common/cloud/cloud_policy_validator.h"
namespace enterprise_management {
class ChromeDeviceSettingsProto;
diff --git a/chrome/browser/chromeos/policy/device_local_account_browsertest.cc b/chrome/browser/chromeos/policy/device_local_account_browsertest.cc
index 43d1758..e2ec50e 100644
--- a/chrome/browser/chromeos/policy/device_local_account_browsertest.cc
+++ b/chrome/browser/chromeos/policy/device_local_account_browsertest.cc
@@ -53,11 +53,6 @@
#include "chrome/browser/extensions/extension_system.h"
#include "chrome/browser/lifetime/application_lifetime.h"
#include "chrome/browser/policy/browser_policy_connector.h"
-#include "chrome/browser/policy/cloud/cloud_policy_constants.h"
-#include "chrome/browser/policy/cloud/cloud_policy_core.h"
-#include "chrome/browser/policy/cloud/cloud_policy_store.h"
-#include "chrome/browser/policy/cloud/policy_builder.h"
-#include "chrome/browser/policy/policy_service.h"
#include "chrome/browser/policy/profile_policy_connector.h"
#include "chrome/browser/policy/profile_policy_connector_factory.h"
#include "chrome/browser/policy/proto/chromeos/chrome_device_policy.pb.h"
@@ -79,9 +74,14 @@
#include "chromeos/chromeos_paths.h"
#include "chromeos/chromeos_switches.h"
#include "chromeos/dbus/fake_session_manager_client.h"
+#include "components/policy/core/common/cloud/cloud_policy_constants.h"
+#include "components/policy/core/common/cloud/cloud_policy_core.h"
+#include "components/policy/core/common/cloud/cloud_policy_store.h"
+#include "components/policy/core/common/cloud/policy_builder.h"
#include "components/policy/core/common/external_data_fetcher.h"
#include "components/policy/core/common/policy_map.h"
#include "components/policy/core/common/policy_namespace.h"
+#include "components/policy/core/common/policy_service.h"
#include "content/public/browser/notification_details.h"
#include "content/public/browser/notification_source.h"
#include "content/public/browser/web_contents.h"
diff --git a/chrome/browser/chromeos/policy/device_local_account_external_data_manager.cc b/chrome/browser/chromeos/policy/device_local_account_external_data_manager.cc
index 8d43bc7..44dd4e6 100644
--- a/chrome/browser/chromeos/policy/device_local_account_external_data_manager.cc
+++ b/chrome/browser/chromeos/policy/device_local_account_external_data_manager.cc
@@ -8,7 +8,7 @@
#include "base/sequenced_task_runner.h"
#include "chrome/browser/chromeos/policy/cloud_external_data_store.h"
#include "chrome/browser/chromeos/policy/device_local_account_external_data_service.h"
-#include "chrome/browser/policy/cloud/resource_cache.h"
+#include "components/policy/core/common/cloud/resource_cache.h"
#include "policy/policy_constants.h"
namespace policy {
diff --git a/chrome/browser/chromeos/policy/device_local_account_external_data_service.cc b/chrome/browser/chromeos/policy/device_local_account_external_data_service.cc
index 6162540..9bc0f72 100644
--- a/chrome/browser/chromeos/policy/device_local_account_external_data_service.cc
+++ b/chrome/browser/chromeos/policy/device_local_account_external_data_service.cc
@@ -13,8 +13,8 @@
#include "base/logging.h"
#include "base/path_service.h"
#include "base/sequenced_task_runner.h"
-#include "chrome/browser/policy/cloud/cloud_policy_store.h"
#include "chromeos/chromeos_paths.h"
+#include "components/policy/core/common/cloud/cloud_policy_store.h"
#include "policy/policy_constants.h"
namespace policy {
diff --git a/chrome/browser/chromeos/policy/device_local_account_external_data_service.h b/chrome/browser/chromeos/policy/device_local_account_external_data_service.h
index 01db340..2174ef8 100644
--- a/chrome/browser/chromeos/policy/device_local_account_external_data_service.h
+++ b/chrome/browser/chromeos/policy/device_local_account_external_data_service.h
@@ -14,7 +14,7 @@
#include "base/memory/scoped_ptr.h"
#include "chrome/browser/chromeos/policy/device_local_account_external_data_manager.h"
#include "chrome/browser/chromeos/policy/device_local_account_policy_service.h"
-#include "chrome/browser/policy/cloud/resource_cache.h"
+#include "components/policy/core/common/cloud/resource_cache.h"
namespace base {
class SequencedTaskRunner;
diff --git a/chrome/browser/chromeos/policy/device_local_account_policy_provider.cc b/chrome/browser/chromeos/policy/device_local_account_policy_provider.cc
index ddd9726..dafac17 100644
--- a/chrome/browser/chromeos/policy/device_local_account_policy_provider.cc
+++ b/chrome/browser/chromeos/policy/device_local_account_policy_provider.cc
@@ -6,8 +6,8 @@
#include "base/bind.h"
#include "chrome/browser/chromeos/policy/device_local_account_external_data_manager.h"
-#include "chrome/browser/policy/cloud/cloud_policy_core.h"
-#include "chrome/browser/policy/cloud/cloud_policy_service.h"
+#include "components/policy/core/common/cloud/cloud_policy_core.h"
+#include "components/policy/core/common/cloud/cloud_policy_service.h"
#include "components/policy/core/common/policy_bundle.h"
#include "components/policy/core/common/policy_namespace.h"
diff --git a/chrome/browser/chromeos/policy/device_local_account_policy_service.cc b/chrome/browser/chromeos/policy/device_local_account_policy_service.cc
index f596c67..6d8d828 100644
--- a/chrome/browser/chromeos/policy/device_local_account_policy_service.cc
+++ b/chrome/browser/chromeos/policy/device_local_account_policy_service.cc
@@ -21,16 +21,16 @@
#include "chrome/browser/chromeos/policy/device_local_account_external_data_service.h"
#include "chrome/browser/chromeos/policy/device_local_account_policy_store.h"
#include "chrome/browser/chromeos/settings/device_settings_service.h"
-#include "chrome/browser/policy/cloud/cloud_policy_client.h"
-#include "chrome/browser/policy/cloud/cloud_policy_constants.h"
-#include "chrome/browser/policy/cloud/cloud_policy_refresh_scheduler.h"
-#include "chrome/browser/policy/cloud/device_management_service.h"
-#include "chrome/browser/policy/cloud/system_policy_request_context.h"
#include "chrome/browser/policy/proto/cloud/device_management_backend.pb.h"
#include "chromeos/chromeos_paths.h"
#include "chromeos/dbus/session_manager_client.h"
#include "chromeos/settings/cros_settings_names.h"
#include "chromeos/settings/cros_settings_provider.h"
+#include "components/policy/core/common/cloud/cloud_policy_client.h"
+#include "components/policy/core/common/cloud/cloud_policy_constants.h"
+#include "components/policy/core/common/cloud/cloud_policy_refresh_scheduler.h"
+#include "components/policy/core/common/cloud/device_management_service.h"
+#include "components/policy/core/common/cloud/system_policy_request_context.h"
#include "content/public/common/content_client.h"
#include "net/url_request/url_request_context_getter.h"
#include "policy/policy_constants.h"
diff --git a/chrome/browser/chromeos/policy/device_local_account_policy_service.h b/chrome/browser/chromeos/policy/device_local_account_policy_service.h
index 767eb4b..2f9e776 100644
--- a/chrome/browser/chromeos/policy/device_local_account_policy_service.h
+++ b/chrome/browser/chromeos/policy/device_local_account_policy_service.h
@@ -18,8 +18,8 @@
#include "chrome/browser/chromeos/extensions/device_local_account_external_policy_loader.h"
#include "chrome/browser/chromeos/policy/device_local_account_external_data_manager.h"
#include "chrome/browser/chromeos/settings/cros_settings.h"
-#include "chrome/browser/policy/cloud/cloud_policy_core.h"
-#include "chrome/browser/policy/cloud/cloud_policy_store.h"
+#include "components/policy/core/common/cloud/cloud_policy_core.h"
+#include "components/policy/core/common/cloud/cloud_policy_store.h"
namespace base {
class SequencedTaskRunner;
diff --git a/chrome/browser/chromeos/policy/device_local_account_policy_service_unittest.cc b/chrome/browser/chromeos/policy/device_local_account_policy_service_unittest.cc
index 877fdb9..7aec9de 100644
--- a/chrome/browser/chromeos/policy/device_local_account_policy_service_unittest.cc
+++ b/chrome/browser/chromeos/policy/device_local_account_policy_service_unittest.cc
@@ -23,15 +23,15 @@
#include "chrome/browser/chromeos/settings/cros_settings.h"
#include "chrome/browser/chromeos/settings/device_settings_service.h"
#include "chrome/browser/chromeos/settings/device_settings_test_helper.h"
-#include "chrome/browser/policy/cloud/cloud_policy_client.h"
-#include "chrome/browser/policy/cloud/cloud_policy_constants.h"
-#include "chrome/browser/policy/cloud/cloud_policy_service.h"
-#include "chrome/browser/policy/cloud/mock_device_management_service.h"
-#include "chrome/browser/policy/cloud/policy_builder.h"
#include "chrome/browser/policy/proto/chromeos/chrome_device_policy.pb.h"
#include "chrome/common/chrome_paths.h"
#include "chromeos/chromeos_paths.h"
#include "chromeos/dbus/power_policy_controller.h"
+#include "components/policy/core/common/cloud/cloud_policy_client.h"
+#include "components/policy/core/common/cloud/cloud_policy_constants.h"
+#include "components/policy/core/common/cloud/cloud_policy_service.h"
+#include "components/policy/core/common/cloud/mock_device_management_service.h"
+#include "components/policy/core/common/cloud/policy_builder.h"
#include "components/policy/core/common/external_data_fetcher.h"
#include "components/policy/core/common/mock_configuration_policy_provider.h"
#include "components/policy/core/common/schema_registry.h"
diff --git a/chrome/browser/chromeos/policy/device_local_account_policy_store.cc b/chrome/browser/chromeos/policy/device_local_account_policy_store.cc
index f5e013e..b25232b 100644
--- a/chrome/browser/chromeos/policy/device_local_account_policy_store.cc
+++ b/chrome/browser/chromeos/policy/device_local_account_policy_store.cc
@@ -7,10 +7,10 @@
#include "base/bind.h"
#include "base/callback.h"
#include "base/values.h"
-#include "chrome/browser/policy/cloud/device_management_service.h"
#include "chrome/browser/policy/proto/cloud/device_management_backend.pb.h"
#include "chromeos/dbus/power_policy_controller.h"
#include "chromeos/dbus/session_manager_client.h"
+#include "components/policy/core/common/cloud/device_management_service.h"
#include "components/policy/core/common/external_data_fetcher.h"
#include "components/policy/core/common/policy_types.h"
#include "policy/policy_constants.h"
diff --git a/chrome/browser/chromeos/policy/device_local_account_policy_store.h b/chrome/browser/chromeos/policy/device_local_account_policy_store.h
index 1929bd5..e8ac62e 100644
--- a/chrome/browser/chromeos/policy/device_local_account_policy_store.h
+++ b/chrome/browser/chromeos/policy/device_local_account_policy_store.h
@@ -13,8 +13,8 @@
#include "base/memory/scoped_ptr.h"
#include "base/memory/weak_ptr.h"
#include "chrome/browser/chromeos/settings/device_settings_service.h"
-#include "chrome/browser/policy/cloud/cloud_policy_validator.h"
#include "chrome/browser/policy/cloud/user_cloud_policy_store_base.h"
+#include "components/policy/core/common/cloud/cloud_policy_validator.h"
namespace base {
class SequencedTaskRunner;
diff --git a/chrome/browser/chromeos/policy/device_policy_builder.cc b/chrome/browser/chromeos/policy/device_policy_builder.cc
index eebc704..0d70d70 100644
--- a/chrome/browser/chromeos/policy/device_policy_builder.cc
+++ b/chrome/browser/chromeos/policy/device_policy_builder.cc
@@ -4,8 +4,8 @@
#include "chrome/browser/chromeos/policy/device_policy_builder.h"
-#include "chrome/browser/policy/cloud/cloud_policy_constants.h"
#include "chrome/browser/policy/proto/chromeos/chrome_device_policy.pb.h"
+#include "components/policy/core/common/cloud/cloud_policy_constants.h"
namespace em = enterprise_management;
diff --git a/chrome/browser/chromeos/policy/device_policy_builder.h b/chrome/browser/chromeos/policy/device_policy_builder.h
index c4bf0d24c..7b21b88 100644
--- a/chrome/browser/chromeos/policy/device_policy_builder.h
+++ b/chrome/browser/chromeos/policy/device_policy_builder.h
@@ -5,8 +5,8 @@
#ifndef CHROME_BROWSER_CHROMEOS_POLICY_DEVICE_POLICY_BUILDER_H_
#define CHROME_BROWSER_CHROMEOS_POLICY_DEVICE_POLICY_BUILDER_H_
-#include "chrome/browser/policy/cloud/policy_builder.h"
#include "chrome/browser/policy/proto/chromeos/chrome_device_policy.pb.h"
+#include "components/policy/core/common/cloud/policy_builder.h"
namespace policy {
diff --git a/chrome/browser/chromeos/policy/device_status_collector.cc b/chrome/browser/chromeos/policy/device_status_collector.cc
index b275e1f..5de8029 100644
--- a/chrome/browser/chromeos/policy/device_status_collector.cc
+++ b/chrome/browser/chromeos/policy/device_status_collector.cc
@@ -22,7 +22,6 @@
#include "chrome/browser/chromeos/login/user_manager.h"
#include "chrome/browser/chromeos/settings/cros_settings.h"
#include "chrome/browser/policy/browser_policy_connector.h"
-#include "chrome/browser/policy/cloud/cloud_policy_constants.h"
#include "chrome/browser/policy/proto/cloud/device_management_backend.pb.h"
#include "chrome/common/chrome_version_info.h"
#include "chrome/common/pref_names.h"
@@ -32,6 +31,7 @@
#include "chromeos/network/network_state_handler.h"
#include "chromeos/settings/cros_settings_names.h"
#include "chromeos/system/statistics_provider.h"
+#include "components/policy/core/common/cloud/cloud_policy_constants.h"
#include "content/public/browser/browser_thread.h"
#include "third_party/cros_system_api/dbus/service_constants.h"
diff --git a/chrome/browser/chromeos/policy/device_status_collector.h b/chrome/browser/chromeos/policy/device_status_collector.h
index 6ee8df1..3f584c1 100644
--- a/chrome/browser/chromeos/policy/device_status_collector.h
+++ b/chrome/browser/chromeos/policy/device_status_collector.h
@@ -18,8 +18,8 @@
#include "chrome/browser/chromeos/settings/cros_settings.h"
#include "chrome/browser/chromeos/version_loader.h"
#include "chrome/browser/idle.h"
-#include "chrome/browser/policy/cloud/cloud_policy_client.h"
#include "chrome/common/cancelable_task_tracker.h"
+#include "components/policy/core/common/cloud/cloud_policy_client.h"
#include "content/public/browser/geolocation_provider.h"
#include "content/public/common/geoposition.h"
diff --git a/chrome/browser/chromeos/policy/enrollment_handler_chromeos.cc b/chrome/browser/chromeos/policy/enrollment_handler_chromeos.cc
index 0cbf646..768d155 100644
--- a/chrome/browser/chromeos/policy/enrollment_handler_chromeos.cc
+++ b/chrome/browser/chromeos/policy/enrollment_handler_chromeos.cc
@@ -12,10 +12,10 @@
#include "chrome/browser/chromeos/policy/device_cloud_policy_store_chromeos.h"
#include "chrome/browser/chromeos/settings/device_oauth2_token_service.h"
#include "chrome/browser/chromeos/settings/device_oauth2_token_service_factory.h"
-#include "chrome/browser/policy/cloud/cloud_policy_constants.h"
#include "chrome/browser/policy/proto/chromeos/chrome_device_policy.pb.h"
#include "chrome/browser/policy/proto/cloud/device_management_backend.pb.h"
#include "chromeos/chromeos_switches.h"
+#include "components/policy/core/common/cloud/cloud_policy_constants.h"
#include "google_apis/gaia/gaia_urls.h"
#include "net/http/http_status_code.h"
diff --git a/chrome/browser/chromeos/policy/enrollment_handler_chromeos.h b/chrome/browser/chromeos/policy/enrollment_handler_chromeos.h
index 7730313..c15e146 100644
--- a/chrome/browser/chromeos/policy/enrollment_handler_chromeos.h
+++ b/chrome/browser/chromeos/policy/enrollment_handler_chromeos.h
@@ -15,8 +15,8 @@
#include "chrome/browser/chromeos/policy/device_cloud_policy_manager_chromeos.h"
#include "chrome/browser/chromeos/policy/device_cloud_policy_validator.h"
#include "chrome/browser/chromeos/policy/enterprise_install_attributes.h"
-#include "chrome/browser/policy/cloud/cloud_policy_client.h"
-#include "chrome/browser/policy/cloud/cloud_policy_store.h"
+#include "components/policy/core/common/cloud/cloud_policy_client.h"
+#include "components/policy/core/common/cloud/cloud_policy_store.h"
#include "google_apis/gaia/gaia_oauth_client.h"
namespace base {
diff --git a/chrome/browser/chromeos/policy/enrollment_status_chromeos.h b/chrome/browser/chromeos/policy/enrollment_status_chromeos.h
index 5845c86..f2c4281 100644
--- a/chrome/browser/chromeos/policy/enrollment_status_chromeos.h
+++ b/chrome/browser/chromeos/policy/enrollment_status_chromeos.h
@@ -5,9 +5,9 @@
#ifndef CHROME_BROWSER_CHROMEOS_POLICY_ENROLLMENT_STATUS_CHROMEOS_H_
#define CHROME_BROWSER_CHROMEOS_POLICY_ENROLLMENT_STATUS_CHROMEOS_H_
-#include "chrome/browser/policy/cloud/cloud_policy_constants.h"
-#include "chrome/browser/policy/cloud/cloud_policy_store.h"
-#include "chrome/browser/policy/cloud/cloud_policy_validator.h"
+#include "components/policy/core/common/cloud/cloud_policy_constants.h"
+#include "components/policy/core/common/cloud/cloud_policy_store.h"
+#include "components/policy/core/common/cloud/cloud_policy_validator.h"
namespace policy {
diff --git a/chrome/browser/chromeos/policy/enterprise_install_attributes.h b/chrome/browser/chromeos/policy/enterprise_install_attributes.h
index b4fb2c0..a8e46d3 100644
--- a/chrome/browser/chromeos/policy/enterprise_install_attributes.h
+++ b/chrome/browser/chromeos/policy/enterprise_install_attributes.h
@@ -13,9 +13,9 @@
#include "base/compiler_specific.h"
#include "base/files/file_path.h"
#include "base/memory/weak_ptr.h"
-#include "chrome/browser/policy/cloud/cloud_policy_constants.h"
#include "chromeos/dbus/cryptohome_client.h"
#include "chromeos/dbus/dbus_method_call_status.h"
+#include "components/policy/core/common/cloud/cloud_policy_constants.h"
namespace policy {
diff --git a/chrome/browser/chromeos/policy/login_profile_policy_provider.h b/chrome/browser/chromeos/policy/login_profile_policy_provider.h
index b9fbbd6..e8fbd91 100644
--- a/chrome/browser/chromeos/policy/login_profile_policy_provider.h
+++ b/chrome/browser/chromeos/policy/login_profile_policy_provider.h
@@ -8,8 +8,8 @@
#include "base/basictypes.h"
#include "base/compiler_specific.h"
#include "base/memory/weak_ptr.h"
-#include "chrome/browser/policy/policy_service.h"
#include "components/policy/core/common/configuration_policy_provider.h"
+#include "components/policy/core/common/policy_service.h"
namespace policy {
diff --git a/chrome/browser/chromeos/policy/login_screen_power_management_policy.cc b/chrome/browser/chromeos/policy/login_screen_power_management_policy.cc
index 57a0cd9..2e8ce27 100644
--- a/chrome/browser/chromeos/policy/login_screen_power_management_policy.cc
+++ b/chrome/browser/chromeos/policy/login_screen_power_management_policy.cc
@@ -7,8 +7,8 @@
#include "base/json/json_reader.h"
#include "base/strings/string_number_conversions.h"
#include "base/values.h"
-#include "chrome/browser/policy/configuration_policy_handler.h"
#include "chromeos/dbus/power_policy_controller.h"
+#include "components/policy/core/browser/configuration_policy_handler.h"
#include "components/policy/core/browser/policy_error_map.h"
#include "grit/component_strings.h"
#include "policy/policy_constants.h"
diff --git a/chrome/browser/chromeos/policy/network_configuration_updater.h b/chrome/browser/chromeos/policy/network_configuration_updater.h
index 4b6556b..18cd350 100644
--- a/chrome/browser/chromeos/policy/network_configuration_updater.h
+++ b/chrome/browser/chromeos/policy/network_configuration_updater.h
@@ -10,8 +10,8 @@
#include "base/basictypes.h"
#include "base/compiler_specific.h"
#include "base/memory/scoped_ptr.h"
-#include "chrome/browser/policy/policy_service.h"
#include "components/onc/onc_constants.h"
+#include "components/policy/core/common/policy_service.h"
namespace base {
class DictionaryValue;
diff --git a/chrome/browser/chromeos/policy/network_configuration_updater_unittest.cc b/chrome/browser/chromeos/policy/network_configuration_updater_unittest.cc
index dc33c1d..48d3172 100644
--- a/chrome/browser/chromeos/policy/network_configuration_updater_unittest.cc
+++ b/chrome/browser/chromeos/policy/network_configuration_updater_unittest.cc
@@ -11,7 +11,6 @@
#include "base/values.h"
#include "chrome/browser/chromeos/login/user.h"
#include "chrome/browser/chromeos/policy/user_network_configuration_updater.h"
-#include "chrome/browser/policy/policy_service_impl.h"
#include "chromeos/network/mock_managed_network_configuration_handler.h"
#include "chromeos/network/onc/mock_certificate_importer.h"
#include "chromeos/network/onc/onc_test_utils.h"
@@ -20,6 +19,7 @@
#include "components/policy/core/common/external_data_fetcher.h"
#include "components/policy/core/common/mock_configuration_policy_provider.h"
#include "components/policy/core/common/policy_map.h"
+#include "components/policy/core/common/policy_service_impl.h"
#include "content/public/test/test_browser_thread_bundle.h"
#include "content/public/test/test_utils.h"
#include "net/base/test_data_directory.h"
diff --git a/chrome/browser/chromeos/policy/power_policy_browsertest.cc b/chrome/browser/chromeos/policy/power_policy_browsertest.cc
index 451b99b..d3d6bfe 100644
--- a/chrome/browser/chromeos/policy/power_policy_browsertest.cc
+++ b/chrome/browser/chromeos/policy/power_policy_browsertest.cc
@@ -27,11 +27,6 @@
#include "chrome/browser/chromeos/settings/device_settings_service.h"
#include "chrome/browser/extensions/api/power/power_api_manager.h"
#include "chrome/browser/lifetime/application_lifetime.h"
-#include "chrome/browser/policy/cloud/cloud_policy_core.h"
-#include "chrome/browser/policy/cloud/cloud_policy_store.h"
-#include "chrome/browser/policy/cloud/policy_builder.h"
-#include "chrome/browser/policy/mock_policy_service.h"
-#include "chrome/browser/policy/policy_service.h"
#include "chrome/browser/policy/profile_policy_connector.h"
#include "chrome/browser/policy/profile_policy_connector_factory.h"
#include "chrome/browser/policy/proto/chromeos/chrome_device_policy.pb.h"
@@ -48,7 +43,12 @@
#include "chromeos/dbus/fake_session_manager_client.h"
#include "chromeos/dbus/power_manager/policy.pb.h"
#include "chromeos/dbus/power_policy_controller.h"
+#include "components/policy/core/common/cloud/cloud_policy_core.h"
+#include "components/policy/core/common/cloud/cloud_policy_store.h"
+#include "components/policy/core/common/cloud/policy_builder.h"
#include "components/policy/core/common/external_data_fetcher.h"
+#include "components/policy/core/common/mock_policy_service.h"
+#include "components/policy/core/common/policy_service.h"
#include "content/public/browser/notification_details.h"
#include "content/public/browser/notification_service.h"
#include "content/public/browser/notification_source.h"
diff --git a/chrome/browser/chromeos/policy/stub_enterprise_install_attributes.cc b/chrome/browser/chromeos/policy/stub_enterprise_install_attributes.cc
index 39516a1..5d67f7c 100644
--- a/chrome/browser/chromeos/policy/stub_enterprise_install_attributes.cc
+++ b/chrome/browser/chromeos/policy/stub_enterprise_install_attributes.cc
@@ -6,7 +6,7 @@
#include <string>
-#include "chrome/browser/policy/cloud/cloud_policy_constants.h"
+#include "components/policy/core/common/cloud/cloud_policy_constants.h"
namespace policy {
diff --git a/chrome/browser/chromeos/policy/stub_enterprise_install_attributes.h b/chrome/browser/chromeos/policy/stub_enterprise_install_attributes.h
index 7c91f92..2ddccec 100644
--- a/chrome/browser/chromeos/policy/stub_enterprise_install_attributes.h
+++ b/chrome/browser/chromeos/policy/stub_enterprise_install_attributes.h
@@ -9,7 +9,7 @@
#include "base/basictypes.h"
#include "chrome/browser/chromeos/policy/enterprise_install_attributes.h"
-#include "chrome/browser/policy/cloud/cloud_policy_constants.h"
+#include "components/policy/core/common/cloud/cloud_policy_constants.h"
namespace policy {
diff --git a/chrome/browser/chromeos/policy/user_cloud_external_data_manager.cc b/chrome/browser/chromeos/policy/user_cloud_external_data_manager.cc
index 39f859c..52a7eed 100644
--- a/chrome/browser/chromeos/policy/user_cloud_external_data_manager.cc
+++ b/chrome/browser/chromeos/policy/user_cloud_external_data_manager.cc
@@ -8,8 +8,8 @@
#include "base/memory/scoped_ptr.h"
#include "base/sequenced_task_runner.h"
#include "chrome/browser/chromeos/policy/cloud_external_data_store.h"
-#include "chrome/browser/policy/cloud/cloud_policy_store.h"
-#include "chrome/browser/policy/cloud/resource_cache.h"
+#include "components/policy/core/common/cloud/cloud_policy_store.h"
+#include "components/policy/core/common/cloud/resource_cache.h"
namespace policy {
diff --git a/chrome/browser/chromeos/policy/user_cloud_external_data_manager_browsertest.cc b/chrome/browser/chromeos/policy/user_cloud_external_data_manager_browsertest.cc
index 559e720..edca1fd 100644
--- a/chrome/browser/chromeos/policy/user_cloud_external_data_manager_browsertest.cc
+++ b/chrome/browser/chromeos/policy/user_cloud_external_data_manager_browsertest.cc
@@ -16,16 +16,16 @@
#include "chrome/browser/chromeos/policy/cloud_external_data_manager_base_test_util.h"
#include "chrome/browser/chromeos/policy/user_cloud_policy_manager_chromeos.h"
#include "chrome/browser/chromeos/policy/user_cloud_policy_manager_factory_chromeos.h"
-#include "chrome/browser/policy/cloud/cloud_policy_core.h"
-#include "chrome/browser/policy/policy_service.h"
#include "chrome/browser/policy/profile_policy_connector.h"
#include "chrome/browser/policy/profile_policy_connector_factory.h"
#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/ui/browser.h"
#include "chrome/common/chrome_paths.h"
#include "chrome/test/base/in_process_browser_test.h"
+#include "components/policy/core/common/cloud/cloud_policy_core.h"
#include "components/policy/core/common/external_data_fetcher.h"
#include "components/policy/core/common/policy_map.h"
+#include "components/policy/core/common/policy_service.h"
#include "content/public/test/test_utils.h"
#include "net/test/embedded_test_server/embedded_test_server.h"
#include "policy/policy_constants.h"
diff --git a/chrome/browser/chromeos/policy/user_cloud_policy_manager_chromeos.cc b/chrome/browser/chromeos/policy/user_cloud_policy_manager_chromeos.cc
index 3b9110e..6b65dcb 100644
--- a/chrome/browser/chromeos/policy/user_cloud_policy_manager_chromeos.cc
+++ b/chrome/browser/chromeos/policy/user_cloud_policy_manager_chromeos.cc
@@ -14,10 +14,10 @@
#include "chrome/browser/chromeos/policy/policy_oauth2_token_fetcher.h"
#include "chrome/browser/chromeos/policy/user_cloud_policy_manager_factory_chromeos.h"
#include "chrome/browser/chromeos/profiles/profile_helper.h"
-#include "chrome/browser/policy/cloud/cloud_external_data_manager.h"
-#include "chrome/browser/policy/cloud/cloud_policy_refresh_scheduler.h"
-#include "chrome/browser/policy/cloud/device_management_service.h"
-#include "chrome/browser/policy/cloud/system_policy_request_context.h"
+#include "components/policy/core/common/cloud/cloud_external_data_manager.h"
+#include "components/policy/core/common/cloud/cloud_policy_refresh_scheduler.h"
+#include "components/policy/core/common/cloud/device_management_service.h"
+#include "components/policy/core/common/cloud/system_policy_request_context.h"
#include "components/policy/core/common/policy_pref_names.h"
#include "content/public/common/content_client.h"
#include "net/url_request/url_request_context_getter.h"
diff --git a/chrome/browser/chromeos/policy/user_cloud_policy_manager_chromeos.h b/chrome/browser/chromeos/policy/user_cloud_policy_manager_chromeos.h
index f2bb796..d180a74 100644
--- a/chrome/browser/chromeos/policy/user_cloud_policy_manager_chromeos.h
+++ b/chrome/browser/chromeos/policy/user_cloud_policy_manager_chromeos.h
@@ -14,11 +14,11 @@
#include "base/memory/scoped_ptr.h"
#include "base/time/time.h"
#include "base/timer/timer.h"
-#include "chrome/browser/policy/cloud/cloud_policy_client.h"
-#include "chrome/browser/policy/cloud/cloud_policy_constants.h"
-#include "chrome/browser/policy/cloud/cloud_policy_manager.h"
-#include "chrome/browser/policy/cloud/cloud_policy_service.h"
#include "components/browser_context_keyed_service/browser_context_keyed_service.h"
+#include "components/policy/core/common/cloud/cloud_policy_client.h"
+#include "components/policy/core/common/cloud/cloud_policy_constants.h"
+#include "components/policy/core/common/cloud/cloud_policy_manager.h"
+#include "components/policy/core/common/cloud/cloud_policy_service.h"
class GoogleServiceAuthError;
class PrefService;
diff --git a/chrome/browser/chromeos/policy/user_cloud_policy_manager_chromeos_unittest.cc b/chrome/browser/chromeos/policy/user_cloud_policy_manager_chromeos_unittest.cc
index c217314..d0fdf3d 100644
--- a/chrome/browser/chromeos/policy/user_cloud_policy_manager_chromeos_unittest.cc
+++ b/chrome/browser/chromeos/policy/user_cloud_policy_manager_chromeos_unittest.cc
@@ -17,10 +17,6 @@
#include "base/test/test_simple_task_runner.h"
#include "chrome/browser/chromeos/policy/user_cloud_policy_token_forwarder.h"
#include "chrome/browser/chromeos/profiles/profile_helper.h"
-#include "chrome/browser/policy/cloud/cloud_external_data_manager.h"
-#include "chrome/browser/policy/cloud/mock_cloud_external_data_manager.h"
-#include "chrome/browser/policy/cloud/mock_cloud_policy_store.h"
-#include "chrome/browser/policy/cloud/mock_device_management_service.h"
#include "chrome/browser/policy/proto/cloud/device_management_backend.pb.h"
#include "chrome/browser/prefs/browser_prefs.h"
#include "chrome/browser/prefs/pref_service_syncable.h"
@@ -31,6 +27,10 @@
#include "chrome/test/base/testing_browser_process.h"
#include "chrome/test/base/testing_profile.h"
#include "chrome/test/base/testing_profile_manager.h"
+#include "components/policy/core/common/cloud/cloud_external_data_manager.h"
+#include "components/policy/core/common/cloud/mock_cloud_external_data_manager.h"
+#include "components/policy/core/common/cloud/mock_cloud_policy_store.h"
+#include "components/policy/core/common/cloud/mock_device_management_service.h"
#include "components/policy/core/common/external_data_fetcher.h"
#include "components/policy/core/common/mock_configuration_policy_provider.h"
#include "components/policy/core/common/schema_registry.h"
diff --git a/chrome/browser/chromeos/policy/user_cloud_policy_manager_factory_chromeos.cc b/chrome/browser/chromeos/policy/user_cloud_policy_manager_factory_chromeos.cc
index d852d7d..3e3f531 100644
--- a/chrome/browser/chromeos/policy/user_cloud_policy_manager_factory_chromeos.cc
+++ b/chrome/browser/chromeos/policy/user_cloud_policy_manager_factory_chromeos.cc
@@ -22,8 +22,6 @@
#include "chrome/browser/chromeos/policy/user_cloud_policy_store_chromeos.h"
#include "chrome/browser/chromeos/profiles/profile_helper.h"
#include "chrome/browser/policy/browser_policy_connector.h"
-#include "chrome/browser/policy/cloud/cloud_external_data_manager.h"
-#include "chrome/browser/policy/cloud/device_management_service.h"
#include "chrome/browser/policy/schema_registry_service.h"
#include "chrome/browser/policy/schema_registry_service_factory.h"
#include "chrome/browser/profiles/profile.h"
@@ -31,6 +29,8 @@
#include "chromeos/chromeos_switches.h"
#include "chromeos/dbus/dbus_thread_manager.h"
#include "components/browser_context_keyed_service/browser_context_dependency_manager.h"
+#include "components/policy/core/common/cloud/cloud_external_data_manager.h"
+#include "components/policy/core/common/cloud/device_management_service.h"
#include "content/public/browser/browser_thread.h"
#include "net/url_request/url_request_context_getter.h"
#include "policy/policy_constants.h"
diff --git a/chrome/browser/chromeos/policy/user_cloud_policy_store_chromeos.h b/chrome/browser/chromeos/policy/user_cloud_policy_store_chromeos.h
index e1939f8..39696b48 100644
--- a/chrome/browser/chromeos/policy/user_cloud_policy_store_chromeos.h
+++ b/chrome/browser/chromeos/policy/user_cloud_policy_store_chromeos.h
@@ -14,9 +14,9 @@
#include "base/memory/ref_counted.h"
#include "base/memory/scoped_ptr.h"
#include "base/memory/weak_ptr.h"
-#include "chrome/browser/policy/cloud/cloud_policy_validator.h"
#include "chrome/browser/policy/cloud/user_cloud_policy_store_base.h"
#include "chromeos/dbus/dbus_method_call_status.h"
+#include "components/policy/core/common/cloud/cloud_policy_validator.h"
namespace base {
class SequencedTaskRunner;
diff --git a/chrome/browser/chromeos/policy/user_cloud_policy_store_chromeos_unittest.cc b/chrome/browser/chromeos/policy/user_cloud_policy_store_chromeos_unittest.cc
index 7f0694a..c766137 100644
--- a/chrome/browser/chromeos/policy/user_cloud_policy_store_chromeos_unittest.cc
+++ b/chrome/browser/chromeos/policy/user_cloud_policy_store_chromeos_unittest.cc
@@ -13,12 +13,12 @@
#include "base/memory/scoped_ptr.h"
#include "base/message_loop/message_loop.h"
#include "base/threading/sequenced_worker_pool.h"
-#include "chrome/browser/policy/cloud/cloud_policy_constants.h"
-#include "chrome/browser/policy/cloud/mock_cloud_policy_store.h"
-#include "chrome/browser/policy/cloud/policy_builder.h"
#include "chrome/browser/policy/proto/cloud/device_management_local.pb.h"
#include "chromeos/dbus/mock_cryptohome_client.h"
#include "chromeos/dbus/mock_session_manager_client.h"
+#include "components/policy/core/common/cloud/cloud_policy_constants.h"
+#include "components/policy/core/common/cloud/mock_cloud_policy_store.h"
+#include "components/policy/core/common/cloud/policy_builder.h"
#include "policy/policy_constants.h"
#include "policy/proto/cloud_policy.pb.h"
#include "testing/gmock/include/gmock/gmock.h"
diff --git a/chrome/browser/chromeos/policy/user_cloud_policy_token_forwarder.cc b/chrome/browser/chromeos/policy/user_cloud_policy_token_forwarder.cc
index bc6372c..455cdaf 100644
--- a/chrome/browser/chromeos/policy/user_cloud_policy_token_forwarder.cc
+++ b/chrome/browser/chromeos/policy/user_cloud_policy_token_forwarder.cc
@@ -6,8 +6,8 @@
#include "chrome/browser/chrome_notification_types.h"
#include "chrome/browser/chromeos/policy/user_cloud_policy_manager_chromeos.h"
-#include "chrome/browser/policy/cloud/cloud_policy_core.h"
#include "chrome/browser/signin/profile_oauth2_token_service.h"
+#include "components/policy/core/common/cloud/cloud_policy_core.h"
#include "content/public/browser/notification_source.h"
#include "google_apis/gaia/gaia_constants.h"
diff --git a/chrome/browser/chromeos/policy/user_cloud_policy_token_forwarder.h b/chrome/browser/chromeos/policy/user_cloud_policy_token_forwarder.h
index 8c57185..286dd51 100644
--- a/chrome/browser/chromeos/policy/user_cloud_policy_token_forwarder.h
+++ b/chrome/browser/chromeos/policy/user_cloud_policy_token_forwarder.h
@@ -6,8 +6,8 @@
#define CHROME_BROWSER_CHROMEOS_POLICY_USER_CLOUD_POLICY_TOKEN_FORWARDER_H_
#include "base/basictypes.h"
-#include "chrome/browser/policy/cloud/cloud_policy_service.h"
#include "components/browser_context_keyed_service/browser_context_keyed_service.h"
+#include "components/policy/core/common/cloud/cloud_policy_service.h"
#include "google_apis/gaia/oauth2_token_service.h"
class ProfileOAuth2TokenService;
diff --git a/chrome/browser/chromeos/policy/user_network_configuration_updater_factory.cc b/chrome/browser/chromeos/policy/user_network_configuration_updater_factory.cc
index e22e119..b7f8037 100644
--- a/chrome/browser/chromeos/policy/user_network_configuration_updater_factory.cc
+++ b/chrome/browser/chromeos/policy/user_network_configuration_updater_factory.cc
@@ -11,7 +11,6 @@
#include "chrome/browser/chromeos/policy/user_network_configuration_updater.h"
#include "chrome/browser/chromeos/profiles/profile_helper.h"
#include "chrome/browser/policy/browser_policy_connector.h"
-#include "chrome/browser/policy/cloud/cloud_policy_constants.h"
#include "chrome/browser/policy/profile_policy_connector.h"
#include "chrome/browser/policy/profile_policy_connector_factory.h"
#include "chrome/browser/profiles/incognito_helpers.h"
@@ -20,6 +19,7 @@
#include "chromeos/network/network_handler.h"
#include "chromeos/network/onc/onc_certificate_importer_impl.h"
#include "components/browser_context_keyed_service/browser_context_dependency_manager.h"
+#include "components/policy/core/common/cloud/cloud_policy_constants.h"
namespace policy {
diff --git a/chrome/browser/chromeos/policy/user_policy_disk_cache.cc b/chrome/browser/chromeos/policy/user_policy_disk_cache.cc
index e6a669b..bf48419 100644
--- a/chrome/browser/chromeos/policy/user_policy_disk_cache.cc
+++ b/chrome/browser/chromeos/policy/user_policy_disk_cache.cc
@@ -10,8 +10,8 @@
#include "base/message_loop/message_loop_proxy.h"
#include "base/metrics/histogram.h"
#include "base/sequenced_task_runner.h"
-#include "chrome/browser/policy/cloud/enterprise_metrics.h"
#include "chrome/browser/policy/proto/cloud/device_management_local.pb.h"
+#include "components/policy/core/common/cloud/enterprise_metrics.h"
#include "content/public/browser/browser_thread.h"
namespace em = enterprise_management;
diff --git a/chrome/browser/chromeos/policy/user_policy_token_loader.cc b/chrome/browser/chromeos/policy/user_policy_token_loader.cc
index 0df0966..5a47c84 100644
--- a/chrome/browser/chromeos/policy/user_policy_token_loader.cc
+++ b/chrome/browser/chromeos/policy/user_policy_token_loader.cc
@@ -10,8 +10,8 @@
#include "base/message_loop/message_loop_proxy.h"
#include "base/metrics/histogram.h"
#include "base/sequenced_task_runner.h"
-#include "chrome/browser/policy/cloud/enterprise_metrics.h"
#include "chrome/browser/policy/proto/cloud/device_management_local.pb.h"
+#include "components/policy/core/common/cloud/enterprise_metrics.h"
namespace policy {
diff --git a/chrome/browser/chromeos/proxy_config_service_impl.cc b/chrome/browser/chromeos/proxy_config_service_impl.cc
index 335a309..fe58bc1f 100644
--- a/chrome/browser/chromeos/proxy_config_service_impl.cc
+++ b/chrome/browser/chromeos/proxy_config_service_impl.cc
@@ -15,7 +15,6 @@
#include "chrome/browser/chromeos/login/user_manager.h"
#include "chrome/browser/chromeos/net/proxy_config_handler.h"
#include "chrome/browser/policy/browser_policy_connector.h"
-#include "chrome/browser/policy/cloud/cloud_policy_constants.h"
#include "chrome/browser/prefs/proxy_config_dictionary.h"
#include "chrome/browser/prefs/proxy_prefs.h"
#include "chrome/common/pref_names.h"
@@ -25,6 +24,7 @@
#include "chromeos/network/network_state.h"
#include "chromeos/network/network_state_handler.h"
#include "chromeos/network/onc/onc_utils.h"
+#include "components/policy/core/common/cloud/cloud_policy_constants.h"
namespace chromeos {
diff --git a/chrome/browser/chromeos/settings/cros_settings_unittest.cc b/chrome/browser/chromeos/settings/cros_settings_unittest.cc
index a708c7f..a245993 100644
--- a/chrome/browser/chromeos/settings/cros_settings_unittest.cc
+++ b/chrome/browser/chromeos/settings/cros_settings_unittest.cc
@@ -14,12 +14,12 @@
#include "chrome/browser/chromeos/settings/cros_settings.h"
#include "chrome/browser/chromeos/settings/device_settings_service.h"
#include "chrome/browser/chromeos/settings/device_settings_test_helper.h"
-#include "chrome/browser/policy/cloud/cloud_policy_constants.h"
#include "chrome/browser/policy/proto/chromeos/chrome_device_policy.pb.h"
#include "chrome/browser/policy/proto/cloud/device_management_backend.pb.h"
#include "chrome/test/base/scoped_testing_local_state.h"
#include "chrome/test/base/testing_browser_process.h"
#include "chromeos/settings/cros_settings_names.h"
+#include "components/policy/core/common/cloud/cloud_policy_constants.h"
#include "content/public/test/test_browser_thread.h"
#include "testing/gtest/include/gtest/gtest.h"
diff --git a/chrome/browser/chromeos/settings/device_settings_provider.cc b/chrome/browser/chromeos/settings/device_settings_provider.cc
index 439c271b..fa51598 100644
--- a/chrome/browser/chromeos/settings/device_settings_provider.cc
+++ b/chrome/browser/chromeos/settings/device_settings_provider.cc
@@ -20,7 +20,6 @@
#include "chrome/browser/chromeos/settings/cros_settings.h"
#include "chrome/browser/chromeos/settings/device_settings_cache.h"
#include "chrome/browser/policy/browser_policy_connector.h"
-#include "chrome/browser/policy/cloud/cloud_policy_constants.h"
#include "chrome/browser/policy/proto/cloud/device_management_backend.pb.h"
#include "chrome/browser/ui/options/options_util.h"
#include "chrome/installer/util/google_update_settings.h"
@@ -32,6 +31,7 @@
#include "chromeos/network/network_state_handler.h"
#include "chromeos/network/shill_property_util.h"
#include "chromeos/settings/cros_settings_names.h"
+#include "components/policy/core/common/cloud/cloud_policy_constants.h"
#include "third_party/cros_system_api/dbus/service_constants.h"
using google::protobuf::RepeatedField;
diff --git a/chrome/browser/chromeos/settings/device_settings_service.h b/chrome/browser/chromeos/settings/device_settings_service.h
index d2b516a..1d66569 100644
--- a/chrome/browser/chromeos/settings/device_settings_service.h
+++ b/chrome/browser/chromeos/settings/device_settings_service.h
@@ -15,9 +15,9 @@
#include "base/memory/ref_counted.h"
#include "base/memory/scoped_ptr.h"
#include "base/observer_list.h"
-#include "chrome/browser/policy/cloud/cloud_policy_validator.h"
#include "chromeos/cert_loader.h"
#include "chromeos/dbus/session_manager_client.h"
+#include "components/policy/core/common/cloud/cloud_policy_validator.h"
namespace crypto {
class RSAPrivateKey;
diff --git a/chrome/browser/chromeos/settings/session_manager_operation.cc b/chrome/browser/chromeos/settings/session_manager_operation.cc
index e3718f9..bbeaed3 100644
--- a/chrome/browser/chromeos/settings/session_manager_operation.cc
+++ b/chrome/browser/chromeos/settings/session_manager_operation.cc
@@ -13,9 +13,9 @@
#include "base/threading/sequenced_worker_pool.h"
#include "base/time/time.h"
#include "chrome/browser/chromeos/settings/owner_key_util.h"
-#include "chrome/browser/policy/cloud/cloud_policy_constants.h"
#include "chrome/browser/policy/proto/chromeos/chrome_device_policy.pb.h"
#include "chrome/browser/policy/proto/cloud/device_management_backend.pb.h"
+#include "components/policy/core/common/cloud/cloud_policy_constants.h"
#include "content/public/browser/browser_thread.h"
#include "crypto/rsa_private_key.h"
#include "crypto/signature_creator.h"
diff --git a/chrome/browser/chromeos/settings/session_manager_operation_unittest.cc b/chrome/browser/chromeos/settings/session_manager_operation_unittest.cc
index 1023aa0..ac77d05 100644
--- a/chrome/browser/chromeos/settings/session_manager_operation_unittest.cc
+++ b/chrome/browser/chromeos/settings/session_manager_operation_unittest.cc
@@ -12,11 +12,11 @@
#include "base/message_loop/message_loop.h"
#include "chrome/browser/chromeos/settings/device_settings_test_helper.h"
#include "chrome/browser/chromeos/settings/mock_owner_key_util.h"
-#include "chrome/browser/policy/cloud/cloud_policy_constants.h"
-#include "chrome/browser/policy/cloud/cloud_policy_validator.h"
-#include "chrome/browser/policy/cloud/policy_builder.h"
#include "chrome/browser/policy/proto/chromeos/chrome_device_policy.pb.h"
#include "chrome/browser/policy/proto/cloud/device_management_backend.pb.h"
+#include "components/policy/core/common/cloud/cloud_policy_constants.h"
+#include "components/policy/core/common/cloud/cloud_policy_validator.h"
+#include "components/policy/core/common/cloud/policy_builder.h"
#include "content/public/test/test_browser_thread.h"
#include "crypto/rsa_private_key.h"
#include "testing/gmock/include/gmock/gmock.h"
diff --git a/chrome/browser/chromeos/system/ash_system_tray_delegate.cc b/chrome/browser/chromeos/system/ash_system_tray_delegate.cc
index e1f6c83..1e3fcf0 100644
--- a/chrome/browser/chromeos/system/ash_system_tray_delegate.cc
+++ b/chrome/browser/chromeos/system/ash_system_tray_delegate.cc
@@ -71,7 +71,6 @@
#include "chrome/browser/google/google_util.h"
#include "chrome/browser/lifetime/application_lifetime.h"
#include "chrome/browser/policy/browser_policy_connector.h"
-#include "chrome/browser/policy/cloud/cloud_policy_store.h"
#include "chrome/browser/profiles/profile_manager.h"
#include "chrome/browser/ui/ash/volume_controller_chromeos.h"
#include "chrome/browser/ui/browser.h"
@@ -92,6 +91,7 @@
#include "chromeos/ime/input_method_manager.h"
#include "chromeos/ime/xkeyboard.h"
#include "chromeos/login/login_state.h"
+#include "components/policy/core/common/cloud/cloud_policy_store.h"
#include "content/public/browser/browser_thread.h"
#include "content/public/browser/notification_observer.h"
#include "content/public/browser/notification_service.h"
diff --git a/chrome/browser/download/download_dir_policy_handler.h b/chrome/browser/download/download_dir_policy_handler.h
index 3620ef6..2b26689 100644
--- a/chrome/browser/download/download_dir_policy_handler.h
+++ b/chrome/browser/download/download_dir_policy_handler.h
@@ -5,7 +5,7 @@
#ifndef CHROME_BROWSER_DOWNLOAD_DOWNLOAD_DIR_POLICY_HANDLER_H_
#define CHROME_BROWSER_DOWNLOAD_DOWNLOAD_DIR_POLICY_HANDLER_H_
-#include "chrome/browser/policy/configuration_policy_handler.h"
+#include "components/policy/core/browser/configuration_policy_handler.h"
class PrefValueMap;
diff --git a/chrome/browser/download/download_dir_policy_handler_unittest.cc b/chrome/browser/download/download_dir_policy_handler_unittest.cc
index 503f3b4..49e6ae2 100644
--- a/chrome/browser/download/download_dir_policy_handler_unittest.cc
+++ b/chrome/browser/download/download_dir_policy_handler_unittest.cc
@@ -5,9 +5,9 @@
#include "base/values.h"
#include "chrome/browser/download/download_dir_policy_handler.h"
#include "chrome/browser/download/download_prefs.h"
-#include "chrome/browser/policy/configuration_policy_pref_store.h"
-#include "chrome/browser/policy/configuration_policy_pref_store_unittest.h"
+#include "chrome/browser/policy/configuration_policy_pref_store_test.h"
#include "chrome/common/pref_names.h"
+#include "components/policy/core/browser/configuration_policy_pref_store.h"
#include "components/policy/core/common/policy_map.h"
#include "policy/policy_constants.h"
diff --git a/chrome/browser/extensions/api/enterprise_platform_keys_private/enterprise_platform_keys_private_api_unittest.cc b/chrome/browser/extensions/api/enterprise_platform_keys_private/enterprise_platform_keys_private_api_unittest.cc
index b848f4d..90f6425 100644
--- a/chrome/browser/extensions/api/enterprise_platform_keys_private/enterprise_platform_keys_private_api_unittest.cc
+++ b/chrome/browser/extensions/api/enterprise_platform_keys_private/enterprise_platform_keys_private_api_unittest.cc
@@ -15,7 +15,6 @@
#include "chrome/browser/chromeos/policy/stub_enterprise_install_attributes.h"
#include "chrome/browser/chromeos/settings/stub_cros_settings_provider.h"
#include "chrome/browser/extensions/extension_function_test_utils.h"
-#include "chrome/browser/policy/cloud/cloud_policy_constants.h"
#include "chrome/common/pref_names.h"
#include "chrome/test/base/browser_with_test_window_test.h"
#include "chromeos/attestation/attestation_constants.h"
@@ -25,6 +24,7 @@
#include "chromeos/dbus/dbus_method_call_status.h"
#include "chromeos/dbus/mock_cryptohome_client.h"
#include "chromeos/settings/cros_settings_provider.h"
+#include "components/policy/core/common/cloud/cloud_policy_constants.h"
#include "testing/gmock/include/gmock/gmock.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "third_party/cros_system_api/dbus/service_constants.h"
diff --git a/chrome/browser/extensions/api/storage/managed_value_store_cache.h b/chrome/browser/extensions/api/storage/managed_value_store_cache.h
index 6e08b14..07c802f 100644
--- a/chrome/browser/extensions/api/storage/managed_value_store_cache.h
+++ b/chrome/browser/extensions/api/storage/managed_value_store_cache.h
@@ -16,7 +16,7 @@
#include "base/memory/scoped_ptr.h"
#include "chrome/browser/extensions/api/storage/settings_observer.h"
#include "chrome/browser/extensions/api/storage/value_store_cache.h"
-#include "chrome/browser/policy/policy_service.h"
+#include "components/policy/core/common/policy_service.h"
class Profile;
diff --git a/chrome/browser/extensions/policy_handlers.h b/chrome/browser/extensions/policy_handlers.h
index 4446238..7460d67 100644
--- a/chrome/browser/extensions/policy_handlers.h
+++ b/chrome/browser/extensions/policy_handlers.h
@@ -7,7 +7,7 @@
#include "base/memory/scoped_ptr.h"
#include "base/values.h"
-#include "chrome/browser/policy/configuration_policy_handler.h"
+#include "components/policy/core/browser/configuration_policy_handler.h"
namespace policy {
class PolicyMap;
diff --git a/chrome/browser/io_thread.cc b/chrome/browser/io_thread.cc
index 51a742d..770fa84 100644
--- a/chrome/browser/io_thread.cc
+++ b/chrome/browser/io_thread.cc
@@ -41,10 +41,10 @@
#include "chrome/browser/net/proxy_service_factory.h"
#include "chrome/browser/net/sdch_dictionary_fetcher.h"
#include "chrome/browser/net/spdyproxy/http_auth_handler_spdyproxy.h"
-#include "chrome/browser/policy/policy_service.h"
#include "chrome/common/chrome_switches.h"
#include "chrome/common/pref_names.h"
#include "chrome/common/url_constants.h"
+#include "components/policy/core/common/policy_service.h"
#include "content/public/browser/browser_thread.h"
#include "net/base/host_mapping_rules.h"
#include "net/base/net_util.h"
diff --git a/chrome/browser/net/disk_cache_dir_policy_handler.h b/chrome/browser/net/disk_cache_dir_policy_handler.h
index 6188f6c..d553aac 100644
--- a/chrome/browser/net/disk_cache_dir_policy_handler.h
+++ b/chrome/browser/net/disk_cache_dir_policy_handler.h
@@ -7,7 +7,7 @@
#include "base/basictypes.h"
#include "base/compiler_specific.h"
-#include "chrome/browser/policy/configuration_policy_handler.h"
+#include "components/policy/core/browser/configuration_policy_handler.h"
namespace policy {
diff --git a/chrome/browser/net/proxy_policy_handler.cc b/chrome/browser/net/proxy_policy_handler.cc
index 9e848b7..f1123df 100644
--- a/chrome/browser/net/proxy_policy_handler.cc
+++ b/chrome/browser/net/proxy_policy_handler.cc
@@ -8,10 +8,10 @@
#include "base/prefs/pref_value_map.h"
#include "base/strings/string_number_conversions.h"
#include "base/values.h"
-#include "chrome/browser/policy/configuration_policy_handler.h"
#include "chrome/browser/prefs/proxy_config_dictionary.h"
#include "chrome/browser/prefs/proxy_prefs.h"
#include "chrome/common/pref_names.h"
+#include "components/policy/core/browser/configuration_policy_handler.h"
#include "components/policy/core/browser/policy_error_map.h"
#include "components/policy/core/common/policy_map.h"
#include "grit/component_strings.h"
diff --git a/chrome/browser/net/proxy_policy_handler.h b/chrome/browser/net/proxy_policy_handler.h
index b4208d4..2af0a65 100644
--- a/chrome/browser/net/proxy_policy_handler.h
+++ b/chrome/browser/net/proxy_policy_handler.h
@@ -8,7 +8,7 @@
#include <string>
#include "base/basictypes.h"
-#include "chrome/browser/policy/configuration_policy_handler.h"
+#include "components/policy/core/browser/configuration_policy_handler.h"
namespace policy {
diff --git a/chrome/browser/net/proxy_policy_handler_unittest.cc b/chrome/browser/net/proxy_policy_handler_unittest.cc
index bbaa879..023eb26 100644
--- a/chrome/browser/net/proxy_policy_handler_unittest.cc
+++ b/chrome/browser/net/proxy_policy_handler_unittest.cc
@@ -8,13 +8,13 @@
#include "base/memory/scoped_ptr.h"
#include "base/values.h"
#include "chrome/browser/net/proxy_policy_handler.h"
-#include "chrome/browser/policy/configuration_policy_pref_store.h"
-#include "chrome/browser/policy/configuration_policy_pref_store_unittest.h"
-#include "chrome/browser/policy/policy_service_impl.h"
+#include "chrome/browser/policy/configuration_policy_pref_store_test.h"
#include "chrome/browser/policy/policy_transformations.h"
#include "chrome/browser/prefs/proxy_config_dictionary.h"
#include "chrome/browser/prefs/proxy_prefs.h"
#include "chrome/common/pref_names.h"
+#include "components/policy/core/browser/configuration_policy_pref_store.h"
+#include "components/policy/core/common/policy_service_impl.h"
#include "policy/policy_constants.h"
#include "testing/gtest/include/gtest/gtest.h"
diff --git a/chrome/browser/policy/DEPS b/chrome/browser/policy/DEPS
index 36c505a..c32324a 100644
--- a/chrome/browser/policy/DEPS
+++ b/chrome/browser/policy/DEPS
@@ -1,56 +1,8 @@
-# The //chrome/browser/policy code is being converted into a component at
-# //components/policy. This DEPS file is temporarily restricting the include
-# rules for this code; once all the exceptions are fixed then the code will
-# be moved, and this file will be removed.
-# http://crbug.com/271392
-
include_rules = [
- "-chrome",
- "-chromeos",
- "-content",
- "+chrome/browser/policy",
- "+components/json_schema",
+ "+chrome",
+ "+chromeos",
+ "+content/public/browser",
+ "+content/public/common",
+ "+content/public/test",
+ "+content/test/net",
]
-
-specific_include_rules = {
- # These files will stay.
- r"(browser_policy_connector|"
- r"configuration_policy_handler_android|"
- r"configuration_policy_handler_list_factory|"
- r"file_selection_dialogs_policy_handler|"
- r"file_selection_dialogs_policy_handler_unittest|"
- r"generate_policy_source_unittest|"
- r"javascript_policy_handler|"
- r"javascript_policy_handler_unittest|"
- r"managed_mode_policy_provider|"
- r"policy_browsertest|"
- r"policy_path_parser|"
- r"policy_path_parser_linux|"
- r"policy_path_parser_mac|"
- r"policy_path_parser_unittest|"
- r"policy_path_parser_win|"
- r"policy_prefs_browsertest|"
- r"policy_transformations|"
- r"policy_transformations_unittest|"
- r"profile_policy_connector|"
- r"profile_policy_connector_factory|"
- r"url_blacklist_manager|"
- r"url_blacklist_manager_unittest|"
- r"url_blacklist_policy_handler|"
- r"url_blacklist_policy_handler_unittest)"
- r"\.(cc|h)": [
- "+chrome",
- "+chromeos",
- "+content/public/browser",
- "+content/public/common",
- "+content/public/test",
- "+content/test/net",
- ],
-
- # These will go in the component but can use the public content API.
- r"(schema_registry_service_factory)"
- r"\.(cc|h)": [
- "+content/public/browser",
- "+content/public/common",
- ],
-}
diff --git a/chrome/browser/policy/autofill_policy_handler.h b/chrome/browser/policy/autofill_policy_handler.h
index a43908a..4668efb8 100644
--- a/chrome/browser/policy/autofill_policy_handler.h
+++ b/chrome/browser/policy/autofill_policy_handler.h
@@ -5,7 +5,7 @@
#ifndef CHROME_BROWSER_POLICY_AUTOFILL_POLICY_HANDLER_H_
#define CHROME_BROWSER_POLICY_AUTOFILL_POLICY_HANDLER_H_
-#include "chrome/browser/policy/configuration_policy_handler.h"
+#include "components/policy/core/browser/configuration_policy_handler.h"
class PrefValueMap;
diff --git a/chrome/browser/policy/browser_policy_connector.cc b/chrome/browser/policy/browser_policy_connector.cc
index 04c46cc..a3bdf8b 100644
--- a/chrome/browser/policy/browser_policy_connector.cc
+++ b/chrome/browser/policy/browser_policy_connector.cc
@@ -25,22 +25,22 @@
#include "base/sys_info.h"
#include "base/threading/sequenced_worker_pool.h"
#include "chrome/browser/browser_process.h"
-#include "chrome/browser/policy/cloud/cloud_policy_client.h"
-#include "chrome/browser/policy/cloud/cloud_policy_refresh_scheduler.h"
-#include "chrome/browser/policy/cloud/cloud_policy_service.h"
-#include "chrome/browser/policy/cloud/device_management_service.h"
#include "chrome/browser/policy/configuration_policy_handler_list_factory.h"
-#include "chrome/browser/policy/policy_service_impl.h"
-#include "chrome/browser/policy/policy_statistics_collector.h"
#include "chrome/browser/policy/policy_transformations.h"
#include "chrome/common/chrome_paths.h"
#include "chrome/common/chrome_switches.h"
#include "chrome/common/chrome_version_info.h"
#include "chrome/common/pref_names.h"
#include "components/policy/core/common/async_policy_provider.h"
+#include "components/policy/core/common/cloud/cloud_policy_client.h"
+#include "components/policy/core/common/cloud/cloud_policy_refresh_scheduler.h"
+#include "components/policy/core/common/cloud/cloud_policy_service.h"
+#include "components/policy/core/common/cloud/device_management_service.h"
#include "components/policy/core/common/configuration_policy_provider.h"
#include "components/policy/core/common/policy_namespace.h"
#include "components/policy/core/common/policy_pref_names.h"
+#include "components/policy/core/common/policy_service_impl.h"
+#include "components/policy/core/common/policy_statistics_collector.h"
#include "components/policy/core/common/schema.h"
#include "content/public/browser/browser_thread.h"
#include "content/public/common/content_client.h"
@@ -53,13 +53,13 @@
#include "url/gurl.h"
#if defined(OS_WIN)
-#include "chrome/browser/policy/policy_loader_win.h"
+#include "components/policy/core/common/policy_loader_win.h"
#elif defined(OS_MACOSX) && !defined(OS_IOS)
#include <CoreFoundation/CoreFoundation.h>
-#include "chrome/browser/policy/policy_loader_mac.h"
+#include "components/policy/core/common/policy_loader_mac.h"
#include "components/policy/core/common/preferences_mac.h"
#elif defined(OS_POSIX) && !defined(OS_ANDROID)
-#include "chrome/browser/policy/config_dir_policy_loader.h"
+#include "components/policy/core/common/config_dir_policy_loader.h"
#endif
#if defined(OS_CHROMEOS)
diff --git a/chrome/browser/policy/browser_policy_connector.h b/chrome/browser/policy/browser_policy_connector.h
index 268b337..49a6899 100644
--- a/chrome/browser/policy/browser_policy_connector.h
+++ b/chrome/browser/policy/browser_policy_connector.h
@@ -11,8 +11,8 @@
#include "base/memory/ref_counted.h"
#include "base/memory/scoped_ptr.h"
#include "base/memory/weak_ptr.h"
-#include "chrome/browser/policy/cloud/cloud_policy_constants.h"
-#include "chrome/browser/policy/configuration_policy_handler_list.h"
+#include "components/policy/core/browser/configuration_policy_handler_list.h"
+#include "components/policy/core/common/cloud/cloud_policy_constants.h"
#include "components/policy/core/common/schema.h"
#include "components/policy/core/common/schema_registry.h"
diff --git a/chrome/browser/policy/cloud/DEPS b/chrome/browser/policy/cloud/DEPS
index 788d27a..30af644 100644
--- a/chrome/browser/policy/cloud/DEPS
+++ b/chrome/browser/policy/cloud/DEPS
@@ -19,6 +19,9 @@ specific_include_rules = {
r"component_cloud_policy_browsertest|"
r"device_management_service_browsertest|"
r"test_request_interceptor|"
+ r"user_cloud_policy_invalidator|"
+ r"user_cloud_policy_invalidator_factory|"
+ r"user_cloud_policy_manager_factory|"
r"user_policy_signin_service_android|"
r"user_policy_signin_service_base|"
r"user_policy_signin_service|"
@@ -49,30 +52,4 @@ specific_include_rules = {
r"cloud_policy_invalidator_unittest\.cc": [
"+chrome/browser/invalidation/fake_invalidation_service.h",
],
-
- r"cloud_policy_manager_unittest\.cc": [
- "+chrome/browser/invalidation/fake_invalidation_service.h",
- ],
-
- r"user_cloud_policy_invalidator\.cc": [
- "+chrome/browser/chrome_notification_types.h",
- "+chrome/browser/invalidation/invalidation_service_factory.h",
- "+content/public/browser/notification_source.h",
- ],
-
- r"user_cloud_policy_invalidator_factory\.cc": [
- "+chrome/browser/invalidation/invalidation_service_factory.h",
- "+chrome/browser/profiles/profile.h",
- "+chrome/browser/chromeos/policy/user_cloud_policy_manager_chromeos.h",
- "+chrome/browser/chromeos/policy/user_cloud_policy_manager_factory_chromeos.h",
- ],
-
- r"user_cloud_policy_invalidator\.h": [
- "+content/public/browser/notification_observer.h",
- "+content/public/browser/notification_registrar.h",
- ],
-
- r"user_cloud_policy_manager_factory\.cc": [
- "+content/public/browser/browser_context.h",
- ],
}
diff --git a/chrome/browser/policy/cloud/cloud_policy_browsertest.cc b/chrome/browser/policy/cloud/cloud_policy_browsertest.cc
index cdf8915..f487ccf 100644
--- a/chrome/browser/policy/cloud/cloud_policy_browsertest.cc
+++ b/chrome/browser/policy/cloud/cloud_policy_browsertest.cc
@@ -17,20 +17,20 @@
#include "chrome/browser/invalidation/fake_invalidation_service.h"
#include "chrome/browser/invalidation/invalidation_service_factory.h"
#include "chrome/browser/policy/browser_policy_connector.h"
-#include "chrome/browser/policy/cloud/cloud_policy_client.h"
-#include "chrome/browser/policy/cloud/cloud_policy_constants.h"
-#include "chrome/browser/policy/cloud/mock_cloud_policy_client.h"
-#include "chrome/browser/policy/policy_service.h"
#include "chrome/browser/policy/profile_policy_connector.h"
#include "chrome/browser/policy/profile_policy_connector_factory.h"
#include "chrome/browser/policy/test/local_policy_test_server.h"
-#include "chrome/browser/policy/test/policy_test_utils.h"
#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/ui/browser.h"
#include "chrome/common/chrome_switches.h"
#include "chrome/test/base/in_process_browser_test.h"
+#include "components/policy/core/common/cloud/cloud_policy_client.h"
+#include "components/policy/core/common/cloud/cloud_policy_constants.h"
+#include "components/policy/core/common/cloud/mock_cloud_policy_client.h"
#include "components/policy/core/common/external_data_fetcher.h"
#include "components/policy/core/common/policy_map.h"
+#include "components/policy/core/common/policy_service.h"
+#include "components/policy/core/common/policy_test_utils.h"
#include "content/public/browser/browser_thread.h"
#include "content/public/browser/notification_service.h"
#include "content/public/browser/notification_source.h"
diff --git a/chrome/browser/policy/cloud/cloud_policy_invalidator.cc b/chrome/browser/policy/cloud/cloud_policy_invalidator.cc
index 733b157..57fdc4c 100644
--- a/chrome/browser/policy/cloud/cloud_policy_invalidator.cc
+++ b/chrome/browser/policy/cloud/cloud_policy_invalidator.cc
@@ -15,9 +15,9 @@
#include "base/time/time.h"
#include "base/values.h"
#include "chrome/browser/invalidation/invalidation_service.h"
-#include "chrome/browser/policy/cloud/cloud_policy_client.h"
-#include "chrome/browser/policy/cloud/cloud_policy_refresh_scheduler.h"
-#include "chrome/browser/policy/cloud/enterprise_metrics.h"
+#include "components/policy/core/common/cloud/cloud_policy_client.h"
+#include "components/policy/core/common/cloud/cloud_policy_refresh_scheduler.h"
+#include "components/policy/core/common/cloud/enterprise_metrics.h"
#include "components/policy/core/common/policy_switches.h"
#include "policy/policy_constants.h"
#include "sync/notifier/object_id_invalidation_map.h"
diff --git a/chrome/browser/policy/cloud/cloud_policy_invalidator.h b/chrome/browser/policy/cloud/cloud_policy_invalidator.h
index a007a2d..f86016a 100644
--- a/chrome/browser/policy/cloud/cloud_policy_invalidator.h
+++ b/chrome/browser/policy/cloud/cloud_policy_invalidator.h
@@ -13,8 +13,8 @@
#include "base/memory/scoped_ptr.h"
#include "base/memory/weak_ptr.h"
#include "base/threading/thread_checker.h"
-#include "chrome/browser/policy/cloud/cloud_policy_core.h"
-#include "chrome/browser/policy/cloud/cloud_policy_store.h"
+#include "components/policy/core/common/cloud/cloud_policy_core.h"
+#include "components/policy/core/common/cloud/cloud_policy_store.h"
#include "google/cacheinvalidation/include/types.h"
#include "sync/internal_api/public/base/invalidation.h"
#include "sync/notifier/invalidation_handler.h"
diff --git a/chrome/browser/policy/cloud/cloud_policy_invalidator_unittest.cc b/chrome/browser/policy/cloud/cloud_policy_invalidator_unittest.cc
index adccdb1..0df14d4 100644
--- a/chrome/browser/policy/cloud/cloud_policy_invalidator_unittest.cc
+++ b/chrome/browser/policy/cloud/cloud_policy_invalidator_unittest.cc
@@ -18,14 +18,14 @@
#include "base/time/time.h"
#include "base/values.h"
#include "chrome/browser/invalidation/fake_invalidation_service.h"
-#include "chrome/browser/policy/cloud/cloud_policy_constants.h"
-#include "chrome/browser/policy/cloud/cloud_policy_core.h"
#include "chrome/browser/policy/cloud/cloud_policy_invalidator.h"
-#include "chrome/browser/policy/cloud/cloud_policy_refresh_scheduler.h"
-#include "chrome/browser/policy/cloud/enterprise_metrics.h"
-#include "chrome/browser/policy/cloud/mock_cloud_policy_client.h"
-#include "chrome/browser/policy/cloud/mock_cloud_policy_store.h"
#include "chrome/browser/policy/proto/cloud/device_management_backend.pb.h"
+#include "components/policy/core/common/cloud/cloud_policy_constants.h"
+#include "components/policy/core/common/cloud/cloud_policy_core.h"
+#include "components/policy/core/common/cloud/cloud_policy_refresh_scheduler.h"
+#include "components/policy/core/common/cloud/enterprise_metrics.h"
+#include "components/policy/core/common/cloud/mock_cloud_policy_client.h"
+#include "components/policy/core/common/cloud/mock_cloud_policy_store.h"
#include "components/policy/core/common/policy_types.h"
#include "policy/policy_constants.h"
#include "sync/notifier/invalidation_util.h"
diff --git a/chrome/browser/policy/cloud/cloud_policy_manager_browsertest.cc b/chrome/browser/policy/cloud/cloud_policy_manager_browsertest.cc
index 5146b6e..c887c2c 100644
--- a/chrome/browser/policy/cloud/cloud_policy_manager_browsertest.cc
+++ b/chrome/browser/policy/cloud/cloud_policy_manager_browsertest.cc
@@ -7,15 +7,15 @@
#include "base/run_loop.h"
#include "chrome/browser/browser_process.h"
#include "chrome/browser/policy/browser_policy_connector.h"
-#include "chrome/browser/policy/cloud/cloud_policy_client.h"
-#include "chrome/browser/policy/cloud/mock_cloud_policy_client.h"
#include "chrome/browser/policy/cloud/test_request_interceptor.h"
#include "chrome/browser/policy/proto/cloud/device_management_backend.pb.h"
-#include "chrome/browser/policy/test/policy_test_utils.h"
#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/ui/browser.h"
#include "chrome/common/chrome_switches.h"
#include "chrome/test/base/in_process_browser_test.h"
+#include "components/policy/core/common/cloud/cloud_policy_client.h"
+#include "components/policy/core/common/cloud/mock_cloud_policy_client.h"
+#include "components/policy/core/common/policy_test_utils.h"
#include "content/public/browser/browser_thread.h"
#include "net/base/net_errors.h"
#include "net/url_request/url_request_context_getter.h"
diff --git a/chrome/browser/policy/cloud/component_cloud_policy_browsertest.cc b/chrome/browser/policy/cloud/component_cloud_policy_browsertest.cc
index b80ef5d..41e65ea 100644
--- a/chrome/browser/policy/cloud/component_cloud_policy_browsertest.cc
+++ b/chrome/browser/policy/cloud/component_cloud_policy_browsertest.cc
@@ -16,19 +16,19 @@
#include "chrome/browser/extensions/extension_browsertest.h"
#include "chrome/browser/extensions/extension_test_message_listener.h"
#include "chrome/browser/policy/browser_policy_connector.h"
-#include "chrome/browser/policy/cloud/cloud_policy_constants.h"
-#include "chrome/browser/policy/cloud/mock_cloud_policy_client.h"
-#include "chrome/browser/policy/policy_service.h"
#include "chrome/browser/policy/profile_policy_connector.h"
#include "chrome/browser/policy/profile_policy_connector_factory.h"
#include "chrome/browser/policy/proto/cloud/chrome_extension_policy.pb.h"
#include "chrome/browser/policy/test/local_policy_test_server.h"
-#include "chrome/browser/policy/test/policy_test_utils.h"
#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/ui/browser.h"
#include "chrome/common/chrome_paths.h"
#include "chrome/common/chrome_switches.h"
+#include "components/policy/core/common/cloud/cloud_policy_constants.h"
+#include "components/policy/core/common/cloud/mock_cloud_policy_client.h"
+#include "components/policy/core/common/policy_service.h"
#include "components/policy/core/common/policy_switches.h"
+#include "components/policy/core/common/policy_test_utils.h"
#include "extensions/common/extension.h"
#include "net/url_request/url_request_context_getter.h"
#include "policy/proto/cloud_policy.pb.h"
diff --git a/chrome/browser/policy/cloud/device_management_service_browsertest.cc b/chrome/browser/policy/cloud/device_management_service_browsertest.cc
index fe95063..6ec8b7d 100644
--- a/chrome/browser/policy/cloud/device_management_service_browsertest.cc
+++ b/chrome/browser/policy/cloud/device_management_service_browsertest.cc
@@ -8,12 +8,12 @@
#include "base/message_loop/message_loop.h"
#include "base/stl_util.h"
#include "chrome/browser/browser_process.h"
-#include "chrome/browser/policy/cloud/cloud_policy_constants.h"
-#include "chrome/browser/policy/cloud/device_management_service.h"
-#include "chrome/browser/policy/cloud/mock_device_management_service.h"
#include "chrome/browser/policy/cloud/test_request_interceptor.h"
#include "chrome/browser/policy/test/local_policy_test_server.h"
#include "chrome/test/base/in_process_browser_test.h"
+#include "components/policy/core/common/cloud/cloud_policy_constants.h"
+#include "components/policy/core/common/cloud/device_management_service.h"
+#include "components/policy/core/common/cloud/mock_device_management_service.h"
#include "content/public/browser/browser_thread.h"
#include "net/base/upload_bytes_element_reader.h"
#include "net/base/upload_data_stream.h"
diff --git a/chrome/browser/policy/cloud/message_util.h b/chrome/browser/policy/cloud/message_util.h
deleted file mode 100644
index 324cf70..0000000
--- a/chrome/browser/policy/cloud/message_util.h
+++ /dev/null
@@ -1,30 +0,0 @@
-// Copyright (c) 2012 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#ifndef CHROME_BROWSER_POLICY_CLOUD_MESSAGE_UTIL_H_
-#define CHROME_BROWSER_POLICY_CLOUD_MESSAGE_UTIL_H_
-
-#include "base/strings/string16.h"
-#include "chrome/browser/policy/cloud/cloud_policy_constants.h"
-#include "chrome/browser/policy/cloud/cloud_policy_store.h"
-#include "chrome/browser/policy/cloud/cloud_policy_validator.h"
-
-namespace policy {
-
-// Returns a string describing |status| suitable for display in UI.
-string16 FormatDeviceManagementStatus(DeviceManagementStatus status);
-
-// Returns a string describing |validation_status| suitable for display in UI.
-string16 FormatValidationStatus(
- CloudPolicyValidatorBase::Status validation_status);
-
-// Returns a textual description of |store_status| for display in the UI. If
-// |store_status| is STATUS_VALIDATION_FAILED, |validation_status| will be
-// consulted to create a description of the validation failure.
-string16 FormatStoreStatus(CloudPolicyStore::Status store_status,
- CloudPolicyValidatorBase::Status validation_status);
-
-} // namespace policy
-
-#endif // CHROME_BROWSER_POLICY_CLOUD_MESSAGE_UTIL_H_
diff --git a/chrome/browser/policy/cloud/user_cloud_policy_invalidator.cc b/chrome/browser/policy/cloud/user_cloud_policy_invalidator.cc
index 896f151..6092291 100644
--- a/chrome/browser/policy/cloud/user_cloud_policy_invalidator.cc
+++ b/chrome/browser/policy/cloud/user_cloud_policy_invalidator.cc
@@ -8,7 +8,7 @@
#include "base/message_loop/message_loop_proxy.h"
#include "chrome/browser/chrome_notification_types.h"
#include "chrome/browser/invalidation/invalidation_service_factory.h"
-#include "chrome/browser/policy/cloud/cloud_policy_manager.h"
+#include "components/policy/core/common/cloud/cloud_policy_manager.h"
#include "content/public/browser/notification_source.h"
namespace policy {
diff --git a/chrome/browser/policy/cloud/user_cloud_policy_manager.cc b/chrome/browser/policy/cloud/user_cloud_policy_manager.cc
index 77e3ada..04c1edc 100644
--- a/chrome/browser/policy/cloud/user_cloud_policy_manager.cc
+++ b/chrome/browser/policy/cloud/user_cloud_policy_manager.cc
@@ -7,11 +7,11 @@
#include "base/bind.h"
#include "base/bind_helpers.h"
#include "base/sequenced_task_runner.h"
-#include "chrome/browser/policy/cloud/cloud_external_data_manager.h"
-#include "chrome/browser/policy/cloud/cloud_policy_constants.h"
-#include "chrome/browser/policy/cloud/cloud_policy_service.h"
#include "chrome/browser/policy/cloud/user_cloud_policy_manager_factory.h"
#include "chrome/browser/policy/cloud/user_cloud_policy_store.h"
+#include "components/policy/core/common/cloud/cloud_external_data_manager.h"
+#include "components/policy/core/common/cloud/cloud_policy_constants.h"
+#include "components/policy/core/common/cloud/cloud_policy_service.h"
#include "components/policy/core/common/policy_pref_names.h"
#include "components/policy/core/common/policy_types.h"
#include "net/url_request/url_request_context_getter.h"
diff --git a/chrome/browser/policy/cloud/user_cloud_policy_manager.h b/chrome/browser/policy/cloud/user_cloud_policy_manager.h
index 00d4b6f..7800cf9 100644
--- a/chrome/browser/policy/cloud/user_cloud_policy_manager.h
+++ b/chrome/browser/policy/cloud/user_cloud_policy_manager.h
@@ -12,8 +12,8 @@
#include "base/files/file_path.h"
#include "base/memory/ref_counted.h"
#include "base/memory/scoped_ptr.h"
-#include "chrome/browser/policy/cloud/cloud_policy_manager.h"
#include "components/browser_context_keyed_service/browser_context_keyed_service.h"
+#include "components/policy/core/common/cloud/cloud_policy_manager.h"
class PrefService;
diff --git a/chrome/browser/policy/cloud/user_cloud_policy_manager_factory.cc b/chrome/browser/policy/cloud/user_cloud_policy_manager_factory.cc
index 0deeaca..dc5cb05 100644
--- a/chrome/browser/policy/cloud/user_cloud_policy_manager_factory.cc
+++ b/chrome/browser/policy/cloud/user_cloud_policy_manager_factory.cc
@@ -8,12 +8,12 @@
#include "base/logging.h"
#include "base/message_loop/message_loop_proxy.h"
#include "base/sequenced_task_runner.h"
-#include "chrome/browser/policy/cloud/cloud_external_data_manager.h"
#include "chrome/browser/policy/cloud/user_cloud_policy_manager.h"
#include "chrome/browser/policy/cloud/user_cloud_policy_store.h"
#include "chrome/browser/policy/schema_registry_service.h"
#include "chrome/browser/policy/schema_registry_service_factory.h"
#include "components/browser_context_keyed_service/browser_context_dependency_manager.h"
+#include "components/policy/core/common/cloud/cloud_external_data_manager.h"
#include "content/public/browser/browser_context.h"
namespace policy {
diff --git a/chrome/browser/policy/cloud/user_cloud_policy_manager_unittest.cc b/chrome/browser/policy/cloud/user_cloud_policy_manager_unittest.cc
index cae8a00..524f589 100644
--- a/chrome/browser/policy/cloud/user_cloud_policy_manager_unittest.cc
+++ b/chrome/browser/policy/cloud/user_cloud_policy_manager_unittest.cc
@@ -8,8 +8,8 @@
#include "base/message_loop/message_loop.h"
#include "base/message_loop/message_loop_proxy.h"
#include "base/sequenced_task_runner.h"
-#include "chrome/browser/policy/cloud/cloud_external_data_manager.h"
#include "chrome/browser/policy/cloud/mock_user_cloud_policy_store.h"
+#include "components/policy/core/common/cloud/cloud_external_data_manager.h"
#include "components/policy/core/common/external_data_fetcher.h"
#include "components/policy/core/common/mock_configuration_policy_provider.h"
#include "components/policy/core/common/schema_registry.h"
diff --git a/chrome/browser/policy/cloud/user_cloud_policy_store_base.cc b/chrome/browser/policy/cloud/user_cloud_policy_store_base.cc
index 1f36ad1..478d686 100644
--- a/chrome/browser/policy/cloud/user_cloud_policy_store_base.cc
+++ b/chrome/browser/policy/cloud/user_cloud_policy_store_base.cc
@@ -4,8 +4,8 @@
#include "chrome/browser/policy/cloud/user_cloud_policy_store_base.h"
-#include "chrome/browser/policy/cloud/cloud_external_data_manager.h"
-#include "chrome/browser/policy/cloud/cloud_policy_constants.h"
+#include "components/policy/core/common/cloud/cloud_external_data_manager.h"
+#include "components/policy/core/common/cloud/cloud_policy_constants.h"
#include "components/policy/core/common/policy_map.h"
#include "policy/proto/cloud_policy.pb.h"
diff --git a/chrome/browser/policy/cloud/user_cloud_policy_store_base.h b/chrome/browser/policy/cloud/user_cloud_policy_store_base.h
index 068002e..1a1f088 100644
--- a/chrome/browser/policy/cloud/user_cloud_policy_store_base.h
+++ b/chrome/browser/policy/cloud/user_cloud_policy_store_base.h
@@ -11,8 +11,8 @@
#include "base/memory/ref_counted.h"
#include "base/memory/scoped_ptr.h"
#include "base/memory/weak_ptr.h"
-#include "chrome/browser/policy/cloud/cloud_policy_store.h"
-#include "chrome/browser/policy/cloud/cloud_policy_validator.h"
+#include "components/policy/core/common/cloud/cloud_policy_store.h"
+#include "components/policy/core/common/cloud/cloud_policy_validator.h"
namespace base {
class SequencedTaskRunner;
diff --git a/chrome/browser/policy/cloud/user_cloud_policy_store_unittest.cc b/chrome/browser/policy/cloud/user_cloud_policy_store_unittest.cc
index d07e622..8554f35 100644
--- a/chrome/browser/policy/cloud/user_cloud_policy_store_unittest.cc
+++ b/chrome/browser/policy/cloud/user_cloud_policy_store_unittest.cc
@@ -9,9 +9,9 @@
#include "base/message_loop/message_loop.h"
#include "base/message_loop/message_loop_proxy.h"
#include "base/run_loop.h"
-#include "chrome/browser/policy/cloud/mock_cloud_external_data_manager.h"
-#include "chrome/browser/policy/cloud/mock_cloud_policy_store.h"
-#include "chrome/browser/policy/cloud/policy_builder.h"
+#include "components/policy/core/common/cloud/mock_cloud_external_data_manager.h"
+#include "components/policy/core/common/cloud/mock_cloud_policy_store.h"
+#include "components/policy/core/common/cloud/policy_builder.h"
#include "net/url_request/url_request_context_getter.h"
#include "policy/policy_constants.h"
#include "testing/gmock/include/gmock/gmock.h"
diff --git a/chrome/browser/policy/cloud/user_policy_signin_service.cc b/chrome/browser/policy/cloud/user_policy_signin_service.cc
index c9598d4b..e0031df 100644
--- a/chrome/browser/policy/cloud/user_policy_signin_service.cc
+++ b/chrome/browser/policy/cloud/user_policy_signin_service.cc
@@ -9,13 +9,13 @@
#include "base/callback.h"
#include "chrome/browser/browser_process.h"
#include "chrome/browser/chrome_notification_types.h"
-#include "chrome/browser/policy/cloud/cloud_policy_client_registration_helper.h"
#include "chrome/browser/policy/cloud/user_cloud_policy_manager.h"
#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/profiles/profile_manager.h"
#include "chrome/browser/signin/profile_oauth2_token_service.h"
#include "chrome/browser/signin/profile_oauth2_token_service_factory.h"
#include "chrome/browser/signin/signin_manager.h"
+#include "components/policy/core/common/cloud/cloud_policy_client_registration_helper.h"
#include "content/public/browser/notification_details.h"
#include "content/public/browser/notification_source.h"
#include "google_apis/gaia/gaia_constants.h"
diff --git a/chrome/browser/policy/cloud/user_policy_signin_service_android.cc b/chrome/browser/policy/cloud/user_policy_signin_service_android.cc
index b71ec77..6efa336 100644
--- a/chrome/browser/policy/cloud/user_policy_signin_service_android.cc
+++ b/chrome/browser/policy/cloud/user_policy_signin_service_android.cc
@@ -12,7 +12,6 @@
#include "base/message_loop/message_loop.h"
#include "base/prefs/pref_service.h"
#include "base/time/time.h"
-#include "chrome/browser/policy/cloud/cloud_policy_client_registration_helper.h"
#include "chrome/browser/policy/cloud/user_cloud_policy_manager.h"
#include "chrome/browser/policy/proto/cloud/device_management_backend.pb.h"
#include "chrome/browser/profiles/profile.h"
@@ -20,6 +19,7 @@
#include "chrome/browser/signin/profile_oauth2_token_service_factory.h"
#include "chrome/browser/signin/signin_manager.h"
#include "chrome/common/pref_names.h"
+#include "components/policy/core/common/cloud/cloud_policy_client_registration_helper.h"
#include "components/policy/core/common/policy_switches.h"
#include "net/base/network_change_notifier.h"
#include "net/url_request/url_request_context_getter.h"
diff --git a/chrome/browser/policy/cloud/user_policy_signin_service_base.cc b/chrome/browser/policy/cloud/user_policy_signin_service_base.cc
index 0382bed..19fd8dd 100644
--- a/chrome/browser/policy/cloud/user_policy_signin_service_base.cc
+++ b/chrome/browser/policy/cloud/user_policy_signin_service_base.cc
@@ -9,14 +9,14 @@
#include "base/message_loop/message_loop.h"
#include "chrome/browser/chrome_notification_types.h"
#include "chrome/browser/policy/browser_policy_connector.h"
-#include "chrome/browser/policy/cloud/device_management_service.h"
-#include "chrome/browser/policy/cloud/system_policy_request_context.h"
#include "chrome/browser/policy/cloud/user_cloud_policy_manager.h"
#include "chrome/browser/policy/cloud/user_cloud_policy_manager_factory.h"
-#include "chrome/browser/policy/cloud/user_policy_request_context.h"
#include "chrome/browser/signin/signin_manager.h"
#include "chrome/browser/signin/signin_manager_factory.h"
#include "chrome/common/chrome_switches.h"
+#include "components/policy/core/common/cloud/device_management_service.h"
+#include "components/policy/core/common/cloud/system_policy_request_context.h"
+#include "components/policy/core/common/cloud/user_policy_request_context.h"
#include "content/public/browser/notification_source.h"
#include "content/public/common/content_client.h"
#include "net/url_request/url_request_context_getter.h"
diff --git a/chrome/browser/policy/cloud/user_policy_signin_service_base.h b/chrome/browser/policy/cloud/user_policy_signin_service_base.h
index 91ceedc..d72aa7d 100644
--- a/chrome/browser/policy/cloud/user_policy_signin_service_base.h
+++ b/chrome/browser/policy/cloud/user_policy_signin_service_base.h
@@ -13,9 +13,9 @@
#include "base/memory/ref_counted.h"
#include "base/memory/scoped_ptr.h"
#include "base/memory/weak_ptr.h"
-#include "chrome/browser/policy/cloud/cloud_policy_client.h"
-#include "chrome/browser/policy/cloud/cloud_policy_service.h"
#include "components/browser_context_keyed_service/browser_context_keyed_service.h"
+#include "components/policy/core/common/cloud/cloud_policy_client.h"
+#include "components/policy/core/common/cloud/cloud_policy_service.h"
#include "content/public/browser/notification_observer.h"
#include "content/public/browser/notification_registrar.h"
diff --git a/chrome/browser/policy/cloud/user_policy_signin_service_unittest.cc b/chrome/browser/policy/cloud/user_policy_signin_service_unittest.cc
index de85e3d..387a7b8 100644
--- a/chrome/browser/policy/cloud/user_policy_signin_service_unittest.cc
+++ b/chrome/browser/policy/cloud/user_policy_signin_service_unittest.cc
@@ -11,9 +11,6 @@
#include "chrome/browser/browser_process.h"
#include "chrome/browser/chrome_notification_types.h"
#include "chrome/browser/policy/browser_policy_connector.h"
-#include "chrome/browser/policy/cloud/cloud_external_data_manager.h"
-#include "chrome/browser/policy/cloud/cloud_policy_constants.h"
-#include "chrome/browser/policy/cloud/mock_device_management_service.h"
#include "chrome/browser/policy/cloud/mock_user_cloud_policy_store.h"
#include "chrome/browser/policy/cloud/user_cloud_policy_manager.h"
#include "chrome/browser/policy/cloud/user_policy_signin_service_factory.h"
@@ -27,6 +24,9 @@
#include "chrome/test/base/testing_browser_process.h"
#include "chrome/test/base/testing_pref_service_syncable.h"
#include "chrome/test/base/testing_profile.h"
+#include "components/policy/core/common/cloud/cloud_external_data_manager.h"
+#include "components/policy/core/common/cloud/cloud_policy_constants.h"
+#include "components/policy/core/common/cloud/mock_device_management_service.h"
#include "components/policy/core/common/schema_registry.h"
#include "content/public/browser/browser_context.h"
#include "content/public/browser/notification_details.h"
diff --git a/chrome/browser/policy/configuration_policy_handler_android.h b/chrome/browser/policy/configuration_policy_handler_android.h
index b0328d9..4dc08f0 100644
--- a/chrome/browser/policy/configuration_policy_handler_android.h
+++ b/chrome/browser/policy/configuration_policy_handler_android.h
@@ -7,7 +7,7 @@
#include <string>
-#include "chrome/browser/policy/configuration_policy_handler.h"
+#include "components/policy/core/browser/configuration_policy_handler.h"
namespace base {
class Value;
diff --git a/chrome/browser/policy/configuration_policy_handler_list_factory.cc b/chrome/browser/policy/configuration_policy_handler_list_factory.cc
index 4b83931..be2a138 100644
--- a/chrome/browser/policy/configuration_policy_handler_list_factory.cc
+++ b/chrome/browser/policy/configuration_policy_handler_list_factory.cc
@@ -11,8 +11,6 @@
#include "chrome/browser/net/disk_cache_dir_policy_handler.h"
#include "chrome/browser/net/proxy_policy_handler.h"
#include "chrome/browser/policy/autofill_policy_handler.h"
-#include "chrome/browser/policy/configuration_policy_handler.h"
-#include "chrome/browser/policy/configuration_policy_handler_list.h"
#include "chrome/browser/policy/file_selection_dialogs_policy_handler.h"
#include "chrome/browser/policy/javascript_policy_handler.h"
#include "chrome/browser/policy/url_blacklist_policy_handler.h"
@@ -21,6 +19,8 @@
#include "chrome/browser/sessions/restore_on_startup_policy_handler.h"
#include "chrome/browser/sync/sync_policy_handler.h"
#include "chrome/common/pref_names.h"
+#include "components/policy/core/browser/configuration_policy_handler.h"
+#include "components/policy/core/browser/configuration_policy_handler_list.h"
#include "components/policy/core/common/policy_details.h"
#include "components/policy/core/common/policy_map.h"
#include "components/policy/core/common/policy_pref_names.h"
diff --git a/chrome/browser/policy/configuration_policy_handler_unittest.cc b/chrome/browser/policy/configuration_policy_handler_unittest.cc
index d648f12..42277f3 100644
--- a/chrome/browser/policy/configuration_policy_handler_unittest.cc
+++ b/chrome/browser/policy/configuration_policy_handler_unittest.cc
@@ -5,11 +5,16 @@
#include "base/callback.h"
#include "base/memory/scoped_ptr.h"
#include "base/prefs/pref_value_map.h"
-#include "chrome/browser/policy/configuration_policy_handler.h"
+#include "components/policy/core/browser/configuration_policy_handler.h"
#include "components/policy/core/browser/policy_error_map.h"
#include "components/policy/core/common/policy_map.h"
#include "testing/gtest/include/gtest/gtest.h"
+// Note: this file should move to components/policy/core/browser, but the
+// components_unittests runner does not load the ResourceBundle as
+// ChromeTestSuite::Initialize does, which leads to failures using
+// PolicyErrorMap.
+
namespace policy {
namespace {
diff --git a/chrome/browser/policy/configuration_policy_pref_store_test.cc b/chrome/browser/policy/configuration_policy_pref_store_test.cc
new file mode 100644
index 0000000..5a0ca23
--- /dev/null
+++ b/chrome/browser/policy/configuration_policy_pref_store_test.cc
@@ -0,0 +1,46 @@
+// Copyright 2013 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "chrome/browser/policy/configuration_policy_pref_store_test.h"
+
+#include <string>
+
+#include "base/run_loop.h"
+#include "components/policy/core/browser/configuration_policy_pref_store.h"
+#include "components/policy/core/common/policy_details.h"
+#include "components/policy/core/common/policy_map.h"
+#include "components/policy/core/common/policy_service_impl.h"
+#include "testing/gmock/include/gmock/gmock.h"
+
+using testing::Return;
+using testing::_;
+
+namespace policy {
+
+ConfigurationPolicyPrefStoreTest::ConfigurationPolicyPrefStoreTest()
+ : handler_list_(GetChromePolicyDetailsCallback()) {
+ EXPECT_CALL(provider_, IsInitializationComplete(_))
+ .WillRepeatedly(Return(false));
+ provider_.Init();
+ providers_.push_back(&provider_);
+ policy_service_.reset(new PolicyServiceImpl(
+ providers_, PolicyServiceImpl::PreprocessCallback()));
+ store_ = new ConfigurationPolicyPrefStore(
+ policy_service_.get(), &handler_list_, POLICY_LEVEL_MANDATORY);
+}
+
+ConfigurationPolicyPrefStoreTest::~ConfigurationPolicyPrefStoreTest() {}
+
+void ConfigurationPolicyPrefStoreTest::TearDown() {
+ provider_.Shutdown();
+}
+
+void ConfigurationPolicyPrefStoreTest::UpdateProviderPolicy(
+ const PolicyMap& policy) {
+ provider_.UpdateChromePolicy(policy);
+ base::RunLoop loop;
+ loop.RunUntilIdle();
+}
+
+} // namespace policy
diff --git a/chrome/browser/policy/configuration_policy_pref_store_unittest.h b/chrome/browser/policy/configuration_policy_pref_store_test.h
index 9d2ac72..ef8c764 100644
--- a/chrome/browser/policy/configuration_policy_pref_store_unittest.h
+++ b/chrome/browser/policy/configuration_policy_pref_store_test.h
@@ -2,15 +2,16 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#ifndef CHROME_BROWSER_POLICY_CONFIGURATION_POLICY_PREF_STORE_UNITTEST_H_
-#define CHROME_BROWSER_POLICY_CONFIGURATION_POLICY_PREF_STORE_UNITTEST_H_
+#ifndef CHROME_BROWSER_POLICY_CONFIGURATION_POLICY_PREF_STORE_TEST_H_
+#define CHROME_BROWSER_POLICY_CONFIGURATION_POLICY_PREF_STORE_TEST_H_
+#include "base/basictypes.h"
#include "base/memory/ref_counted.h"
#include "base/memory/scoped_ptr.h"
#include "base/message_loop/message_loop.h"
-#include "chrome/browser/policy/configuration_policy_handler_list.h"
-#include "chrome/browser/policy/policy_service_impl.h"
+#include "components/policy/core/browser/configuration_policy_handler_list.h"
#include "components/policy/core/common/mock_configuration_policy_provider.h"
+#include "components/policy/core/common/policy_service_impl.h"
#include "testing/gtest/include/gtest/gtest.h"
namespace policy {
@@ -39,4 +40,4 @@ class ConfigurationPolicyPrefStoreTest : public testing::Test {
} // namespace policy
-#endif // CHROME_BROWSER_POLICY_CONFIGURATION_POLICY_PREF_STORE_UNITTEST_H_
+#endif // CHROME_BROWSER_POLICY_CONFIGURATION_POLICY_PREF_STORE_TEST_H_
diff --git a/chrome/browser/policy/configuration_policy_pref_store_unittest.cc b/chrome/browser/policy/configuration_policy_pref_store_unittest.cc
index 645514e..9a45c6f 100644
--- a/chrome/browser/policy/configuration_policy_pref_store_unittest.cc
+++ b/chrome/browser/policy/configuration_policy_pref_store_unittest.cc
@@ -2,74 +2,40 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#include "chrome/browser/policy/configuration_policy_pref_store_unittest.h"
-
#include <string>
#include "base/callback.h"
#include "base/files/file_path.h"
#include "base/prefs/pref_store_observer_mock.h"
#include "base/run_loop.h"
-#include "chrome/browser/policy/configuration_policy_handler.h"
-#include "chrome/browser/policy/configuration_policy_pref_store.h"
-#include "chrome/browser/policy/policy_service_impl.h"
+#include "chrome/browser/policy/configuration_policy_pref_store_test.h"
+#include "components/policy/core/browser/configuration_policy_handler.h"
+#include "components/policy/core/browser/configuration_policy_pref_store.h"
#include "components/policy/core/common/external_data_fetcher.h"
#include "components/policy/core/common/policy_details.h"
#include "components/policy/core/common/policy_map.h"
#include "components/policy/core/common/policy_pref_names.h"
+#include "components/policy/core/common/policy_service_impl.h"
#include "testing/gmock/include/gmock/gmock.h"
+// Note: this file should move to components/policy/core/browser, but the
+// components_unittests runner does not load the ResourceBundle as
+// ChromeTestSuite::Initialize does, which leads to failures using
+// PolicyErrorMap.
+
using testing::Mock;
using testing::Return;
using testing::_;
namespace {
+
const char kTestPolicy[] = "test.policy";
const char kTestPref[] = "test.pref";
+
} // namespace
namespace policy {
-// Holds a set of test parameters, consisting of pref name and policy name.
-class PolicyAndPref {
- public:
- PolicyAndPref(const char* policy_name, const char* pref_name)
- : policy_name_(policy_name),
- pref_name_(pref_name) {}
-
- const char* policy_name() const { return policy_name_; }
- const char* pref_name() const { return pref_name_; }
-
- private:
- const char* policy_name_;
- const char* pref_name_;
-};
-
-ConfigurationPolicyPrefStoreTest::ConfigurationPolicyPrefStoreTest()
- : handler_list_(GetChromePolicyDetailsCallback()) {
- EXPECT_CALL(provider_, IsInitializationComplete(_))
- .WillRepeatedly(Return(false));
- provider_.Init();
- providers_.push_back(&provider_);
- policy_service_.reset(new PolicyServiceImpl(
- providers_, PolicyServiceImpl::PreprocessCallback()));
- store_ = new ConfigurationPolicyPrefStore(
- policy_service_.get(), &handler_list_, POLICY_LEVEL_MANDATORY);
-}
-
-ConfigurationPolicyPrefStoreTest::~ConfigurationPolicyPrefStoreTest() {}
-
-void ConfigurationPolicyPrefStoreTest::TearDown() {
- provider_.Shutdown();
-}
-
-void ConfigurationPolicyPrefStoreTest::UpdateProviderPolicy(
- const PolicyMap& policy) {
- provider_.UpdateChromePolicy(policy);
- base::RunLoop loop;
- loop.RunUntilIdle();
-}
-
// Test cases for list-valued policy settings.
class ConfigurationPolicyPrefStoreListTest
: public ConfigurationPolicyPrefStoreTest {
diff --git a/chrome/browser/policy/file_selection_dialogs_policy_handler.h b/chrome/browser/policy/file_selection_dialogs_policy_handler.h
index 6208fe7..9fad2ad 100644
--- a/chrome/browser/policy/file_selection_dialogs_policy_handler.h
+++ b/chrome/browser/policy/file_selection_dialogs_policy_handler.h
@@ -7,7 +7,7 @@
#include "base/basictypes.h"
#include "base/compiler_specific.h"
-#include "chrome/browser/policy/configuration_policy_handler.h"
+#include "components/policy/core/browser/configuration_policy_handler.h"
namespace policy {
diff --git a/chrome/browser/policy/javascript_policy_handler.h b/chrome/browser/policy/javascript_policy_handler.h
index a1b4b3d..68b2f4b 100644
--- a/chrome/browser/policy/javascript_policy_handler.h
+++ b/chrome/browser/policy/javascript_policy_handler.h
@@ -5,7 +5,7 @@
#ifndef CHROME_BROWSER_POLICY_JAVASCRIPT_POLICY_HANDLER_H_
#define CHROME_BROWSER_POLICY_JAVASCRIPT_POLICY_HANDLER_H_
-#include "chrome/browser/policy/configuration_policy_handler.h"
+#include "components/policy/core/browser/configuration_policy_handler.h"
class PrefValueMap;
diff --git a/chrome/browser/policy/javascript_policy_handler_unittest.cc b/chrome/browser/policy/javascript_policy_handler_unittest.cc
index c5b42f5..1af39c6 100644
--- a/chrome/browser/policy/javascript_policy_handler_unittest.cc
+++ b/chrome/browser/policy/javascript_policy_handler_unittest.cc
@@ -2,11 +2,11 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#include "chrome/browser/policy/configuration_policy_pref_store.h"
-#include "chrome/browser/policy/configuration_policy_pref_store_unittest.h"
+#include "chrome/browser/policy/configuration_policy_pref_store_test.h"
#include "chrome/browser/policy/javascript_policy_handler.h"
#include "chrome/common/content_settings.h"
#include "chrome/common/pref_names.h"
+#include "components/policy/core/browser/configuration_policy_pref_store.h"
#include "components/policy/core/browser/policy_error_map.h"
#include "components/policy/core/common/policy_map.h"
#include "policy/policy_constants.h"
diff --git a/chrome/browser/policy/policy_browsertest.cc b/chrome/browser/policy/policy_browsertest.cc
index f5453db..2d8c175 100644
--- a/chrome/browser/policy/policy_browsertest.cc
+++ b/chrome/browser/policy/policy_browsertest.cc
@@ -48,8 +48,6 @@
#include "chrome/browser/plugins/plugin_prefs.h"
#include "chrome/browser/policy/browser_policy_connector.h"
#include "chrome/browser/policy/cloud/test_request_interceptor.h"
-#include "chrome/browser/policy/policy_service.h"
-#include "chrome/browser/policy/policy_service_impl.h"
#include "chrome/browser/policy/profile_policy_connector.h"
#include "chrome/browser/policy/profile_policy_connector_factory.h"
#include "chrome/browser/prefs/session_startup_pref.h"
@@ -87,6 +85,8 @@
#include "components/policy/core/common/external_data_fetcher.h"
#include "components/policy/core/common/mock_configuration_policy_provider.h"
#include "components/policy/core/common/policy_map.h"
+#include "components/policy/core/common/policy_service.h"
+#include "components/policy/core/common/policy_service_impl.h"
#include "content/public/browser/browser_child_process_host_iterator.h"
#include "content/public/browser/browser_context.h"
#include "content/public/browser/browser_thread.h"
diff --git a/chrome/browser/policy/profile_policy_connector.cc b/chrome/browser/policy/profile_policy_connector.cc
index 3344f0e..0b8c02e 100644
--- a/chrome/browser/policy/profile_policy_connector.cc
+++ b/chrome/browser/policy/profile_policy_connector.cc
@@ -10,11 +10,11 @@
#include "base/logging.h"
#include "chrome/browser/browser_process.h"
#include "chrome/browser/policy/browser_policy_connector.h"
-#include "chrome/browser/policy/cloud/cloud_policy_manager.h"
-#include "chrome/browser/policy/policy_service_impl.h"
#include "chrome/browser/policy/policy_transformations.h"
+#include "components/policy/core/common/cloud/cloud_policy_manager.h"
#include "components/policy/core/common/configuration_policy_provider.h"
#include "components/policy/core/common/forwarding_policy_provider.h"
+#include "components/policy/core/common/policy_service_impl.h"
#if defined(OS_CHROMEOS)
#include "chrome/browser/chromeos/login/user.h"
diff --git a/chrome/browser/policy/profile_policy_connector_stub.cc b/chrome/browser/policy/profile_policy_connector_stub.cc
index 4287838..53df341 100644
--- a/chrome/browser/policy/profile_policy_connector_stub.cc
+++ b/chrome/browser/policy/profile_policy_connector_stub.cc
@@ -4,7 +4,7 @@
#include "chrome/browser/policy/profile_policy_connector.h"
-#include "chrome/browser/policy/policy_service_stub.h"
+#include "components/policy/core/common/policy_service_stub.h"
namespace policy {
diff --git a/chrome/browser/policy/test/local_policy_test_server.cc b/chrome/browser/policy/test/local_policy_test_server.cc
index 0cc1156..bc1e200 100644
--- a/chrome/browser/policy/test/local_policy_test_server.cc
+++ b/chrome/browser/policy/test/local_policy_test_server.cc
@@ -15,7 +15,7 @@
#include "base/path_service.h"
#include "base/stl_util.h"
#include "base/strings/stringprintf.h"
-#include "chrome/browser/policy/cloud/cloud_policy_constants.h"
+#include "components/policy/core/common/cloud/cloud_policy_constants.h"
#include "crypto/rsa_private_key.h"
#include "net/test/python_utils.h"
#include "net/test/spawned_test_server/base_test_server.h"
diff --git a/chrome/browser/policy/url_blacklist_policy_handler.h b/chrome/browser/policy/url_blacklist_policy_handler.h
index 36670fa..a64236b 100644
--- a/chrome/browser/policy/url_blacklist_policy_handler.h
+++ b/chrome/browser/policy/url_blacklist_policy_handler.h
@@ -7,7 +7,7 @@
#include "base/basictypes.h"
#include "base/compiler_specific.h"
-#include "chrome/browser/policy/configuration_policy_handler.h"
+#include "components/policy/core/browser/configuration_policy_handler.h"
class PrefValueMap;
diff --git a/chrome/browser/prefs/browser_prefs.cc b/chrome/browser/prefs/browser_prefs.cc
index 9e7a065..6b23f8e 100644
--- a/chrome/browser/prefs/browser_prefs.cc
+++ b/chrome/browser/prefs/browser_prefs.cc
@@ -105,8 +105,8 @@
#if defined(ENABLE_CONFIGURATION_POLICY)
#include "chrome/browser/policy/browser_policy_connector.h"
-#include "chrome/browser/policy/policy_statistics_collector.h"
#include "chrome/browser/policy/url_blacklist_manager.h"
+#include "components/policy/core/common/policy_statistics_collector.h"
#endif
#if defined(ENABLE_MANAGED_USERS)
diff --git a/chrome/browser/prefs/chrome_pref_service_factory.cc b/chrome/browser/prefs/chrome_pref_service_factory.cc
index 16cd4f8..4976cc6 100644
--- a/chrome/browser/prefs/chrome_pref_service_factory.cc
+++ b/chrome/browser/prefs/chrome_pref_service_factory.cc
@@ -29,7 +29,7 @@
#if defined(ENABLE_CONFIGURATION_POLICY)
#include "chrome/browser/policy/browser_policy_connector.h"
-#include "chrome/browser/policy/configuration_policy_pref_store.h"
+#include "components/policy/core/browser/configuration_policy_pref_store.h"
#include "components/policy/core/common/policy_types.h"
#endif
diff --git a/chrome/browser/prefs/chrome_pref_service_unittest.cc b/chrome/browser/prefs/chrome_pref_service_unittest.cc
index d0c7708..ba8a013 100644
--- a/chrome/browser/prefs/chrome_pref_service_unittest.cc
+++ b/chrome/browser/prefs/chrome_pref_service_unittest.cc
@@ -11,7 +11,6 @@
#include "base/prefs/scoped_user_pref_update.h"
#include "base/strings/utf_string_conversions.h"
#include "base/values.h"
-#include "chrome/browser/policy/configuration_policy_pref_store.h"
#include "chrome/browser/prefs/browser_prefs.h"
#include "chrome/browser/prefs/command_line_pref_store.h"
#include "chrome/browser/prefs/pref_service_mock_factory.h"
@@ -21,6 +20,7 @@
#include "chrome/test/base/chrome_render_view_host_test_harness.h"
#include "chrome/test/base/testing_pref_service_syncable.h"
#include "chrome/test/base/testing_profile.h"
+#include "components/policy/core/browser/configuration_policy_pref_store.h"
#include "components/policy/core/common/mock_configuration_policy_provider.h"
#include "components/user_prefs/pref_registry_syncable.h"
#include "content/public/test/web_contents_tester.h"
diff --git a/chrome/browser/prefs/pref_service_syncable_factory.cc b/chrome/browser/prefs/pref_service_syncable_factory.cc
index 296b053..ea3c2ad 100644
--- a/chrome/browser/prefs/pref_service_syncable_factory.cc
+++ b/chrome/browser/prefs/pref_service_syncable_factory.cc
@@ -15,8 +15,8 @@
#if defined(ENABLE_CONFIGURATION_POLICY)
#include "chrome/browser/policy/browser_policy_connector.h"
-#include "chrome/browser/policy/configuration_policy_pref_store.h"
-#include "chrome/browser/policy/policy_service.h"
+#include "components/policy/core/browser/configuration_policy_pref_store.h"
+#include "components/policy/core/common/policy_service.h"
#include "components/policy/core/common/policy_types.h"
#endif
diff --git a/chrome/browser/prefs/proxy_policy_unittest.cc b/chrome/browser/prefs/proxy_policy_unittest.cc
index 1490e11..39824cf 100644
--- a/chrome/browser/prefs/proxy_policy_unittest.cc
+++ b/chrome/browser/prefs/proxy_policy_unittest.cc
@@ -7,7 +7,6 @@
#include "base/command_line.h"
#include "base/memory/ref_counted.h"
#include "base/message_loop/message_loop.h"
-#include "chrome/browser/policy/policy_service_impl.h"
#include "chrome/browser/policy/policy_transformations.h"
#include "chrome/browser/prefs/browser_prefs.h"
#include "chrome/browser/prefs/pref_service_mock_factory.h"
@@ -19,6 +18,7 @@
#include "components/policy/core/common/external_data_fetcher.h"
#include "components/policy/core/common/mock_configuration_policy_provider.h"
#include "components/policy/core/common/policy_map.h"
+#include "components/policy/core/common/policy_service_impl.h"
#include "components/user_prefs/pref_registry_syncable.h"
#include "policy/policy_constants.h"
#include "testing/gtest/include/gtest/gtest.h"
diff --git a/chrome/browser/profiles/incognito_mode_policy_handler.h b/chrome/browser/profiles/incognito_mode_policy_handler.h
index 96b6c4f..6aa8c7e 100644
--- a/chrome/browser/profiles/incognito_mode_policy_handler.h
+++ b/chrome/browser/profiles/incognito_mode_policy_handler.h
@@ -5,7 +5,7 @@
#ifndef CHROME_BROWSER_PROFILES_INCOGNITO_MODE_POLICY_HANDLER_H_
#define CHROME_BROWSER_PROFILES_INCOGNITO_MODE_POLICY_HANDLER_H_
-#include "chrome/browser/policy/configuration_policy_handler.h"
+#include "components/policy/core/browser/configuration_policy_handler.h"
class PrefValueMap;
diff --git a/chrome/browser/profiles/incognito_mode_policy_handler_unittest.cc b/chrome/browser/profiles/incognito_mode_policy_handler_unittest.cc
index 30869cc..acb97eb 100644
--- a/chrome/browser/profiles/incognito_mode_policy_handler_unittest.cc
+++ b/chrome/browser/profiles/incognito_mode_policy_handler_unittest.cc
@@ -2,11 +2,11 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#include "chrome/browser/policy/configuration_policy_pref_store.h"
-#include "chrome/browser/policy/configuration_policy_pref_store_unittest.h"
+#include "chrome/browser/policy/configuration_policy_pref_store_test.h"
#include "chrome/browser/prefs/incognito_mode_prefs.h"
#include "chrome/browser/profiles/incognito_mode_policy_handler.h"
#include "chrome/common/pref_names.h"
+#include "components/policy/core/browser/configuration_policy_pref_store.h"
#include "grit/generated_resources.h"
#include "policy/policy_constants.h"
diff --git a/chrome/browser/search_engines/default_search_policy_handler.h b/chrome/browser/search_engines/default_search_policy_handler.h
index c0fe715..1dca24d 100644
--- a/chrome/browser/search_engines/default_search_policy_handler.h
+++ b/chrome/browser/search_engines/default_search_policy_handler.h
@@ -7,7 +7,7 @@
#include <vector>
-#include "chrome/browser/policy/configuration_policy_handler.h"
+#include "components/policy/core/browser/configuration_policy_handler.h"
namespace policy {
diff --git a/chrome/browser/search_engines/default_search_policy_handler_unittest.cc b/chrome/browser/search_engines/default_search_policy_handler_unittest.cc
index 04068ff..49bb3b9 100644
--- a/chrome/browser/search_engines/default_search_policy_handler_unittest.cc
+++ b/chrome/browser/search_engines/default_search_policy_handler_unittest.cc
@@ -3,10 +3,10 @@
// found in the LICENSE file.
#include "base/memory/scoped_ptr.h"
-#include "chrome/browser/policy/configuration_policy_pref_store.h"
-#include "chrome/browser/policy/configuration_policy_pref_store_unittest.h"
+#include "chrome/browser/policy/configuration_policy_pref_store_test.h"
#include "chrome/browser/search_engines/default_search_policy_handler.h"
#include "chrome/common/pref_names.h"
+#include "components/policy/core/browser/configuration_policy_pref_store.h"
#include "policy/policy_constants.h"
namespace policy {
diff --git a/chrome/browser/sessions/restore_on_startup_policy_handler.h b/chrome/browser/sessions/restore_on_startup_policy_handler.h
index 55ebb2c..6902fa7 100644
--- a/chrome/browser/sessions/restore_on_startup_policy_handler.h
+++ b/chrome/browser/sessions/restore_on_startup_policy_handler.h
@@ -5,7 +5,7 @@
#ifndef CHROME_BROWSER_SESSIONS_RESTORE_ON_STARTUP_POLICY_HANDLER_H_
#define CHROME_BROWSER_SESSIONS_RESTORE_ON_STARTUP_POLICY_HANDLER_H_
-#include "chrome/browser/policy/configuration_policy_handler.h"
+#include "components/policy/core/browser/configuration_policy_handler.h"
class PrefValueMap;
diff --git a/chrome/browser/sessions/restore_on_startup_policy_handler_unittest.cc b/chrome/browser/sessions/restore_on_startup_policy_handler_unittest.cc
index edfb97e..7e44546 100644
--- a/chrome/browser/sessions/restore_on_startup_policy_handler_unittest.cc
+++ b/chrome/browser/sessions/restore_on_startup_policy_handler_unittest.cc
@@ -10,10 +10,10 @@
#include "base/strings/string_number_conversions.h"
#include "base/strings/utf_string_conversions.h"
#include "base/values.h"
-#include "chrome/browser/policy/configuration_policy_handler.h"
#include "chrome/browser/prefs/session_startup_pref.h"
#include "chrome/browser/sessions/restore_on_startup_policy_handler.h"
#include "chrome/common/pref_names.h"
+#include "components/policy/core/browser/configuration_policy_handler.h"
#include "components/policy/core/browser/policy_error_map.h"
#include "components/policy/core/common/policy_map.h"
#include "grit/component_strings.h"
diff --git a/chrome/browser/sync/sync_policy_handler.h b/chrome/browser/sync/sync_policy_handler.h
index f7080e5..93581c3 100644
--- a/chrome/browser/sync/sync_policy_handler.h
+++ b/chrome/browser/sync/sync_policy_handler.h
@@ -6,7 +6,7 @@
#define CHROME_BROWSER_SYNC_SYNC_POLICY_HANDLER_H_
#include "base/compiler_specific.h"
-#include "chrome/browser/policy/configuration_policy_handler.h"
+#include "components/policy/core/browser/configuration_policy_handler.h"
class PrefValueMap;
diff --git a/chrome/browser/ui/webui/chromeos/login/enrollment_screen_handler.cc b/chrome/browser/ui/webui/chromeos/login/enrollment_screen_handler.cc
index 2b595ac..ea65870 100644
--- a/chrome/browser/ui/webui/chromeos/login/enrollment_screen_handler.cc
+++ b/chrome/browser/ui/webui/chromeos/login/enrollment_screen_handler.cc
@@ -15,9 +15,9 @@
#include "chrome/browser/browsing_data/browsing_data_helper.h"
#include "chrome/browser/browsing_data/browsing_data_remover.h"
#include "chrome/browser/chromeos/policy/policy_oauth2_token_fetcher.h"
-#include "chrome/browser/policy/cloud/message_util.h"
#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/ui/webui/chromeos/login/oobe_ui.h"
+#include "components/policy/core/browser/cloud/message_util.h"
#include "content/public/browser/web_contents.h"
#include "google_apis/gaia/gaia_auth_fetcher.h"
#include "google_apis/gaia/gaia_auth_util.h"
diff --git a/chrome/browser/ui/webui/options/browser_options_handler.cc b/chrome/browser/ui/webui/options/browser_options_handler.cc
index 80f9e8d..b21e156 100644
--- a/chrome/browser/ui/webui/options/browser_options_handler.cc
+++ b/chrome/browser/ui/webui/options/browser_options_handler.cc
@@ -102,7 +102,6 @@
#include "chrome/browser/chromeos/settings/cros_settings.h"
#include "chrome/browser/chromeos/system/timezone_util.h"
#include "chrome/browser/policy/browser_policy_connector.h"
-#include "chrome/browser/policy/policy_service.h"
#include "chrome/browser/policy/profile_policy_connector.h"
#include "chrome/browser/policy/profile_policy_connector_factory.h"
#include "chrome/browser/ui/browser_window.h"
@@ -110,6 +109,7 @@
#include "chromeos/dbus/power_manager_client.h"
#include "components/policy/core/common/policy_map.h"
#include "components/policy/core/common/policy_namespace.h"
+#include "components/policy/core/common/policy_service.h"
#include "policy/policy_constants.h"
#include "ui/gfx/image/image_skia.h"
#endif // defined(OS_CHROMEOS)
diff --git a/chrome/browser/ui/webui/policy_ui.cc b/chrome/browser/ui/webui/policy_ui.cc
index 17a1bf5..b5020f5 100644
--- a/chrome/browser/ui/webui/policy_ui.cc
+++ b/chrome/browser/ui/webui/policy_ui.cc
@@ -18,15 +18,6 @@
#include "chrome/browser/browser_process.h"
#include "chrome/browser/chrome_notification_types.h"
#include "chrome/browser/policy/browser_policy_connector.h"
-#include "chrome/browser/policy/cloud/cloud_policy_client.h"
-#include "chrome/browser/policy/cloud/cloud_policy_constants.h"
-#include "chrome/browser/policy/cloud/cloud_policy_core.h"
-#include "chrome/browser/policy/cloud/cloud_policy_refresh_scheduler.h"
-#include "chrome/browser/policy/cloud/cloud_policy_store.h"
-#include "chrome/browser/policy/cloud/cloud_policy_validator.h"
-#include "chrome/browser/policy/cloud/message_util.h"
-#include "chrome/browser/policy/configuration_policy_handler_list.h"
-#include "chrome/browser/policy/policy_service.h"
#include "chrome/browser/policy/profile_policy_connector.h"
#include "chrome/browser/policy/profile_policy_connector_factory.h"
#include "chrome/browser/policy/proto/cloud/device_management_backend.pb.h"
@@ -34,9 +25,18 @@
#include "chrome/browser/policy/schema_registry_service_factory.h"
#include "chrome/browser/profiles/profile.h"
#include "chrome/common/url_constants.h"
+#include "components/policy/core/browser/cloud/message_util.h"
+#include "components/policy/core/browser/configuration_policy_handler_list.h"
#include "components/policy/core/browser/policy_error_map.h"
+#include "components/policy/core/common/cloud/cloud_policy_client.h"
+#include "components/policy/core/common/cloud/cloud_policy_constants.h"
+#include "components/policy/core/common/cloud/cloud_policy_core.h"
+#include "components/policy/core/common/cloud/cloud_policy_refresh_scheduler.h"
+#include "components/policy/core/common/cloud/cloud_policy_store.h"
+#include "components/policy/core/common/cloud/cloud_policy_validator.h"
#include "components/policy/core/common/policy_map.h"
#include "components/policy/core/common/policy_namespace.h"
+#include "components/policy/core/common/policy_service.h"
#include "components/policy/core/common/policy_types.h"
#include "components/policy/core/common/schema.h"
#include "components/policy/core/common/schema_map.h"
diff --git a/chrome/chrome_browser.gypi b/chrome/chrome_browser.gypi
index ece6e8c..dae192c 100644
--- a/chrome/chrome_browser.gypi
+++ b/chrome/chrome_browser.gypi
@@ -1459,50 +1459,8 @@
'browser/policy/autofill_policy_handler.h',
'browser/policy/browser_policy_connector.cc',
'browser/policy/browser_policy_connector.h',
- 'browser/policy/cloud/cloud_external_data_manager.cc',
- 'browser/policy/cloud/cloud_external_data_manager.h',
- 'browser/policy/cloud/cloud_policy_client.cc',
- 'browser/policy/cloud/cloud_policy_client.h',
- 'browser/policy/cloud/cloud_policy_client_registration_helper.cc',
- 'browser/policy/cloud/cloud_policy_client_registration_helper.h',
- 'browser/policy/cloud/cloud_policy_constants.cc',
- 'browser/policy/cloud/cloud_policy_constants.h',
- 'browser/policy/cloud/cloud_policy_core.cc',
- 'browser/policy/cloud/cloud_policy_core.h',
'browser/policy/cloud/cloud_policy_invalidator.cc',
'browser/policy/cloud/cloud_policy_invalidator.h',
- 'browser/policy/cloud/cloud_policy_manager.cc',
- 'browser/policy/cloud/cloud_policy_manager.h',
- 'browser/policy/cloud/cloud_policy_refresh_scheduler.cc',
- 'browser/policy/cloud/cloud_policy_refresh_scheduler.h',
- 'browser/policy/cloud/cloud_policy_service.cc',
- 'browser/policy/cloud/cloud_policy_service.h',
- 'browser/policy/cloud/cloud_policy_store.cc',
- 'browser/policy/cloud/cloud_policy_store.h',
- 'browser/policy/cloud/cloud_policy_validator.cc',
- 'browser/policy/cloud/cloud_policy_validator.h',
- 'browser/policy/cloud/component_cloud_policy_service.cc',
- 'browser/policy/cloud/component_cloud_policy_service.h',
- 'browser/policy/cloud/component_cloud_policy_store.cc',
- 'browser/policy/cloud/component_cloud_policy_store.h',
- 'browser/policy/cloud/component_cloud_policy_updater.cc',
- 'browser/policy/cloud/component_cloud_policy_updater.h',
- 'browser/policy/cloud/device_management_service.cc',
- 'browser/policy/cloud/device_management_service.h',
- 'browser/policy/cloud/enterprise_metrics.cc',
- 'browser/policy/cloud/enterprise_metrics.h',
- 'browser/policy/cloud/external_policy_data_fetcher.cc',
- 'browser/policy/cloud/external_policy_data_fetcher.h',
- 'browser/policy/cloud/external_policy_data_updater.cc',
- 'browser/policy/cloud/external_policy_data_updater.h',
- 'browser/policy/cloud/message_util.cc',
- 'browser/policy/cloud/message_util.h',
- 'browser/policy/cloud/rate_limiter.cc',
- 'browser/policy/cloud/rate_limiter.h',
- 'browser/policy/cloud/resource_cache.cc',
- 'browser/policy/cloud/resource_cache.h',
- 'browser/policy/cloud/system_policy_request_context.cc',
- 'browser/policy/cloud/system_policy_request_context.h',
'browser/policy/cloud/user_cloud_policy_invalidator_factory.cc',
'browser/policy/cloud/user_cloud_policy_invalidator_factory.h',
'browser/policy/cloud/user_cloud_policy_invalidator.cc',
@@ -1515,10 +1473,6 @@
'browser/policy/cloud/user_cloud_policy_store.h',
'browser/policy/cloud/user_cloud_policy_store_base.cc',
'browser/policy/cloud/user_cloud_policy_store_base.h',
- 'browser/policy/cloud/user_info_fetcher.cc',
- 'browser/policy/cloud/user_info_fetcher.h',
- 'browser/policy/cloud/user_policy_request_context.cc',
- 'browser/policy/cloud/user_policy_request_context.h',
'browser/policy/cloud/user_policy_signin_service.cc',
'browser/policy/cloud/user_policy_signin_service.h',
'browser/policy/cloud/user_policy_signin_service_android.cc',
@@ -1527,40 +1481,16 @@
'browser/policy/cloud/user_policy_signin_service_base.h',
'browser/policy/cloud/user_policy_signin_service_factory.cc',
'browser/policy/cloud/user_policy_signin_service_factory.h',
- 'browser/policy/config_dir_policy_loader.cc',
- 'browser/policy/config_dir_policy_loader.h',
- 'browser/policy/configuration_policy_handler.cc',
- 'browser/policy/configuration_policy_handler.h',
'browser/policy/configuration_policy_handler_android.cc',
'browser/policy/configuration_policy_handler_android.h',
- 'browser/policy/configuration_policy_handler_list.cc',
- 'browser/policy/configuration_policy_handler_list.h',
'browser/policy/configuration_policy_handler_list_factory.cc',
'browser/policy/configuration_policy_handler_list_factory.h',
- 'browser/policy/configuration_policy_pref_store.cc',
- 'browser/policy/configuration_policy_pref_store.h',
'browser/policy/file_selection_dialogs_policy_handler.cc',
'browser/policy/file_selection_dialogs_policy_handler.h',
'browser/policy/javascript_policy_handler.cc',
'browser/policy/javascript_policy_handler.h',
- 'browser/policy/policy_load_status.cc',
- 'browser/policy/policy_load_status.h',
- 'browser/policy/policy_loader_mac.cc',
- 'browser/policy/policy_loader_mac.h',
- 'browser/policy/policy_loader_win.cc',
- 'browser/policy/policy_loader_win.h',
- 'browser/policy/policy_service.cc',
- 'browser/policy/policy_service.h',
- 'browser/policy/policy_service_impl.cc',
- 'browser/policy/policy_service_impl.h',
- 'browser/policy/policy_service_stub.cc',
- 'browser/policy/policy_service_stub.h',
- 'browser/policy/policy_statistics_collector.cc',
- 'browser/policy/policy_statistics_collector.h',
'browser/policy/policy_transformations.cc',
'browser/policy/policy_transformations.h',
- 'browser/policy/preg_parser_win.cc',
- 'browser/policy/preg_parser_win.h',
'browser/policy/profile_policy_connector.cc',
'browser/policy/profile_policy_connector_stub.cc',
'browser/policy/profile_policy_connector.h',
@@ -2845,13 +2775,11 @@
}],
['configuration_policy==1', {
'sources!': [
- 'browser/policy/policy_service_stub.cc',
- 'browser/policy/policy_service_stub.h',
'browser/policy/profile_policy_connector_stub.cc',
],
'dependencies': [
'app/policy/cloud_policy_codegen.gyp:policy',
- 'cloud_policy_proto',
+ '../components/components.gyp:cloud_policy_proto',
],
'conditions': [
['OS!="android"', {
@@ -2875,10 +2803,6 @@
['exclude', 'browser/sessions/restore_on_startup_policy_handler.h'],
['exclude', 'browser/sync/sync_policy_handler.cc'],
['exclude', 'browser/sync/sync_policy_handler.h'],
- ['include', 'browser/policy/policy_service.cc'],
- ['include', 'browser/policy/policy_service.h'],
- ['include', 'browser/policy/policy_service_stub.cc'],
- ['include', 'browser/policy/policy_service_stub.h'],
['include', 'browser/policy/profile_policy_connector_stub.cc'],
['include', 'browser/policy/profile_policy_connector.h'],
['include', 'browser/policy/profile_policy_connector_factory.cc'],
@@ -3004,8 +2928,6 @@
'browser/password_manager/native_backend_kwallet_x.cc',
'browser/password_manager/native_backend_kwallet_x.h',
'browser/platform_util_linux.cc',
- 'browser/policy/cloud/cloud_policy_client_registration_helper.cc',
- 'browser/policy/cloud/cloud_policy_client_registration_helper.h',
'browser/policy/cloud/user_cloud_policy_manager.cc',
'browser/policy/cloud/user_cloud_policy_manager.h',
'browser/policy/cloud/user_cloud_policy_manager_factory.cc',
@@ -3237,7 +3159,6 @@
'../third_party/libusb/libusb.gyp:libusb',
],
'sources': [
- 'browser/policy/cloud/component_cloud_policy_service_stub.cc',
'browser/sessions/in_memory_tab_restore_service.cc',
'browser/sessions/in_memory_tab_restore_service.h',
'browser/signin/android_profile_oauth2_token_service.cc',
@@ -3264,21 +3185,8 @@
'browser/download/download_crx_util.cc',
'browser/net/gaia/gaia_oauth_fetcher.cc',
- 'browser/policy/cloud/component_cloud_policy_service.cc',
- 'browser/policy/cloud/component_cloud_policy_store.cc',
- 'browser/policy/cloud/component_cloud_policy_store.h',
- 'browser/policy/cloud/component_cloud_policy_updater.cc',
- 'browser/policy/cloud/component_cloud_policy_updater.h',
- 'browser/policy/cloud/external_policy_data_fetcher.cc',
- 'browser/policy/cloud/external_policy_data_fetcher.h',
- 'browser/policy/cloud/external_policy_data_updater.cc',
- 'browser/policy/cloud/external_policy_data_updater.h',
- 'browser/policy/cloud/resource_cache.cc',
- 'browser/policy/cloud/resource_cache.h',
'browser/policy/cloud/user_policy_signin_service.cc',
'browser/policy/cloud/user_policy_signin_service.h',
- 'browser/policy/config_dir_policy_loader.cc',
- 'browser/policy/config_dir_policy_loader.h',
'browser/sessions/persistent_tab_restore_service.cc',
'browser/sessions/persistent_tab_restore_service.h',
'browser/sessions/session_backend.cc',
@@ -3329,7 +3237,6 @@
'browser/parsers/metadata_parser_jpeg.cc',
'browser/parsers/metadata_parser_jpeg_factory.cc',
'browser/parsers/metadata_parser_manager.cc',
- 'browser/policy/policy_load_status.cc',
'browser/policy/proto/cloud/chrome_extension_policy.proto',
'browser/process_singleton.cc',
'browser/process_singleton_modal_dialog_lock.cc',
@@ -3639,21 +3546,6 @@
},
'includes': [ '../build/protoc.gypi' ]
},
- {
- # Protobuf compiler / generator for cloud policy protocol buffers.
- 'target_name': 'cloud_policy_proto',
- 'type': 'static_library',
- 'sources': [
- 'browser/policy/proto/cloud/chrome_extension_policy.proto',
- 'browser/policy/proto/cloud/device_management_backend.proto',
- 'browser/policy/proto/cloud/device_management_local.proto',
- ],
- 'variables': {
- 'proto_in_dir': 'browser/policy/proto/cloud',
- 'proto_out_dir': 'chrome/browser/policy/proto/cloud',
- },
- 'includes': [ '../build/protoc.gypi' ]
- },
],
'conditions': [
['OS=="android"', {
diff --git a/chrome/chrome_browser_chromeos.gypi b/chrome/chrome_browser_chromeos.gypi
index c86b07f..ea13afe 100644
--- a/chrome/chrome_browser_chromeos.gypi
+++ b/chrome/chrome_browser_chromeos.gypi
@@ -31,7 +31,6 @@
'chrome_resources.gyp:chrome_resources',
'chrome_resources.gyp:platform_locale_settings',
'chrome_resources.gyp:theme_resources',
- 'cloud_policy_proto',
'common',
'common/extensions/api/api.gyp:api',
'common_net',
@@ -51,6 +50,7 @@
# browser_chromeos #includes power_supply_properties.pb.h directly.
'../chromeos/chromeos.gyp:power_manager_proto',
'../chromeos/ime/input_method.gyp:gencode',
+ '../components/components.gyp:cloud_policy_proto',
'../components/components.gyp:onc_component',
# This depends directly on the variations target, rather than just
# transitively via the common target because the proto sources need to
diff --git a/chrome/chrome_tests.gypi b/chrome/chrome_tests.gypi
index 3665de2..10387df 100644
--- a/chrome/chrome_tests.gypi
+++ b/chrome/chrome_tests.gypi
@@ -1312,8 +1312,6 @@
'browser/policy/cloud/device_management_service_browsertest.cc',
'browser/policy/cloud/test_request_interceptor.cc',
'browser/policy/cloud/test_request_interceptor.h',
- 'browser/policy/mock_policy_service.cc',
- 'browser/policy/mock_policy_service.h',
'browser/policy/policy_browsertest.cc',
'browser/policy/policy_prefs_browsertest.cc',
'browser/prefs/pref_functional_browsertest.cc',
diff --git a/chrome/chrome_tests_unit.gypi b/chrome/chrome_tests_unit.gypi
index 3381ba2..4509877 100644
--- a/chrome/chrome_tests_unit.gypi
+++ b/chrome/chrome_tests_unit.gypi
@@ -156,20 +156,8 @@
'browser/password_manager/password_form_data.h',
'browser/password_manager/test_password_store.cc',
'browser/password_manager/test_password_store.h',
- 'browser/policy/cloud/mock_cloud_external_data_manager.cc',
- 'browser/policy/cloud/mock_cloud_external_data_manager.h',
- 'browser/policy/cloud/mock_cloud_policy_client.cc',
- 'browser/policy/cloud/mock_cloud_policy_client.h',
- 'browser/policy/cloud/mock_cloud_policy_store.cc',
- 'browser/policy/cloud/mock_cloud_policy_store.h',
- 'browser/policy/cloud/mock_device_management_service.cc',
- 'browser/policy/cloud/mock_device_management_service.h',
- 'browser/policy/cloud/policy_builder.cc',
- 'browser/policy/cloud/policy_builder.h',
'browser/policy/test/local_policy_test_server.cc',
'browser/policy/test/local_policy_test_server.h',
- 'browser/policy/test/policy_test_utils.cc',
- 'browser/policy/test/policy_test_utils.h',
'browser/prefs/pref_service_mock_factory.cc',
'browser/prefs/pref_service_mock_factory.h',
'browser/profile_resetter/profile_resetter_test_base.cc',
@@ -295,7 +283,6 @@
'conditions': [
['OS!="ios"', {
'dependencies': [
- 'cloud_policy_proto',
'common/extensions/api/api.gyp:api',
'plugin',
'renderer',
@@ -1096,43 +1083,21 @@
'browser/plugins/plugin_prefs_unittest.cc',
'browser/policy/autofill_policy_handler_unittest.cc',
'browser/policy/browser_policy_connector_unittest.cc',
- 'browser/policy/cloud/cloud_policy_client_unittest.cc',
- 'browser/policy/cloud/cloud_policy_core_unittest.cc',
'browser/policy/cloud/cloud_policy_invalidator_unittest.cc',
- 'browser/policy/cloud/cloud_policy_manager_unittest.cc',
- 'browser/policy/cloud/cloud_policy_refresh_scheduler_unittest.cc',
- 'browser/policy/cloud/cloud_policy_service_unittest.cc',
- 'browser/policy/cloud/cloud_policy_validator_unittest.cc',
- 'browser/policy/cloud/component_cloud_policy_service_unittest.cc',
- 'browser/policy/cloud/component_cloud_policy_store_unittest.cc',
- 'browser/policy/cloud/component_cloud_policy_updater_unittest.cc',
- 'browser/policy/cloud/device_management_service_unittest.cc',
- 'browser/policy/cloud/external_policy_data_fetcher_unittest.cc',
- 'browser/policy/cloud/external_policy_data_updater_unittest.cc',
'browser/policy/cloud/mock_user_cloud_policy_store.cc',
'browser/policy/cloud/mock_user_cloud_policy_store.h',
- 'browser/policy/cloud/rate_limiter_unittest.cc',
- 'browser/policy/cloud/resource_cache_unittest.cc',
'browser/policy/cloud/user_cloud_policy_manager_unittest.cc',
'browser/policy/cloud/user_cloud_policy_store_unittest.cc',
- 'browser/policy/cloud/user_info_fetcher_unittest.cc',
'browser/policy/cloud/user_policy_signin_service_unittest.cc',
- 'browser/policy/config_dir_policy_loader_unittest.cc',
'browser/policy/configuration_policy_handler_unittest.cc',
+ 'browser/policy/configuration_policy_pref_store_test.cc',
+ 'browser/policy/configuration_policy_pref_store_test.h',
'browser/policy/configuration_policy_pref_store_unittest.cc',
- 'browser/policy/configuration_policy_pref_store_unittest.h',
'browser/policy/file_selection_dialogs_policy_handler_unittest.cc',
'browser/policy/generate_policy_source_unittest.cc',
'browser/policy/javascript_policy_handler_unittest.cc',
- 'browser/policy/mock_policy_service.cc',
- 'browser/policy/mock_policy_service.h',
- 'browser/policy/policy_loader_mac_unittest.cc',
- 'browser/policy/policy_loader_win_unittest.cc',
'browser/policy/policy_path_parser_unittest.cc',
- 'browser/policy/policy_service_impl_unittest.cc',
- 'browser/policy/policy_statistics_collector_unittest.cc',
'browser/policy/policy_transformations_unittest.cc',
- 'browser/policy/preg_parser_win_unittest.cc',
'browser/policy/url_blacklist_manager_unittest.cc',
'browser/policy/url_blacklist_policy_handler_unittest.cc',
'browser/predictors/autocomplete_action_predictor_table_unittest.cc',
@@ -2597,13 +2562,6 @@
'browser/extensions/suspicious_extension_bubble_controller_unittest.cc',
'browser/storage_monitor/media_storage_util_unittest.cc',
'browser/net/gaia/gaia_oauth_fetcher_unittest.cc',
- 'browser/policy/cloud/component_cloud_policy_service_unittest.cc',
- 'browser/policy/cloud/component_cloud_policy_store_unittest.cc',
- 'browser/policy/cloud/component_cloud_policy_updater_unittest.cc',
- 'browser/policy/cloud/external_policy_data_fetcher_unittest.cc',
- 'browser/policy/cloud/external_policy_data_updater_unittest.cc',
- 'browser/policy/cloud/resource_cache_unittest.cc',
- 'browser/policy/config_dir_policy_loader_unittest.cc',
'browser/policy/policy_path_parser_unittest.cc',
'browser/profiles/off_the_record_profile_impl_unittest.cc',
'browser/profiles/profile_list_desktop_unittest.cc',
diff --git a/chrome/test/base/testing_browser_process.cc b/chrome/test/base/testing_browser_process.cc
index c119e07..9465f70 100644
--- a/chrome/test/base/testing_browser_process.cc
+++ b/chrome/test/base/testing_browser_process.cc
@@ -35,7 +35,7 @@
#if defined(ENABLE_CONFIGURATION_POLICY)
#include "chrome/browser/policy/browser_policy_connector.h"
#else
-#include "chrome/browser/policy/policy_service_stub.h"
+#include "components/policy/core/common/policy_service_stub.h"
#endif // defined(ENABLE_CONFIGURATION_POLICY)
#if defined(ENABLE_FULL_PRINTING)
diff --git a/chrome/test/base/testing_profile.cc b/chrome/test/base/testing_profile.cc
index 5b623a4..816e6bc 100644
--- a/chrome/test/base/testing_profile.cc
+++ b/chrome/test/base/testing_profile.cc
@@ -41,7 +41,6 @@
#include "chrome/browser/net/proxy_service_factory.h"
#include "chrome/browser/notifications/desktop_notification_service.h"
#include "chrome/browser/notifications/desktop_notification_service_factory.h"
-#include "chrome/browser/policy/policy_service.h"
#include "chrome/browser/policy/profile_policy_connector.h"
#include "chrome/browser/policy/profile_policy_connector_factory.h"
#include "chrome/browser/prefs/browser_prefs.h"
@@ -61,6 +60,7 @@
#include "chrome/test/base/testing_pref_service_syncable.h"
#include "chrome/test/base/ui_test_utils.h"
#include "components/browser_context_keyed_service/browser_context_dependency_manager.h"
+#include "components/policy/core/common/policy_service.h"
#include "components/user_prefs/user_prefs.h"
#include "content/public/browser/browser_thread.h"
#include "content/public/browser/notification_service.h"
@@ -76,13 +76,13 @@
#include "testing/gmock/include/gmock/gmock.h"
#if defined(ENABLE_CONFIGURATION_POLICY)
-#include "chrome/browser/policy/policy_service_impl.h"
#include "chrome/browser/policy/schema_registry_service.h"
#include "chrome/browser/policy/schema_registry_service_factory.h"
#include "components/policy/core/common/configuration_policy_provider.h"
+#include "components/policy/core/common/policy_service_impl.h"
#include "components/policy/core/common/schema.h"
#else
-#include "chrome/browser/policy/policy_service_stub.h"
+#include "components/policy/core/common/policy_service_stub.h"
#endif // defined(ENABLE_CONFIGURATION_POLICY)
#if defined(ENABLE_MANAGED_USERS)
diff --git a/chrome/tools/build/generate_policy_source.py b/chrome/tools/build/generate_policy_source.py
index d048c0d..315650d 100755
--- a/chrome/tools/build/generate_policy_source.py
+++ b/chrome/tools/build/generate_policy_source.py
@@ -617,7 +617,7 @@ CPP_HEAD = '''
#include "base/memory/scoped_ptr.h"
#include "base/memory/weak_ptr.h"
#include "base/values.h"
-#include "chrome/browser/policy/cloud/cloud_external_data_manager.h"
+#include "components/policy/core/common/cloud/cloud_external_data_manager.h"
#include "components/policy/core/common/external_data_fetcher.h"
#include "components/policy/core/common/policy_map.h"
#include "policy/policy_constants.h"
diff --git a/components/components_tests.gyp b/components/components_tests.gyp
index 96cb039..e3c6d79 100644
--- a/components/components_tests.gyp
+++ b/components/components_tests.gyp
@@ -61,6 +61,7 @@
'..',
],
'dependencies': [
+ '../base/base.gyp:base_prefs_test_support',
'../base/base.gyp:test_support_base',
# TODO(blundell): Eliminate the need for this dependency in code
# that iOS shares. crbug.com/325243
@@ -192,9 +193,30 @@
],
'sources': [
'policy/core/common/async_policy_provider_unittest.cc',
+ 'policy/core/common/cloud/cloud_policy_client_unittest.cc',
+ 'policy/core/common/cloud/cloud_policy_core_unittest.cc',
+ 'policy/core/common/cloud/cloud_policy_manager_unittest.cc',
+ 'policy/core/common/cloud/cloud_policy_refresh_scheduler_unittest.cc',
+ 'policy/core/common/cloud/cloud_policy_service_unittest.cc',
+ 'policy/core/common/cloud/cloud_policy_validator_unittest.cc',
+ 'policy/core/common/cloud/component_cloud_policy_service_unittest.cc',
+ 'policy/core/common/cloud/component_cloud_policy_store_unittest.cc',
+ 'policy/core/common/cloud/component_cloud_policy_updater_unittest.cc',
+ 'policy/core/common/cloud/device_management_service_unittest.cc',
+ 'policy/core/common/cloud/external_policy_data_fetcher_unittest.cc',
+ 'policy/core/common/cloud/external_policy_data_updater_unittest.cc',
+ 'policy/core/common/cloud/rate_limiter_unittest.cc',
+ 'policy/core/common/cloud/resource_cache_unittest.cc',
+ 'policy/core/common/cloud/user_info_fetcher_unittest.cc',
+ 'policy/core/common/config_dir_policy_loader_unittest.cc',
'policy/core/common/forwarding_policy_provider_unittest.cc',
'policy/core/common/policy_bundle_unittest.cc',
+ 'policy/core/common/policy_loader_mac_unittest.cc',
+ 'policy/core/common/policy_loader_win_unittest.cc',
'policy/core/common/policy_map_unittest.cc',
+ 'policy/core/common/policy_service_impl_unittest.cc',
+ 'policy/core/common/policy_statistics_collector_unittest.cc',
+ 'policy/core/common/preg_parser_win_unittest.cc',
'policy/core/common/registry_dict_win_unittest.cc',
'policy/core/common/schema_map_unittest.cc',
'policy/core/common/schema_registry_unittest.cc',
@@ -204,6 +226,13 @@
['OS=="android"', {
'sources!': [
'policy/core/common/async_policy_provider_unittest.cc',
+ 'policy/core/common/cloud/component_cloud_policy_service_unittest.cc',
+ 'policy/core/common/cloud/component_cloud_policy_store_unittest.cc',
+ 'policy/core/common/cloud/component_cloud_policy_updater_unittest.cc',
+ 'policy/core/common/cloud/external_policy_data_fetcher_unittest.cc',
+ 'policy/core/common/cloud/external_policy_data_updater_unittest.cc',
+ 'policy/core/common/cloud/resource_cache_unittest.cc',
+ 'policy/core/common/config_dir_policy_loader_unittest.cc',
],
}],
],
diff --git a/components/policy.gypi b/components/policy.gypi
index 0b48ced..6172091 100644
--- a/components/policy.gypi
+++ b/components/policy.gypi
@@ -9,9 +9,6 @@
'type': '<(component)',
'dependencies': [
'../base/base.gyp:base',
- '../ui/ui.gyp:ui',
- 'json_schema',
- 'component_strings.gyp:component_strings',
],
'defines': [
'POLICY_COMPONENT_IMPLEMENTATION',
@@ -21,13 +18,79 @@
],
'conditions': [
['configuration_policy==1', {
+ 'dependencies': [
+ '../base/base.gyp:base_prefs',
+ '../base/third_party/dynamic_annotations/dynamic_annotations.gyp:dynamic_annotations',
+ # TODO(joaodasilva): remove this dependency on the user policy protobuf.
+ '../chrome/app/policy/cloud_policy_codegen.gyp:policy',
+ '../google_apis/google_apis.gyp:google_apis',
+ '../ui/ui.gyp:ui',
+ '../url/url.gyp:url_lib',
+ 'component_strings.gyp:component_strings',
+ 'cloud_policy_proto',
+ 'json_schema',
+ ],
'sources': [
+ 'policy/core/browser/cloud/message_util.cc',
+ 'policy/core/browser/cloud/message_util.h',
+ 'policy/core/browser/configuration_policy_handler.cc',
+ 'policy/core/browser/configuration_policy_handler.h',
+ 'policy/core/browser/configuration_policy_handler_list.cc',
+ 'policy/core/browser/configuration_policy_handler_list.h',
+ 'policy/core/browser/configuration_policy_pref_store.cc',
+ 'policy/core/browser/configuration_policy_pref_store.h',
'policy/core/browser/policy_error_map.cc',
'policy/core/browser/policy_error_map.h',
+ 'policy/core/common/cloud/cloud_external_data_manager.cc',
+ 'policy/core/common/cloud/cloud_external_data_manager.h',
+ 'policy/core/common/cloud/cloud_policy_client.cc',
+ 'policy/core/common/cloud/cloud_policy_client.h',
+ 'policy/core/common/cloud/cloud_policy_client_registration_helper.cc',
+ 'policy/core/common/cloud/cloud_policy_client_registration_helper.h',
+ 'policy/core/common/cloud/cloud_policy_constants.cc',
+ 'policy/core/common/cloud/cloud_policy_constants.h',
+ 'policy/core/common/cloud/cloud_policy_core.cc',
+ 'policy/core/common/cloud/cloud_policy_core.h',
+ 'policy/core/common/cloud/cloud_policy_manager.cc',
+ 'policy/core/common/cloud/cloud_policy_manager.h',
+ 'policy/core/common/cloud/cloud_policy_refresh_scheduler.cc',
+ 'policy/core/common/cloud/cloud_policy_refresh_scheduler.h',
+ 'policy/core/common/cloud/cloud_policy_service.cc',
+ 'policy/core/common/cloud/cloud_policy_service.h',
+ 'policy/core/common/cloud/cloud_policy_store.cc',
+ 'policy/core/common/cloud/cloud_policy_store.h',
+ 'policy/core/common/cloud/cloud_policy_validator.cc',
+ 'policy/core/common/cloud/cloud_policy_validator.h',
+ 'policy/core/common/cloud/component_cloud_policy_service.cc',
+ 'policy/core/common/cloud/component_cloud_policy_service.h',
+ 'policy/core/common/cloud/component_cloud_policy_store.cc',
+ 'policy/core/common/cloud/component_cloud_policy_store.h',
+ 'policy/core/common/cloud/component_cloud_policy_updater.cc',
+ 'policy/core/common/cloud/component_cloud_policy_updater.h',
+ 'policy/core/common/cloud/device_management_service.cc',
+ 'policy/core/common/cloud/device_management_service.h',
+ 'policy/core/common/cloud/enterprise_metrics.cc',
+ 'policy/core/common/cloud/enterprise_metrics.h',
+ 'policy/core/common/cloud/external_policy_data_fetcher.cc',
+ 'policy/core/common/cloud/external_policy_data_fetcher.h',
+ 'policy/core/common/cloud/external_policy_data_updater.cc',
+ 'policy/core/common/cloud/external_policy_data_updater.h',
+ 'policy/core/common/cloud/rate_limiter.cc',
+ 'policy/core/common/cloud/rate_limiter.h',
+ 'policy/core/common/cloud/resource_cache.cc',
+ 'policy/core/common/cloud/resource_cache.h',
+ 'policy/core/common/cloud/system_policy_request_context.cc',
+ 'policy/core/common/cloud/system_policy_request_context.h',
+ 'policy/core/common/cloud/user_info_fetcher.cc',
+ 'policy/core/common/cloud/user_info_fetcher.h',
+ 'policy/core/common/cloud/user_policy_request_context.cc',
+ 'policy/core/common/cloud/user_policy_request_context.h',
'policy/core/common/async_policy_loader.cc',
'policy/core/common/async_policy_loader.h',
'policy/core/common/async_policy_provider.cc',
'policy/core/common/async_policy_provider.h',
+ 'policy/core/common/config_dir_policy_loader.cc',
+ 'policy/core/common/config_dir_policy_loader.h',
'policy/core/common/configuration_policy_provider.cc',
'policy/core/common/configuration_policy_provider.h',
'policy/core/common/external_data_fetcher.cc',
@@ -38,17 +101,31 @@
'policy/core/common/policy_bundle.cc',
'policy/core/common/policy_bundle.h',
'policy/core/common/policy_details.h',
- 'policy/core/common/policy_namespace.cc',
- 'policy/core/common/policy_namespace.h',
+ 'policy/core/common/policy_loader_mac.cc',
+ 'policy/core/common/policy_loader_mac.h',
+ 'policy/core/common/policy_loader_win.cc',
+ 'policy/core/common/policy_loader_win.h',
+ 'policy/core/common/policy_load_status.cc',
+ 'policy/core/common/policy_load_status.h',
'policy/core/common/policy_map.cc',
'policy/core/common/policy_map.h',
+ 'policy/core/common/policy_namespace.cc',
+ 'policy/core/common/policy_namespace.h',
'policy/core/common/policy_pref_names.cc',
'policy/core/common/policy_pref_names.h',
+ 'policy/core/common/policy_service.cc',
+ 'policy/core/common/policy_service.h',
+ 'policy/core/common/policy_service_impl.cc',
+ 'policy/core/common/policy_service_impl.h',
+ 'policy/core/common/policy_statistics_collector.cc',
+ 'policy/core/common/policy_statistics_collector.h',
'policy/core/common/policy_switches.cc',
'policy/core/common/policy_switches.h',
'policy/core/common/policy_types.h',
'policy/core/common/preferences_mac.cc',
'policy/core/common/preferences_mac.h',
+ 'policy/core/common/preg_parser_win.cc',
+ 'policy/core/common/preg_parser_win.h',
'policy/core/common/registry_dict_win.cc',
'policy/core/common/registry_dict_win.h',
'policy/core/common/schema.cc',
@@ -62,11 +139,35 @@
],
'conditions': [
['OS=="android"', {
+ 'sources': [
+ 'policy/core/common/cloud/component_cloud_policy_service_stub.cc',
+ ],
'sources!': [
'policy/core/common/async_policy_loader.cc',
'policy/core/common/async_policy_loader.h',
'policy/core/common/async_policy_provider.cc',
'policy/core/common/async_policy_provider.h',
+ 'policy/core/common/cloud/component_cloud_policy_service.cc',
+ 'policy/core/common/cloud/component_cloud_policy_store.cc',
+ 'policy/core/common/cloud/component_cloud_policy_store.h',
+ 'policy/core/common/cloud/component_cloud_policy_updater.cc',
+ 'policy/core/common/cloud/component_cloud_policy_updater.h',
+ 'policy/core/common/cloud/external_policy_data_fetcher.cc',
+ 'policy/core/common/cloud/external_policy_data_fetcher.h',
+ 'policy/core/common/cloud/external_policy_data_updater.cc',
+ 'policy/core/common/cloud/external_policy_data_updater.h',
+ 'policy/core/common/cloud/resource_cache.cc',
+ 'policy/core/common/cloud/resource_cache.h',
+ 'policy/core/common/config_dir_policy_loader.cc',
+ 'policy/core/common/config_dir_policy_loader.h',
+ 'policy/core/common/policy_load_status.cc',
+ 'policy/core/common/policy_load_status.h',
+ ],
+ }],
+ ['chromeos==1', {
+ 'sources!': [
+ 'policy/core/common/cloud/cloud_policy_client_registration_helper.cc',
+ 'policy/core/common/cloud/cloud_policy_client_registration_helper.h',
],
}],
],
@@ -82,10 +183,31 @@
'policy/core/common/policy_map.h',
'policy/core/common/policy_namespace.cc',
'policy/core/common/policy_namespace.h',
+ 'policy/core/common/policy_service.cc',
+ 'policy/core/common/policy_service.h',
+ 'policy/core/common/policy_service_stub.cc',
+ 'policy/core/common/policy_service_stub.h',
],
}],
],
},
+ {
+ # Protobuf compiler / generator for cloud policy protocol buffers.
+ # TODO(joaodasilva): move these protobufs outside of chrome/,
+ # and update their output paths too.
+ 'target_name': 'cloud_policy_proto',
+ 'type': 'static_library',
+ 'sources': [
+ '../chrome/browser/policy/proto/cloud/chrome_extension_policy.proto',
+ '../chrome/browser/policy/proto/cloud/device_management_backend.proto',
+ '../chrome/browser/policy/proto/cloud/device_management_local.proto',
+ ],
+ 'variables': {
+ 'proto_in_dir': '../chrome/browser/policy/proto/cloud',
+ 'proto_out_dir': 'chrome/browser/policy/proto/cloud',
+ },
+ 'includes': [ '../build/protoc.gypi' ]
+ },
],
'conditions': [
['configuration_policy==1', {
@@ -99,6 +221,9 @@
'POLICY_COMPONENT_IMPLEMENTATION',
],
'dependencies': [
+ # TODO(joaodasilva): remove this dependency.
+ '../chrome/app/policy/cloud_policy_codegen.gyp:policy_test_support',
+ 'cloud_policy_proto',
'policy_component',
'../testing/gmock.gyp:gmock',
'../testing/gtest.gyp:gtest',
@@ -107,10 +232,24 @@
'..',
],
'sources': [
+ 'policy/core/common/cloud/mock_cloud_external_data_manager.cc',
+ 'policy/core/common/cloud/mock_cloud_external_data_manager.h',
+ 'policy/core/common/cloud/mock_cloud_policy_client.cc',
+ 'policy/core/common/cloud/mock_cloud_policy_client.h',
+ 'policy/core/common/cloud/mock_cloud_policy_store.cc',
+ 'policy/core/common/cloud/mock_cloud_policy_store.h',
+ 'policy/core/common/cloud/mock_device_management_service.cc',
+ 'policy/core/common/cloud/mock_device_management_service.h',
+ 'policy/core/common/cloud/policy_builder.cc',
+ 'policy/core/common/cloud/policy_builder.h',
'policy/core/common/configuration_policy_provider_test.cc',
'policy/core/common/configuration_policy_provider_test.h',
'policy/core/common/mock_configuration_policy_provider.cc',
'policy/core/common/mock_configuration_policy_provider.h',
+ 'policy/core/common/mock_policy_service.cc',
+ 'policy/core/common/mock_policy_service.h',
+ 'policy/core/common/policy_test_utils.cc',
+ 'policy/core/common/policy_test_utils.h',
'policy/core/common/preferences_mock_mac.cc',
'policy/core/common/preferences_mock_mac.h',
],
diff --git a/components/policy/core/DEPS b/components/policy/core/DEPS
index b60dc24..d35de81 100644
--- a/components/policy/core/DEPS
+++ b/components/policy/core/DEPS
@@ -1,3 +1,12 @@
include_rules = [
"+components/json_schema",
+ "+crypto",
+ "+google_apis",
+ "+net",
+
+ # TODO(joaodasilva): remove these exceptions.
+ "+chrome/browser/policy/proto/cloud/chrome_extension_policy.pb.h",
+ "+chrome/browser/policy/proto/cloud/device_management_backend.pb.h",
+ "+chrome/browser/policy/proto/cloud/device_management_local.pb.h",
+ "+policy/proto/cloud_policy.pb.h",
]
diff --git a/components/policy/core/browser/DEPS b/components/policy/core/browser/DEPS
index 0410926..9f49b26 100644
--- a/components/policy/core/browser/DEPS
+++ b/components/policy/core/browser/DEPS
@@ -1,5 +1,5 @@
include_rules = [
- "+grit/component_strings.h", # For generated headers
+ "+grit/component_strings.h",
"+ui/base/l10n",
"+ui/base/resource",
]
diff --git a/chrome/browser/policy/cloud/message_util.cc b/components/policy/core/browser/cloud/message_util.cc
index fca7a9f..aac5148 100644
--- a/chrome/browser/policy/cloud/message_util.cc
+++ b/components/policy/core/browser/cloud/message_util.cc
@@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#include "chrome/browser/policy/cloud/message_util.h"
+#include "components/policy/core/browser/cloud/message_util.h"
#include "base/logging.h"
#include "grit/component_strings.h"
diff --git a/components/policy/core/browser/cloud/message_util.h b/components/policy/core/browser/cloud/message_util.h
new file mode 100644
index 0000000..e404717
--- /dev/null
+++ b/components/policy/core/browser/cloud/message_util.h
@@ -0,0 +1,33 @@
+// Copyright (c) 2012 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef COMPONENTS_POLICY_CORE_BROWSER_CLOUD_MESSAGE_UTIL_H_
+#define COMPONENTS_POLICY_CORE_BROWSER_CLOUD_MESSAGE_UTIL_H_
+
+#include "base/strings/string16.h"
+#include "components/policy/core/common/cloud/cloud_policy_constants.h"
+#include "components/policy/core/common/cloud/cloud_policy_store.h"
+#include "components/policy/core/common/cloud/cloud_policy_validator.h"
+#include "components/policy/policy_export.h"
+
+namespace policy {
+
+// Returns a string describing |status| suitable for display in UI.
+POLICY_EXPORT string16 FormatDeviceManagementStatus(
+ DeviceManagementStatus status);
+
+// Returns a string describing |validation_status| suitable for display in UI.
+POLICY_EXPORT string16 FormatValidationStatus(
+ CloudPolicyValidatorBase::Status validation_status);
+
+// Returns a textual description of |store_status| for display in the UI. If
+// |store_status| is STATUS_VALIDATION_FAILED, |validation_status| will be
+// consulted to create a description of the validation failure.
+POLICY_EXPORT string16 FormatStoreStatus(
+ CloudPolicyStore::Status store_status,
+ CloudPolicyValidatorBase::Status validation_status);
+
+} // namespace policy
+
+#endif // COMPONENTS_POLICY_CORE_BROWSER_CLOUD_MESSAGE_UTIL_H_
diff --git a/chrome/browser/policy/configuration_policy_handler.cc b/components/policy/core/browser/configuration_policy_handler.cc
index d0341d9..d1e4833 100644
--- a/chrome/browser/policy/configuration_policy_handler.cc
+++ b/components/policy/core/browser/configuration_policy_handler.cc
@@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#include "chrome/browser/policy/configuration_policy_handler.h"
+#include "components/policy/core/browser/configuration_policy_handler.h"
#include <algorithm>
@@ -13,7 +13,7 @@
#include "base/strings/string16.h"
#include "base/strings/string_number_conversions.h"
#include "base/strings/string_util.h"
-#include "chrome/browser/policy/configuration_policy_pref_store.h"
+#include "components/policy/core/browser/configuration_policy_pref_store.h"
#include "components/policy/core/browser/policy_error_map.h"
#include "components/policy/core/common/policy_map.h"
#include "grit/component_strings.h"
diff --git a/chrome/browser/policy/configuration_policy_handler.h b/components/policy/core/browser/configuration_policy_handler.h
index f7b7eae..2c9c5df 100644
--- a/chrome/browser/policy/configuration_policy_handler.h
+++ b/components/policy/core/browser/configuration_policy_handler.h
@@ -2,8 +2,8 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#ifndef CHROME_BROWSER_POLICY_CONFIGURATION_POLICY_HANDLER_H_
-#define CHROME_BROWSER_POLICY_CONFIGURATION_POLICY_HANDLER_H_
+#ifndef COMPONENTS_POLICY_CORE_BROWSER_CONFIGURATION_POLICY_HANDLER_H_
+#define COMPONENTS_POLICY_CORE_BROWSER_CONFIGURATION_POLICY_HANDLER_H_
#include <string>
#include <vector>
@@ -11,6 +11,7 @@
#include "base/basictypes.h"
#include "base/memory/scoped_ptr.h"
#include "base/values.h"
+#include "components/policy/policy_export.h"
class PrefValueMap;
@@ -20,7 +21,7 @@ class PolicyErrorMap;
class PolicyMap;
// Maps a policy type to a preference path, and to the expected value type.
-struct PolicyToPreferenceMapEntry {
+struct POLICY_EXPORT PolicyToPreferenceMapEntry {
const char* const policy_name;
const char* const preference_path;
const base::Value::Type value_type;
@@ -28,7 +29,7 @@ struct PolicyToPreferenceMapEntry {
// An abstract super class that subclasses should implement to map policies to
// their corresponding preferences, and to check whether the policies are valid.
-class ConfigurationPolicyHandler {
+class POLICY_EXPORT ConfigurationPolicyHandler {
public:
static std::string ValueTypeToString(Value::Type type);
@@ -58,7 +59,8 @@ class ConfigurationPolicyHandler {
// Abstract class derived from ConfigurationPolicyHandler that should be
// subclassed to handle a single policy (not a combination of policies).
-class TypeCheckingPolicyHandler : public ConfigurationPolicyHandler {
+class POLICY_EXPORT TypeCheckingPolicyHandler
+ : public ConfigurationPolicyHandler {
public:
TypeCheckingPolicyHandler(const char* policy_name,
base::Value::Type value_type);
@@ -89,7 +91,8 @@ class TypeCheckingPolicyHandler : public ConfigurationPolicyHandler {
// Abstract class derived from TypeCheckingPolicyHandler that ensures an int
// policy's value lies in an allowed range. Either clamps or rejects values
// outside the range.
-class IntRangePolicyHandlerBase : public TypeCheckingPolicyHandler {
+class POLICY_EXPORT IntRangePolicyHandlerBase
+ : public TypeCheckingPolicyHandler {
public:
IntRangePolicyHandlerBase(const char* policy_name,
int min,
@@ -125,7 +128,7 @@ class IntRangePolicyHandlerBase : public TypeCheckingPolicyHandler {
};
// ConfigurationPolicyHandler for policies that map directly to a preference.
-class SimplePolicyHandler : public TypeCheckingPolicyHandler {
+class POLICY_EXPORT SimplePolicyHandler : public TypeCheckingPolicyHandler {
public:
SimplePolicyHandler(const char* policy_name,
const char* pref_path,
@@ -145,9 +148,10 @@ class SimplePolicyHandler : public TypeCheckingPolicyHandler {
// A policy handler implementation that maps a string enum list to an int enum
// list as specified by a mapping table.
-class StringToIntEnumListPolicyHandler : public TypeCheckingPolicyHandler {
+class POLICY_EXPORT StringToIntEnumListPolicyHandler
+ : public TypeCheckingPolicyHandler {
public:
- struct MappingEntry {
+ struct POLICY_EXPORT MappingEntry {
const char* enum_value;
int int_value;
};
@@ -182,7 +186,7 @@ class StringToIntEnumListPolicyHandler : public TypeCheckingPolicyHandler {
// A policy handler implementation that ensures an int policy's value lies in an
// allowed range.
-class IntRangePolicyHandler : public IntRangePolicyHandlerBase {
+class POLICY_EXPORT IntRangePolicyHandler : public IntRangePolicyHandlerBase {
public:
IntRangePolicyHandler(const char* policy_name,
const char* pref_path,
@@ -204,7 +208,8 @@ class IntRangePolicyHandler : public IntRangePolicyHandlerBase {
// A policy handler implementation that maps an int percentage value to a
// double.
-class IntPercentageToDoublePolicyHandler : public IntRangePolicyHandlerBase {
+class POLICY_EXPORT IntPercentageToDoublePolicyHandler
+ : public IntRangePolicyHandlerBase {
public:
IntPercentageToDoublePolicyHandler(const char* policy_name,
const char* pref_path,
@@ -226,4 +231,4 @@ class IntPercentageToDoublePolicyHandler : public IntRangePolicyHandlerBase {
} // namespace policy
-#endif // CHROME_BROWSER_POLICY_CONFIGURATION_POLICY_HANDLER_H_
+#endif // COMPONENTS_POLICY_CORE_BROWSER_CONFIGURATION_POLICY_HANDLER_H_
diff --git a/chrome/browser/policy/configuration_policy_handler_list.cc b/components/policy/core/browser/configuration_policy_handler_list.cc
index 25413a7..cff71e3 100644
--- a/chrome/browser/policy/configuration_policy_handler_list.cc
+++ b/components/policy/core/browser/configuration_policy_handler_list.cc
@@ -2,11 +2,11 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#include "chrome/browser/policy/configuration_policy_handler_list.h"
+#include "components/policy/core/browser/configuration_policy_handler_list.h"
#include "base/prefs/pref_value_map.h"
#include "base/stl_util.h"
-#include "chrome/browser/policy/configuration_policy_handler.h"
+#include "components/policy/core/browser/configuration_policy_handler.h"
#include "components/policy/core/browser/policy_error_map.h"
#include "components/policy/core/common/policy_map.h"
#include "grit/component_strings.h"
diff --git a/chrome/browser/policy/configuration_policy_handler_list.h b/components/policy/core/browser/configuration_policy_handler_list.h
index 95b2008..5cbc55e 100644
--- a/chrome/browser/policy/configuration_policy_handler_list.h
+++ b/components/policy/core/browser/configuration_policy_handler_list.h
@@ -2,8 +2,8 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#ifndef CHROME_BROWSER_POLICY_CONFIGURATION_POLICY_HANDLER_LIST_H_
-#define CHROME_BROWSER_POLICY_CONFIGURATION_POLICY_HANDLER_LIST_H_
+#ifndef COMPONENTS_POLICY_CORE_BROWSER_CONFIGURATION_POLICY_HANDLER_LIST_H_
+#define COMPONENTS_POLICY_CORE_BROWSER_CONFIGURATION_POLICY_HANDLER_LIST_H_
#include <vector>
@@ -11,6 +11,7 @@
#include "base/callback.h"
#include "base/memory/scoped_ptr.h"
#include "components/policy/core/common/policy_details.h"
+#include "components/policy/policy_export.h"
class PrefValueMap;
@@ -24,7 +25,7 @@ struct PolicyToPreferenceMapEntry;
// Converts policies to their corresponding preferences by applying a list of
// ConfigurationPolicyHandler objects. This includes error checking and
// cleaning up policy values for displaying.
-class ConfigurationPolicyHandlerList {
+class POLICY_EXPORT ConfigurationPolicyHandlerList {
public:
explicit ConfigurationPolicyHandlerList(
const GetChromePolicyDetailsCallback& details_callback);
@@ -52,4 +53,4 @@ class ConfigurationPolicyHandlerList {
} // namespace policy
-#endif // CHROME_BROWSER_POLICY_CONFIGURATION_POLICY_HANDLER_LIST_H_
+#endif // COMPONENTS_POLICY_CORE_BROWSER_CONFIGURATION_POLICY_HANDLER_LIST_H_
diff --git a/chrome/browser/policy/configuration_policy_pref_store.cc b/components/policy/core/browser/configuration_policy_pref_store.cc
index 9c5e221..2551247 100644
--- a/chrome/browser/policy/configuration_policy_pref_store.cc
+++ b/components/policy/core/browser/configuration_policy_pref_store.cc
@@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#include "chrome/browser/policy/configuration_policy_pref_store.h"
+#include "components/policy/core/browser/configuration_policy_pref_store.h"
#include <string>
#include <vector>
@@ -13,7 +13,7 @@
#include "base/prefs/pref_value_map.h"
#include "base/strings/string16.h"
#include "base/strings/utf_string_conversions.h"
-#include "chrome/browser/policy/configuration_policy_handler_list.h"
+#include "components/policy/core/browser/configuration_policy_handler_list.h"
#include "components/policy/core/browser/policy_error_map.h"
namespace policy {
diff --git a/chrome/browser/policy/configuration_policy_pref_store.h b/components/policy/core/browser/configuration_policy_pref_store.h
index 73261cb..38f4bf7 100644
--- a/chrome/browser/policy/configuration_policy_pref_store.h
+++ b/components/policy/core/browser/configuration_policy_pref_store.h
@@ -2,8 +2,8 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#ifndef CHROME_BROWSER_POLICY_CONFIGURATION_POLICY_PREF_STORE_H_
-#define CHROME_BROWSER_POLICY_CONFIGURATION_POLICY_PREF_STORE_H_
+#ifndef COMPONENTS_POLICY_CORE_BROWSER_CONFIGURATION_POLICY_PREF_STORE_H_
+#define COMPONENTS_POLICY_CORE_BROWSER_CONFIGURATION_POLICY_PREF_STORE_H_
#include <string>
@@ -12,9 +12,10 @@
#include "base/observer_list.h"
#include "base/prefs/pref_store.h"
#include "base/values.h"
-#include "chrome/browser/policy/policy_service.h"
#include "components/policy/core/common/policy_map.h"
+#include "components/policy/core/common/policy_service.h"
#include "components/policy/core/common/policy_types.h"
+#include "components/policy/policy_export.h"
class PrefValueMap;
@@ -25,7 +26,7 @@ class ConfigurationPolicyHandlerList;
// An implementation of PrefStore that bridges policy settings as read from the
// PolicyService to preferences. Converts POLICY_DOMAIN_CHROME policies a given
// PolicyLevel to their corresponding preferences.
-class ConfigurationPolicyPrefStore
+class POLICY_EXPORT ConfigurationPolicyPrefStore
: public PrefStore,
public PolicyService::Observer {
public:
@@ -81,4 +82,4 @@ class ConfigurationPolicyPrefStore
} // namespace policy
-#endif // CHROME_BROWSER_POLICY_CONFIGURATION_POLICY_PREF_STORE_H_
+#endif // COMPONENTS_POLICY_CORE_BROWSER_CONFIGURATION_POLICY_PREF_STORE_H_
diff --git a/components/policy/core/common/DEPS b/components/policy/core/common/DEPS
new file mode 100644
index 0000000..1fc5291
--- /dev/null
+++ b/components/policy/core/common/DEPS
@@ -0,0 +1,3 @@
+include_rules = [
+ "-components/policy/core/browser",
+]
diff --git a/chrome/browser/policy/cloud/cloud_external_data_manager.cc b/components/policy/core/common/cloud/cloud_external_data_manager.cc
index 797ffd0..0d2995e 100644
--- a/chrome/browser/policy/cloud/cloud_external_data_manager.cc
+++ b/components/policy/core/common/cloud/cloud_external_data_manager.cc
@@ -2,9 +2,9 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#include "chrome/browser/policy/cloud/cloud_external_data_manager.h"
+#include "components/policy/core/common/cloud/cloud_external_data_manager.h"
-#include "chrome/browser/policy/cloud/cloud_policy_store.h"
+#include "components/policy/core/common/cloud/cloud_policy_store.h"
#include "net/url_request/url_request_context_getter.h"
namespace policy {
diff --git a/chrome/browser/policy/cloud/cloud_external_data_manager.h b/components/policy/core/common/cloud/cloud_external_data_manager.h
index 112312d..a5b8eca 100644
--- a/chrome/browser/policy/cloud/cloud_external_data_manager.h
+++ b/components/policy/core/common/cloud/cloud_external_data_manager.h
@@ -2,8 +2,8 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#ifndef CHROME_BROWSER_POLICY_CLOUD_CLOUD_EXTERNAL_DATA_MANAGER_H_
-#define CHROME_BROWSER_POLICY_CLOUD_CLOUD_EXTERNAL_DATA_MANAGER_H_
+#ifndef COMPONENTS_POLICY_CORE_COMMON_CLOUD_CLOUD_EXTERNAL_DATA_MANAGER_H_
+#define COMPONENTS_POLICY_CORE_COMMON_CLOUD_CLOUD_EXTERNAL_DATA_MANAGER_H_
#include <map>
#include <string>
@@ -12,6 +12,7 @@
#include "base/memory/ref_counted.h"
#include "base/memory/weak_ptr.h"
#include "components/policy/core/common/external_data_manager.h"
+#include "components/policy/policy_export.h"
namespace net {
class URLRequestContextGetter;
@@ -24,9 +25,9 @@ class CloudPolicyStore;
// Downloads, verifies, caches and retrieves external data referenced by
// policies.
// This a common base class used by cloud policy implementations and mocks.
-class CloudExternalDataManager : public ExternalDataManager {
+class POLICY_EXPORT CloudExternalDataManager : public ExternalDataManager {
public:
- struct MetadataEntry {
+ struct POLICY_EXPORT MetadataEntry {
MetadataEntry();
MetadataEntry(const std::string& url, const std::string& hash);
@@ -71,4 +72,4 @@ class CloudExternalDataManager : public ExternalDataManager {
} // namespace policy
-#endif // CHROME_BROWSER_POLICY_CLOUD_CLOUD_EXTERNAL_DATA_MANAGER_H_
+#endif // COMPONENTS_POLICY_CORE_COMMON_CLOUD_CLOUD_EXTERNAL_DATA_MANAGER_H_
diff --git a/chrome/browser/policy/cloud/cloud_policy_client.cc b/components/policy/core/common/cloud/cloud_policy_client.cc
index da09698..efd95f2 100644
--- a/chrome/browser/policy/cloud/cloud_policy_client.cc
+++ b/components/policy/core/common/cloud/cloud_policy_client.cc
@@ -2,13 +2,13 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#include "chrome/browser/policy/cloud/cloud_policy_client.h"
+#include "components/policy/core/common/cloud/cloud_policy_client.h"
#include "base/bind.h"
#include "base/guid.h"
#include "base/logging.h"
#include "base/stl_util.h"
-#include "chrome/browser/policy/cloud/device_management_service.h"
+#include "components/policy/core/common/cloud/device_management_service.h"
#include "google_apis/gaia/gaia_constants.h"
#include "google_apis/gaia/gaia_urls.h"
#include "net/url_request/url_request_context_getter.h"
diff --git a/chrome/browser/policy/cloud/cloud_policy_client.h b/components/policy/core/common/cloud/cloud_policy_client.h
index cd2911f..3720e52 100644
--- a/chrome/browser/policy/cloud/cloud_policy_client.h
+++ b/components/policy/core/common/cloud/cloud_policy_client.h
@@ -2,8 +2,8 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#ifndef CHROME_BROWSER_POLICY_CLOUD_CLOUD_POLICY_CLIENT_H_
-#define CHROME_BROWSER_POLICY_CLOUD_CLOUD_POLICY_CLIENT_H_
+#ifndef COMPONENTS_POLICY_CORE_COMMON_CLOUD_CLOUD_POLICY_CLIENT_H_
+#define COMPONENTS_POLICY_CORE_COMMON_CLOUD_CLOUD_POLICY_CLIENT_H_
#include <map>
#include <set>
@@ -14,8 +14,9 @@
#include "base/memory/scoped_ptr.h"
#include "base/observer_list.h"
#include "base/time/time.h"
-#include "chrome/browser/policy/cloud/cloud_policy_constants.h"
#include "chrome/browser/policy/proto/cloud/device_management_backend.pb.h"
+#include "components/policy/core/common/cloud/cloud_policy_constants.h"
+#include "components/policy/policy_export.h"
namespace net {
class URLRequestContextGetter;
@@ -34,7 +35,7 @@ class DeviceManagementService;
// Note that CloudPolicyClient doesn't do any validation of policy responses
// such as signature and time stamp checks. These happen once the policy gets
// installed in the cloud policy cache.
-class CloudPolicyClient {
+class POLICY_EXPORT CloudPolicyClient {
public:
// Maps a PolicyNamespaceKey to its corresponding PolicyFetchResponse.
typedef std::map<PolicyNamespaceKey,
@@ -45,7 +46,7 @@ class CloudPolicyClient {
typedef base::Callback<void(bool status)> StatusCallback;
// Observer interface for state and policy changes.
- class Observer {
+ class POLICY_EXPORT Observer {
public:
virtual ~Observer();
@@ -68,7 +69,7 @@ class CloudPolicyClient {
// Delegate interface for supplying status information to upload to the server
// as part of the policy fetch request.
- class StatusProvider {
+ class POLICY_EXPORT StatusProvider {
public:
virtual ~StatusProvider();
@@ -293,4 +294,4 @@ class CloudPolicyClient {
} // namespace policy
-#endif // CHROME_BROWSER_POLICY_CLOUD_CLOUD_POLICY_CLIENT_H_
+#endif // COMPONENTS_POLICY_CORE_COMMON_CLOUD_CLOUD_POLICY_CLIENT_H_
diff --git a/chrome/browser/policy/cloud/cloud_policy_client_registration_helper.cc b/components/policy/core/common/cloud/cloud_policy_client_registration_helper.cc
index 8fdc3b8..b95b45e 100644
--- a/chrome/browser/policy/cloud/cloud_policy_client_registration_helper.cc
+++ b/components/policy/core/common/cloud/cloud_policy_client_registration_helper.cc
@@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#include "chrome/browser/policy/cloud/cloud_policy_client_registration_helper.h"
+#include "components/policy/core/common/cloud/cloud_policy_client_registration_helper.h"
#include <vector>
diff --git a/chrome/browser/policy/cloud/cloud_policy_client_registration_helper.h b/components/policy/core/common/cloud/cloud_policy_client_registration_helper.h
index 8e0afe0..f1f2dc7 100644
--- a/chrome/browser/policy/cloud/cloud_policy_client_registration_helper.h
+++ b/components/policy/core/common/cloud/cloud_policy_client_registration_helper.h
@@ -2,8 +2,8 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#ifndef CHROME_BROWSER_POLICY_CLOUD_CLOUD_POLICY_CLIENT_REGISTRATION_HELPER_H_
-#define CHROME_BROWSER_POLICY_CLOUD_CLOUD_POLICY_CLIENT_REGISTRATION_HELPER_H_
+#ifndef COMPONENTS_POLICY_CORE_COMMON_CLOUD_CLOUD_POLICY_CLIENT_REGISTRATION_HELPER_H_
+#define COMPONENTS_POLICY_CORE_COMMON_CLOUD_CLOUD_POLICY_CLIENT_REGISTRATION_HELPER_H_
#include <string>
@@ -11,9 +11,10 @@
#include "base/callback.h"
#include "base/compiler_specific.h"
#include "base/memory/scoped_ptr.h"
-#include "chrome/browser/policy/cloud/cloud_policy_client.h"
-#include "chrome/browser/policy/cloud/user_info_fetcher.h"
#include "chrome/browser/policy/proto/cloud/device_management_backend.pb.h"
+#include "components/policy/core/common/cloud/cloud_policy_client.h"
+#include "components/policy/core/common/cloud/user_info_fetcher.h"
+#include "components/policy/policy_export.h"
class OAuth2TokenService;
@@ -26,8 +27,9 @@ namespace policy {
// Helper class that registers a CloudPolicyClient. It fetches an OAuth2 token
// for the DM service if needed, and checks with Gaia if the account has policy
// management enabled.
-class CloudPolicyClientRegistrationHelper : public UserInfoFetcher::Delegate,
- public CloudPolicyClient::Observer {
+class POLICY_EXPORT CloudPolicyClientRegistrationHelper
+ : public UserInfoFetcher::Delegate,
+ public CloudPolicyClient::Observer {
public:
// |context| and |client| are not owned and must outlive this object.
// If |should_force_load_policy| then the cloud policy registration is
@@ -110,4 +112,4 @@ class CloudPolicyClientRegistrationHelper : public UserInfoFetcher::Delegate,
} // namespace policy
-#endif // CHROME_BROWSER_POLICY_CLOUD_CLOUD_POLICY_CLIENT_REGISTRATION_HELPER_H_
+#endif // COMPONENTS_POLICY_CORE_COMMON_CLOUD_CLOUD_POLICY_CLIENT_REGISTRATION_HELPER_H_
diff --git a/chrome/browser/policy/cloud/cloud_policy_client_unittest.cc b/components/policy/core/common/cloud/cloud_policy_client_unittest.cc
index ce2fcd92e..3ea7338 100644
--- a/chrome/browser/policy/cloud/cloud_policy_client_unittest.cc
+++ b/components/policy/core/common/cloud/cloud_policy_client_unittest.cc
@@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#include "chrome/browser/policy/cloud/cloud_policy_client.h"
+#include "components/policy/core/common/cloud/cloud_policy_client.h"
#include <map>
#include <set>
@@ -11,9 +11,9 @@
#include "base/compiler_specific.h"
#include "base/memory/scoped_ptr.h"
#include "base/message_loop/message_loop.h"
-#include "chrome/browser/policy/cloud/mock_cloud_policy_client.h"
-#include "chrome/browser/policy/cloud/mock_device_management_service.h"
#include "chrome/browser/policy/proto/cloud/device_management_backend.pb.h"
+#include "components/policy/core/common/cloud/mock_cloud_policy_client.h"
+#include "components/policy/core/common/cloud/mock_device_management_service.h"
#include "net/url_request/url_request_context_getter.h"
#include "net/url_request/url_request_test_util.h"
#include "testing/gmock/include/gmock/gmock.h"
diff --git a/chrome/browser/policy/cloud/cloud_policy_constants.cc b/components/policy/core/common/cloud/cloud_policy_constants.cc
index bc45143..c88f1fa 100644
--- a/chrome/browser/policy/cloud/cloud_policy_constants.cc
+++ b/components/policy/core/common/cloud/cloud_policy_constants.cc
@@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#include "chrome/browser/policy/cloud/cloud_policy_constants.h"
+#include "components/policy/core/common/cloud/cloud_policy_constants.h"
#include "base/command_line.h"
#include "components/policy/core/common/policy_switches.h"
diff --git a/chrome/browser/policy/cloud/cloud_policy_constants.h b/components/policy/core/common/cloud/cloud_policy_constants.h
index aab6f16..a45dcab 100644
--- a/chrome/browser/policy/cloud/cloud_policy_constants.h
+++ b/components/policy/core/common/cloud/cloud_policy_constants.h
@@ -2,44 +2,46 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#ifndef CHROME_BROWSER_POLICY_CLOUD_CLOUD_POLICY_CONSTANTS_H_
-#define CHROME_BROWSER_POLICY_CLOUD_CLOUD_POLICY_CONSTANTS_H_
+#ifndef COMPONENTS_POLICY_CORE_COMMON_CLOUD_CLOUD_POLICY_CONSTANTS_H_
+#define COMPONENTS_POLICY_CORE_COMMON_CLOUD_CLOUD_POLICY_CONSTANTS_H_
#include <string>
#include <utility>
+#include "components/policy/policy_export.h"
+
namespace policy {
// Constants related to the device management protocol.
namespace dm_protocol {
// Name extern constants for URL query parameters.
-extern const char kParamAgent[];
-extern const char kParamAppType[];
-extern const char kParamDeviceID[];
-extern const char kParamDeviceType[];
-extern const char kParamOAuthToken[];
-extern const char kParamPlatform[];
-extern const char kParamRequest[];
-extern const char kParamUserAffiliation[];
+POLICY_EXPORT extern const char kParamAgent[];
+POLICY_EXPORT extern const char kParamAppType[];
+POLICY_EXPORT extern const char kParamDeviceID[];
+POLICY_EXPORT extern const char kParamDeviceType[];
+POLICY_EXPORT extern const char kParamOAuthToken[];
+POLICY_EXPORT extern const char kParamPlatform[];
+POLICY_EXPORT extern const char kParamRequest[];
+POLICY_EXPORT extern const char kParamUserAffiliation[];
// String extern constants for the device and app type we report to the server.
-extern const char kValueAppType[];
-extern const char kValueDeviceType[];
-extern const char kValueRequestAutoEnrollment[];
-extern const char kValueRequestPolicy[];
-extern const char kValueRequestRegister[];
-extern const char kValueRequestApiAuthorization[];
-extern const char kValueRequestUnregister[];
-extern const char kValueRequestUploadCertificate[];
-extern const char kValueUserAffiliationManaged[];
-extern const char kValueUserAffiliationNone[];
+POLICY_EXPORT extern const char kValueAppType[];
+POLICY_EXPORT extern const char kValueDeviceType[];
+POLICY_EXPORT extern const char kValueRequestAutoEnrollment[];
+POLICY_EXPORT extern const char kValueRequestPolicy[];
+POLICY_EXPORT extern const char kValueRequestRegister[];
+POLICY_EXPORT extern const char kValueRequestApiAuthorization[];
+POLICY_EXPORT extern const char kValueRequestUnregister[];
+POLICY_EXPORT extern const char kValueRequestUploadCertificate[];
+POLICY_EXPORT extern const char kValueUserAffiliationManaged[];
+POLICY_EXPORT extern const char kValueUserAffiliationNone[];
// Policy type strings for the policy_type field in PolicyFetchRequest.
-extern const char kChromeDevicePolicyType[];
-extern const char kChromeUserPolicyType[];
-extern const char kChromePublicAccountPolicyType[];
-extern const char kChromeExtensionPolicyType[];
+POLICY_EXPORT extern const char kChromeDevicePolicyType[];
+POLICY_EXPORT extern const char kChromeUserPolicyType[];
+POLICY_EXPORT extern const char kChromePublicAccountPolicyType[];
+POLICY_EXPORT extern const char kChromeExtensionPolicyType[];
// These codes are sent in the |error_code| field of PolicyFetchResponse.
enum PolicyFetchStatus {
@@ -108,8 +110,8 @@ typedef std::pair<std::string, std::string> PolicyNamespaceKey;
// default user policy type on Android and iOS for testing purposes.
// TODO(joaodasilva): remove this once the server is ready.
// http://crbug.com/248527
-const char* GetChromeUserPolicyType();
+POLICY_EXPORT const char* GetChromeUserPolicyType();
} // namespace policy
-#endif // CHROME_BROWSER_POLICY_CLOUD_CLOUD_POLICY_CONSTANTS_H_
+#endif // COMPONENTS_POLICY_CORE_COMMON_CLOUD_CLOUD_POLICY_CONSTANTS_H_
diff --git a/chrome/browser/policy/cloud/cloud_policy_core.cc b/components/policy/core/common/cloud/cloud_policy_core.cc
index 7697df3..7b560e7 100644
--- a/chrome/browser/policy/cloud/cloud_policy_core.cc
+++ b/components/policy/core/common/cloud/cloud_policy_core.cc
@@ -2,15 +2,15 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#include "chrome/browser/policy/cloud/cloud_policy_core.h"
+#include "components/policy/core/common/cloud/cloud_policy_core.h"
#include "base/bind.h"
#include "base/bind_helpers.h"
#include "base/prefs/pref_service.h"
-#include "chrome/browser/policy/cloud/cloud_policy_client.h"
-#include "chrome/browser/policy/cloud/cloud_policy_refresh_scheduler.h"
-#include "chrome/browser/policy/cloud/cloud_policy_service.h"
-#include "chrome/browser/policy/cloud/cloud_policy_store.h"
+#include "components/policy/core/common/cloud/cloud_policy_client.h"
+#include "components/policy/core/common/cloud/cloud_policy_refresh_scheduler.h"
+#include "components/policy/core/common/cloud/cloud_policy_service.h"
+#include "components/policy/core/common/cloud/cloud_policy_store.h"
namespace policy {
diff --git a/chrome/browser/policy/cloud/cloud_policy_core.h b/components/policy/core/common/cloud/cloud_policy_core.h
index 48ca11e..6279dfe 100644
--- a/chrome/browser/policy/cloud/cloud_policy_core.h
+++ b/components/policy/core/common/cloud/cloud_policy_core.h
@@ -2,8 +2,8 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#ifndef CHROME_BROWSER_POLICY_CLOUD_CLOUD_POLICY_CORE_H_
-#define CHROME_BROWSER_POLICY_CLOUD_CLOUD_POLICY_CORE_H_
+#ifndef COMPONENTS_POLICY_CORE_COMMON_CLOUD_CLOUD_POLICY_CORE_H_
+#define COMPONENTS_POLICY_CORE_COMMON_CLOUD_CLOUD_POLICY_CORE_H_
#include <string>
@@ -12,7 +12,8 @@
#include "base/memory/scoped_ptr.h"
#include "base/observer_list.h"
#include "base/prefs/pref_member.h"
-#include "chrome/browser/policy/cloud/cloud_policy_constants.h"
+#include "components/policy/core/common/cloud/cloud_policy_constants.h"
+#include "components/policy/policy_export.h"
class PrefService;
@@ -33,10 +34,10 @@ class CloudPolicyStore;
// and storing it locally, respectively, as well as a CloudPolicyService
// instance that moves data between the two former components, and
// CloudPolicyRefreshScheduler which triggers periodic refreshes.
-class CloudPolicyCore {
+class POLICY_EXPORT CloudPolicyCore {
public:
// Callbacks for policy core events.
- class Observer {
+ class POLICY_EXPORT Observer {
public:
virtual ~Observer();
@@ -114,4 +115,4 @@ class CloudPolicyCore {
} // namespace policy
-#endif // CHROME_BROWSER_POLICY_CLOUD_CLOUD_POLICY_CORE_H_
+#endif // COMPONENTS_POLICY_CORE_COMMON_CLOUD_CLOUD_POLICY_CORE_H_
diff --git a/chrome/browser/policy/cloud/cloud_policy_core_unittest.cc b/components/policy/core/common/cloud/cloud_policy_core_unittest.cc
index 7d57735..ea6efe9 100644
--- a/chrome/browser/policy/cloud/cloud_policy_core_unittest.cc
+++ b/components/policy/core/common/cloud/cloud_policy_core_unittest.cc
@@ -2,16 +2,16 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#include "chrome/browser/policy/cloud/cloud_policy_core.h"
+#include "components/policy/core/common/cloud/cloud_policy_core.h"
#include "base/basictypes.h"
#include "base/message_loop/message_loop.h"
#include "base/prefs/pref_registry_simple.h"
#include "base/prefs/testing_pref_service.h"
-#include "chrome/browser/policy/cloud/cloud_policy_constants.h"
-#include "chrome/browser/policy/cloud/cloud_policy_refresh_scheduler.h"
-#include "chrome/browser/policy/cloud/mock_cloud_policy_client.h"
-#include "chrome/browser/policy/cloud/mock_cloud_policy_store.h"
+#include "components/policy/core/common/cloud/cloud_policy_constants.h"
+#include "components/policy/core/common/cloud/cloud_policy_refresh_scheduler.h"
+#include "components/policy/core/common/cloud/mock_cloud_policy_client.h"
+#include "components/policy/core/common/cloud/mock_cloud_policy_store.h"
#include "components/policy/core/common/policy_pref_names.h"
#include "testing/gtest/include/gtest/gtest.h"
diff --git a/chrome/browser/policy/cloud/cloud_policy_manager.cc b/components/policy/core/common/cloud/cloud_policy_manager.cc
index e3a01a9..73d121a 100644
--- a/chrome/browser/policy/cloud/cloud_policy_manager.cc
+++ b/components/policy/core/common/cloud/cloud_policy_manager.cc
@@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#include "chrome/browser/policy/cloud/cloud_policy_manager.h"
+#include "components/policy/core/common/cloud/cloud_policy_manager.h"
#include "base/bind.h"
#include "base/bind_helpers.h"
@@ -10,14 +10,14 @@
#include "base/files/file_path.h"
#include "base/logging.h"
#include "base/prefs/pref_service.h"
-#include "chrome/browser/policy/cloud/cloud_policy_service.h"
+#include "components/policy/core/common/cloud/cloud_policy_service.h"
#include "components/policy/core/common/policy_bundle.h"
#include "components/policy/core/common/policy_map.h"
#include "components/policy/core/common/policy_switches.h"
#include "net/url_request/url_request_context_getter.h"
#if !defined(OS_ANDROID) && !defined(OS_IOS)
-#include "chrome/browser/policy/cloud/resource_cache.h"
+#include "components/policy/core/common/cloud/resource_cache.h"
#endif
namespace policy {
diff --git a/chrome/browser/policy/cloud/cloud_policy_manager.h b/components/policy/core/common/cloud/cloud_policy_manager.h
index 8ae1614..0a04414 100644
--- a/chrome/browser/policy/cloud/cloud_policy_manager.h
+++ b/components/policy/core/common/cloud/cloud_policy_manager.h
@@ -2,8 +2,8 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#ifndef CHROME_BROWSER_POLICY_CLOUD_CLOUD_POLICY_MANAGER_H_
-#define CHROME_BROWSER_POLICY_CLOUD_CLOUD_POLICY_MANAGER_H_
+#ifndef COMPONENTS_POLICY_CORE_COMMON_CLOUD_CLOUD_POLICY_MANAGER_H_
+#define COMPONENTS_POLICY_CORE_COMMON_CLOUD_CLOUD_POLICY_MANAGER_H_
#include <string>
@@ -12,11 +12,12 @@
#include "base/memory/ref_counted.h"
#include "base/memory/scoped_ptr.h"
#include "base/prefs/pref_member.h"
-#include "chrome/browser/policy/cloud/cloud_policy_constants.h"
-#include "chrome/browser/policy/cloud/cloud_policy_core.h"
-#include "chrome/browser/policy/cloud/cloud_policy_store.h"
-#include "chrome/browser/policy/cloud/component_cloud_policy_service.h"
+#include "components/policy/core/common/cloud/cloud_policy_constants.h"
+#include "components/policy/core/common/cloud/cloud_policy_core.h"
+#include "components/policy/core/common/cloud/cloud_policy_store.h"
+#include "components/policy/core/common/cloud/component_cloud_policy_service.h"
#include "components/policy/core/common/configuration_policy_provider.h"
+#include "components/policy/policy_export.h"
namespace base {
class FilePath;
@@ -36,9 +37,10 @@ namespace policy {
// This class contains the base functionality, there are subclasses that add
// functionality specific to user-level and device-level cloud policy, such as
// blocking on initial user policy fetch or device enrollment.
-class CloudPolicyManager : public ConfigurationPolicyProvider,
- public CloudPolicyStore::Observer,
- public ComponentCloudPolicyService::Delegate {
+class POLICY_EXPORT CloudPolicyManager
+ : public ConfigurationPolicyProvider,
+ public CloudPolicyStore::Observer,
+ public ComponentCloudPolicyService::Delegate {
public:
// |task_runner| is the runner for policy refresh tasks.
// |file_task_runner| is used for file operations. Currently this must be the
@@ -109,4 +111,4 @@ class CloudPolicyManager : public ConfigurationPolicyProvider,
} // namespace policy
-#endif // CHROME_BROWSER_POLICY_CLOUD_CLOUD_POLICY_MANAGER_H_
+#endif // COMPONENTS_POLICY_CORE_COMMON_CLOUD_CLOUD_POLICY_MANAGER_H_
diff --git a/chrome/browser/policy/cloud/cloud_policy_manager_unittest.cc b/components/policy/core/common/cloud/cloud_policy_manager_unittest.cc
index 5e871ff..274b95d 100644
--- a/chrome/browser/policy/cloud/cloud_policy_manager_unittest.cc
+++ b/components/policy/core/common/cloud/cloud_policy_manager_unittest.cc
@@ -2,17 +2,17 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#include "chrome/browser/policy/cloud/cloud_policy_manager.h"
+#include "components/policy/core/common/cloud/cloud_policy_manager.h"
#include "base/basictypes.h"
#include "base/callback.h"
#include "base/compiler_specific.h"
#include "base/memory/scoped_ptr.h"
#include "base/message_loop/message_loop.h"
-#include "chrome/browser/policy/cloud/cloud_policy_constants.h"
-#include "chrome/browser/policy/cloud/mock_cloud_policy_client.h"
-#include "chrome/browser/policy/cloud/mock_cloud_policy_store.h"
-#include "chrome/browser/policy/cloud/policy_builder.h"
+#include "components/policy/core/common/cloud/cloud_policy_constants.h"
+#include "components/policy/core/common/cloud/mock_cloud_policy_client.h"
+#include "components/policy/core/common/cloud/mock_cloud_policy_store.h"
+#include "components/policy/core/common/cloud/policy_builder.h"
#include "components/policy/core/common/configuration_policy_provider_test.h"
#include "components/policy/core/common/external_data_fetcher.h"
#include "components/policy/core/common/mock_configuration_policy_provider.h"
diff --git a/chrome/browser/policy/cloud/cloud_policy_refresh_scheduler.cc b/components/policy/core/common/cloud/cloud_policy_refresh_scheduler.cc
index aaf1c29..b0a556b 100644
--- a/chrome/browser/policy/cloud/cloud_policy_refresh_scheduler.cc
+++ b/components/policy/core/common/cloud/cloud_policy_refresh_scheduler.cc
@@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#include "chrome/browser/policy/cloud/cloud_policy_refresh_scheduler.h"
+#include "components/policy/core/common/cloud/cloud_policy_refresh_scheduler.h"
#include <algorithm>
@@ -14,7 +14,7 @@
#include "base/sequenced_task_runner.h"
#include "base/time/default_tick_clock.h"
#include "base/time/tick_clock.h"
-#include "chrome/browser/policy/cloud/cloud_policy_constants.h"
+#include "components/policy/core/common/cloud/cloud_policy_constants.h"
#include "components/policy/core/common/policy_switches.h"
namespace policy {
diff --git a/chrome/browser/policy/cloud/cloud_policy_refresh_scheduler.h b/components/policy/core/common/cloud/cloud_policy_refresh_scheduler.h
index a3d121b..afba9b3 100644
--- a/chrome/browser/policy/cloud/cloud_policy_refresh_scheduler.h
+++ b/components/policy/core/common/cloud/cloud_policy_refresh_scheduler.h
@@ -2,16 +2,17 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#ifndef CHROME_BROWSER_POLICY_CLOUD_CLOUD_POLICY_REFRESH_SCHEDULER_H_
-#define CHROME_BROWSER_POLICY_CLOUD_CLOUD_POLICY_REFRESH_SCHEDULER_H_
+#ifndef COMPONENTS_POLICY_CORE_COMMON_CLOUD_CLOUD_POLICY_REFRESH_SCHEDULER_H_
+#define COMPONENTS_POLICY_CORE_COMMON_CLOUD_CLOUD_POLICY_REFRESH_SCHEDULER_H_
#include "base/basictypes.h"
#include "base/cancelable_callback.h"
#include "base/memory/ref_counted.h"
#include "base/time/time.h"
-#include "chrome/browser/policy/cloud/cloud_policy_client.h"
-#include "chrome/browser/policy/cloud/cloud_policy_store.h"
-#include "chrome/browser/policy/cloud/rate_limiter.h"
+#include "components/policy/core/common/cloud/cloud_policy_client.h"
+#include "components/policy/core/common/cloud/cloud_policy_store.h"
+#include "components/policy/core/common/cloud/rate_limiter.h"
+#include "components/policy/policy_export.h"
#include "net/base/network_change_notifier.h"
namespace base {
@@ -22,7 +23,7 @@ namespace policy {
// Observes CloudPolicyClient and CloudPolicyStore to trigger periodic policy
// fetches and issue retries on error conditions.
-class CloudPolicyRefreshScheduler
+class POLICY_EXPORT CloudPolicyRefreshScheduler
: public CloudPolicyClient::Observer,
public CloudPolicyStore::Observer,
public net::NetworkChangeNotifier::IPAddressObserver {
@@ -152,4 +153,4 @@ class CloudPolicyRefreshScheduler
} // namespace policy
-#endif // CHROME_BROWSER_POLICY_CLOUD_CLOUD_POLICY_REFRESH_SCHEDULER_H_
+#endif // COMPONENTS_POLICY_CORE_COMMON_CLOUD_CLOUD_POLICY_REFRESH_SCHEDULER_H_
diff --git a/chrome/browser/policy/cloud/cloud_policy_refresh_scheduler_unittest.cc b/components/policy/core/common/cloud/cloud_policy_refresh_scheduler_unittest.cc
index 85a256d..d50d5b9 100644
--- a/chrome/browser/policy/cloud/cloud_policy_refresh_scheduler_unittest.cc
+++ b/components/policy/core/common/cloud/cloud_policy_refresh_scheduler_unittest.cc
@@ -8,11 +8,10 @@
#include "base/memory/scoped_ptr.h"
#include "base/message_loop/message_loop.h"
#include "base/test/test_simple_task_runner.h"
-#include "chrome/browser/policy/cloud/cloud_policy_constants.h"
-#include "chrome/browser/policy/cloud/cloud_policy_refresh_scheduler.h"
-#include "chrome/browser/policy/cloud/mock_cloud_policy_client.h"
-#include "chrome/browser/policy/cloud/mock_cloud_policy_store.h"
-#include "policy/policy_constants.h"
+#include "components/policy/core/common/cloud/cloud_policy_constants.h"
+#include "components/policy/core/common/cloud/cloud_policy_refresh_scheduler.h"
+#include "components/policy/core/common/cloud/mock_cloud_policy_client.h"
+#include "components/policy/core/common/cloud/mock_cloud_policy_store.h"
#include "testing/gmock/include/gmock/gmock.h"
#include "testing/gtest/include/gtest/gtest.h"
diff --git a/chrome/browser/policy/cloud/cloud_policy_service.cc b/components/policy/core/common/cloud/cloud_policy_service.cc
index fd71677..8eb7a45 100644
--- a/chrome/browser/policy/cloud/cloud_policy_service.cc
+++ b/components/policy/core/common/cloud/cloud_policy_service.cc
@@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#include "chrome/browser/policy/cloud/cloud_policy_service.h"
+#include "components/policy/core/common/cloud/cloud_policy_service.h"
#include "base/callback.h"
#include "chrome/browser/policy/proto/cloud/device_management_backend.pb.h"
diff --git a/chrome/browser/policy/cloud/cloud_policy_service.h b/components/policy/core/common/cloud/cloud_policy_service.h
index 9437527..a6139a3 100644
--- a/chrome/browser/policy/cloud/cloud_policy_service.h
+++ b/components/policy/core/common/cloud/cloud_policy_service.h
@@ -2,8 +2,8 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#ifndef CHROME_BROWSER_POLICY_CLOUD_CLOUD_POLICY_SERVICE_H_
-#define CHROME_BROWSER_POLICY_CLOUD_CLOUD_POLICY_SERVICE_H_
+#ifndef COMPONENTS_POLICY_CORE_COMMON_CLOUD_CLOUD_POLICY_SERVICE_H_
+#define COMPONENTS_POLICY_CORE_COMMON_CLOUD_CLOUD_POLICY_SERVICE_H_
#include <string>
#include <vector>
@@ -12,23 +12,24 @@
#include "base/callback_forward.h"
#include "base/compiler_specific.h"
#include "base/observer_list.h"
-#include "chrome/browser/policy/cloud/cloud_policy_client.h"
-#include "chrome/browser/policy/cloud/cloud_policy_constants.h"
-#include "chrome/browser/policy/cloud/cloud_policy_store.h"
+#include "components/policy/core/common/cloud/cloud_policy_client.h"
+#include "components/policy/core/common/cloud/cloud_policy_constants.h"
+#include "components/policy/core/common/cloud/cloud_policy_store.h"
+#include "components/policy/policy_export.h"
namespace policy {
// Coordinates cloud policy handling, moving downloaded policy from the client
// to the store, and setting up client registrations from cached data in the
// store. Also coordinates actions on policy refresh triggers.
-class CloudPolicyService : public CloudPolicyClient::Observer,
- public CloudPolicyStore::Observer {
+class POLICY_EXPORT CloudPolicyService : public CloudPolicyClient::Observer,
+ public CloudPolicyStore::Observer {
public:
// Callback invoked once the policy refresh attempt has completed. Passed
// bool parameter is true if the refresh was successful (no error).
typedef base::Callback<void(bool)> RefreshPolicyCallback;
- class Observer {
+ class POLICY_EXPORT Observer {
public:
// Invoked when CloudPolicyService has finished initializing (any initial
// policy load activity has completed and the CloudPolicyClient has
@@ -110,4 +111,4 @@ class CloudPolicyService : public CloudPolicyClient::Observer,
} // namespace policy
-#endif // CHROME_BROWSER_POLICY_CLOUD_CLOUD_POLICY_SERVICE_H_
+#endif // COMPONENTS_POLICY_CORE_COMMON_CLOUD_CLOUD_POLICY_SERVICE_H_
diff --git a/chrome/browser/policy/cloud/cloud_policy_service_unittest.cc b/components/policy/core/common/cloud/cloud_policy_service_unittest.cc
index 68c22ee..c4fbc65 100644
--- a/chrome/browser/policy/cloud/cloud_policy_service_unittest.cc
+++ b/components/policy/core/common/cloud/cloud_policy_service_unittest.cc
@@ -2,14 +2,14 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#include "chrome/browser/policy/cloud/cloud_policy_service.h"
+#include "components/policy/core/common/cloud/cloud_policy_service.h"
#include "base/bind.h"
#include "base/callback.h"
-#include "chrome/browser/policy/cloud/cloud_policy_constants.h"
-#include "chrome/browser/policy/cloud/mock_cloud_policy_client.h"
-#include "chrome/browser/policy/cloud/mock_cloud_policy_store.h"
#include "chrome/browser/policy/proto/cloud/device_management_backend.pb.h"
+#include "components/policy/core/common/cloud/cloud_policy_constants.h"
+#include "components/policy/core/common/cloud/mock_cloud_policy_client.h"
+#include "components/policy/core/common/cloud/mock_cloud_policy_store.h"
#include "testing/gmock/include/gmock/gmock.h"
#include "testing/gtest/include/gtest/gtest.h"
diff --git a/chrome/browser/policy/cloud/cloud_policy_store.cc b/components/policy/core/common/cloud/cloud_policy_store.cc
index 2c6dca7..f254b9c 100644
--- a/chrome/browser/policy/cloud/cloud_policy_store.cc
+++ b/components/policy/core/common/cloud/cloud_policy_store.cc
@@ -2,10 +2,10 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#include "chrome/browser/policy/cloud/cloud_policy_store.h"
+#include "components/policy/core/common/cloud/cloud_policy_store.h"
#include "base/logging.h"
-#include "chrome/browser/policy/cloud/cloud_external_data_manager.h"
+#include "components/policy/core/common/cloud/cloud_external_data_manager.h"
namespace policy {
diff --git a/chrome/browser/policy/cloud/cloud_policy_store.h b/components/policy/core/common/cloud/cloud_policy_store.h
index 2f26e6e..550cbb2 100644
--- a/chrome/browser/policy/cloud/cloud_policy_store.h
+++ b/components/policy/core/common/cloud/cloud_policy_store.h
@@ -2,16 +2,17 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#ifndef CHROME_BROWSER_POLICY_CLOUD_CLOUD_POLICY_STORE_H_
-#define CHROME_BROWSER_POLICY_CLOUD_CLOUD_POLICY_STORE_H_
+#ifndef COMPONENTS_POLICY_CORE_COMMON_CLOUD_CLOUD_POLICY_STORE_H_
+#define COMPONENTS_POLICY_CORE_COMMON_CLOUD_CLOUD_POLICY_STORE_H_
#include "base/basictypes.h"
#include "base/memory/scoped_ptr.h"
#include "base/memory/weak_ptr.h"
#include "base/observer_list.h"
-#include "chrome/browser/policy/cloud/cloud_policy_validator.h"
#include "chrome/browser/policy/proto/cloud/device_management_backend.pb.h"
+#include "components/policy/core/common/cloud/cloud_policy_validator.h"
#include "components/policy/core/common/policy_map.h"
+#include "components/policy/policy_export.h"
namespace policy {
@@ -21,7 +22,7 @@ class CloudExternalDataManager;
// 1. Validate policy blobs that should be applied locally
// 2. Persist policy blobs
// 3. Decode policy blobs to PolicyMap representation
-class CloudPolicyStore {
+class POLICY_EXPORT CloudPolicyStore {
public:
// Status codes.
enum Status {
@@ -42,7 +43,7 @@ class CloudPolicyStore {
};
// Callbacks for policy store events. Most importantly, policy updates.
- class Observer {
+ class POLICY_EXPORT Observer {
public:
virtual ~Observer();
@@ -161,4 +162,4 @@ class CloudPolicyStore {
} // namespace policy
-#endif // CHROME_BROWSER_POLICY_CLOUD_CLOUD_POLICY_STORE_H_
+#endif // COMPONENTS_POLICY_CORE_COMMON_CLOUD_CLOUD_POLICY_STORE_H_
diff --git a/chrome/browser/policy/cloud/cloud_policy_validator.cc b/components/policy/core/common/cloud/cloud_policy_validator.cc
index 8e148e2..5471afa 100644
--- a/chrome/browser/policy/cloud/cloud_policy_validator.cc
+++ b/components/policy/core/common/cloud/cloud_policy_validator.cc
@@ -2,14 +2,14 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#include "chrome/browser/policy/cloud/cloud_policy_validator.h"
+#include "components/policy/core/common/cloud/cloud_policy_validator.h"
#include "base/bind_helpers.h"
#include "base/message_loop/message_loop.h"
#include "base/sequenced_task_runner.h"
#include "base/stl_util.h"
-#include "chrome/browser/policy/cloud/cloud_policy_constants.h"
#include "chrome/browser/policy/proto/cloud/device_management_backend.pb.h"
+#include "components/policy/core/common/cloud/cloud_policy_constants.h"
#include "crypto/signature_verifier.h"
#include "google_apis/gaia/gaia_auth_util.h"
diff --git a/chrome/browser/policy/cloud/cloud_policy_validator.h b/components/policy/core/common/cloud/cloud_policy_validator.h
index 5b6ed4b..6e43b91 100644
--- a/chrome/browser/policy/cloud/cloud_policy_validator.h
+++ b/components/policy/core/common/cloud/cloud_policy_validator.h
@@ -2,8 +2,8 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#ifndef CHROME_BROWSER_POLICY_CLOUD_CLOUD_POLICY_VALIDATOR_H_
-#define CHROME_BROWSER_POLICY_CLOUD_CLOUD_POLICY_VALIDATOR_H_
+#ifndef COMPONENTS_POLICY_CORE_COMMON_CLOUD_CLOUD_POLICY_VALIDATOR_H_
+#define COMPONENTS_POLICY_CORE_COMMON_CLOUD_CLOUD_POLICY_VALIDATOR_H_
#include <string>
#include <vector>
@@ -16,6 +16,7 @@
#include "base/sequenced_task_runner.h"
#include "base/time/time.h"
#include "chrome/browser/policy/proto/cloud/chrome_extension_policy.pb.h"
+#include "components/policy/policy_export.h"
#include "policy/proto/cloud_policy.pb.h"
namespace base {
@@ -40,7 +41,7 @@ namespace policy {
// thread. The pattern is to create a validator, configure its behavior through
// the ValidateXYZ() functions, and then call StartValidation(). Alternatively,
// RunValidation() can be used to perform validation on the current thread.
-class CloudPolicyValidatorBase {
+class POLICY_EXPORT CloudPolicyValidatorBase {
public:
// Validation result codes. These values are also used for UMA histograms;
// they must stay stable, and the UMA counters must be updated if new elements
@@ -247,7 +248,7 @@ class CloudPolicyValidatorBase {
// A simple type-parameterized extension of CloudPolicyValidator that
// facilitates working with the actual protobuf payload type.
template<typename PayloadProto>
-class CloudPolicyValidator : public CloudPolicyValidatorBase {
+class POLICY_EXPORT CloudPolicyValidator : public CloudPolicyValidatorBase {
public:
typedef base::Callback<void(CloudPolicyValidator<PayloadProto>*)>
CompletionCallback;
@@ -300,4 +301,4 @@ typedef CloudPolicyValidator<enterprise_management::ExternalPolicyData>
} // namespace policy
-#endif // CHROME_BROWSER_POLICY_CLOUD_CLOUD_POLICY_VALIDATOR_H_
+#endif // COMPONENTS_POLICY_CORE_COMMON_CLOUD_CLOUD_POLICY_VALIDATOR_H_
diff --git a/chrome/browser/policy/cloud/cloud_policy_validator_unittest.cc b/components/policy/core/common/cloud/cloud_policy_validator_unittest.cc
index 88f9f48..c2302d7 100644
--- a/chrome/browser/policy/cloud/cloud_policy_validator_unittest.cc
+++ b/components/policy/core/common/cloud/cloud_policy_validator_unittest.cc
@@ -9,9 +9,9 @@
#include "base/message_loop/message_loop.h"
#include "base/message_loop/message_loop_proxy.h"
#include "base/strings/string_util.h"
-#include "chrome/browser/policy/cloud/cloud_policy_constants.h"
-#include "chrome/browser/policy/cloud/cloud_policy_validator.h"
-#include "chrome/browser/policy/cloud/policy_builder.h"
+#include "components/policy/core/common/cloud/cloud_policy_constants.h"
+#include "components/policy/core/common/cloud/cloud_policy_validator.h"
+#include "components/policy/core/common/cloud/policy_builder.h"
#include "crypto/rsa_private_key.h"
#include "testing/gmock/include/gmock/gmock.h"
#include "testing/gtest/include/gtest/gtest.h"
diff --git a/chrome/browser/policy/cloud/component_cloud_policy_service.cc b/components/policy/core/common/cloud/component_cloud_policy_service.cc
index f19b3ff..b7a5c8c 100644
--- a/chrome/browser/policy/cloud/component_cloud_policy_service.cc
+++ b/components/policy/core/common/cloud/component_cloud_policy_service.cc
@@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#include "chrome/browser/policy/cloud/component_cloud_policy_service.h"
+#include "components/policy/core/common/cloud/component_cloud_policy_service.h"
#include <string>
@@ -12,13 +12,13 @@
#include "base/logging.h"
#include "base/message_loop/message_loop_proxy.h"
#include "base/sequenced_task_runner.h"
-#include "chrome/browser/policy/cloud/cloud_policy_constants.h"
-#include "chrome/browser/policy/cloud/cloud_policy_refresh_scheduler.h"
-#include "chrome/browser/policy/cloud/component_cloud_policy_store.h"
-#include "chrome/browser/policy/cloud/component_cloud_policy_updater.h"
-#include "chrome/browser/policy/cloud/external_policy_data_fetcher.h"
-#include "chrome/browser/policy/cloud/resource_cache.h"
#include "chrome/browser/policy/proto/cloud/device_management_backend.pb.h"
+#include "components/policy/core/common/cloud/cloud_policy_constants.h"
+#include "components/policy/core/common/cloud/cloud_policy_refresh_scheduler.h"
+#include "components/policy/core/common/cloud/component_cloud_policy_store.h"
+#include "components/policy/core/common/cloud/component_cloud_policy_updater.h"
+#include "components/policy/core/common/cloud/external_policy_data_fetcher.h"
+#include "components/policy/core/common/cloud/resource_cache.h"
#include "components/policy/core/common/schema.h"
#include "components/policy/core/common/schema_map.h"
#include "net/url_request/url_request_context_getter.h"
diff --git a/chrome/browser/policy/cloud/component_cloud_policy_service.h b/components/policy/core/common/cloud/component_cloud_policy_service.h
index 95ae7ed..281d72c 100644
--- a/chrome/browser/policy/cloud/component_cloud_policy_service.h
+++ b/components/policy/core/common/cloud/component_cloud_policy_service.h
@@ -2,8 +2,8 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#ifndef CHROME_BROWSER_POLICY_CLOUD_COMPONENT_CLOUD_POLICY_SERVICE_H_
-#define CHROME_BROWSER_POLICY_CLOUD_COMPONENT_CLOUD_POLICY_SERVICE_H_
+#ifndef COMPONENTS_POLICY_CORE_COMMON_CLOUD_COMPONENT_CLOUD_POLICY_SERVICE_H_
+#define COMPONENTS_POLICY_CORE_COMMON_CLOUD_COMPONENT_CLOUD_POLICY_SERVICE_H_
#include "base/basictypes.h"
#include "base/compiler_specific.h"
@@ -11,12 +11,13 @@
#include "base/memory/scoped_ptr.h"
#include "base/memory/weak_ptr.h"
#include "base/threading/non_thread_safe.h"
-#include "chrome/browser/policy/cloud/cloud_policy_client.h"
-#include "chrome/browser/policy/cloud/cloud_policy_core.h"
-#include "chrome/browser/policy/cloud/cloud_policy_store.h"
+#include "components/policy/core/common/cloud/cloud_policy_client.h"
+#include "components/policy/core/common/cloud/cloud_policy_core.h"
+#include "components/policy/core/common/cloud/cloud_policy_store.h"
#include "components/policy/core/common/policy_bundle.h"
#include "components/policy/core/common/policy_namespace.h"
#include "components/policy/core/common/schema_registry.h"
+#include "components/policy/policy_export.h"
namespace base {
class SequencedTaskRunner;
@@ -36,13 +37,14 @@ class SchemaMap;
//
// This class takes care of fetching, validating, storing and updating policy
// for components. The components to manage come from a SchemaRegistry.
-class ComponentCloudPolicyService : public CloudPolicyClient::Observer,
- public CloudPolicyCore::Observer,
- public CloudPolicyStore::Observer,
- public SchemaRegistry::Observer,
- public base::NonThreadSafe {
+class POLICY_EXPORT ComponentCloudPolicyService
+ : public CloudPolicyClient::Observer,
+ public CloudPolicyCore::Observer,
+ public CloudPolicyStore::Observer,
+ public SchemaRegistry::Observer,
+ public base::NonThreadSafe {
public:
- class Delegate {
+ class POLICY_EXPORT Delegate {
public:
virtual ~Delegate();
@@ -174,4 +176,4 @@ class ComponentCloudPolicyService : public CloudPolicyClient::Observer,
} // namespace policy
-#endif // CHROME_BROWSER_POLICY_CLOUD_COMPONENT_CLOUD_POLICY_SERVICE_H_
+#endif // COMPONENTS_POLICY_CORE_COMMON_CLOUD_COMPONENT_CLOUD_POLICY_SERVICE_H_
diff --git a/chrome/browser/policy/cloud/component_cloud_policy_service_stub.cc b/components/policy/core/common/cloud/component_cloud_policy_service_stub.cc
index 35ebc45..1926eac 100644
--- a/chrome/browser/policy/cloud/component_cloud_policy_service_stub.cc
+++ b/components/policy/core/common/cloud/component_cloud_policy_service_stub.cc
@@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#include "chrome/browser/policy/cloud/component_cloud_policy_service.h"
+#include "components/policy/core/common/cloud/component_cloud_policy_service.h"
#include "base/sequenced_task_runner.h"
#include "net/url_request/url_request_context_getter.h"
diff --git a/chrome/browser/policy/cloud/component_cloud_policy_service_unittest.cc b/components/policy/core/common/cloud/component_cloud_policy_service_unittest.cc
index e40855a..51cdd1f 100644
--- a/chrome/browser/policy/cloud/component_cloud_policy_service_unittest.cc
+++ b/components/policy/core/common/cloud/component_cloud_policy_service_unittest.cc
@@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#include "chrome/browser/policy/cloud/component_cloud_policy_service.h"
+#include "components/policy/core/common/cloud/component_cloud_policy_service.h"
#include <map>
#include <string>
@@ -15,13 +15,13 @@
#include "base/single_thread_task_runner.h"
#include "base/stl_util.h"
#include "base/values.h"
-#include "chrome/browser/policy/cloud/cloud_policy_constants.h"
-#include "chrome/browser/policy/cloud/mock_cloud_policy_client.h"
-#include "chrome/browser/policy/cloud/mock_cloud_policy_store.h"
-#include "chrome/browser/policy/cloud/policy_builder.h"
-#include "chrome/browser/policy/cloud/resource_cache.h"
#include "chrome/browser/policy/proto/cloud/chrome_extension_policy.pb.h"
#include "chrome/browser/policy/proto/cloud/device_management_backend.pb.h"
+#include "components/policy/core/common/cloud/cloud_policy_constants.h"
+#include "components/policy/core/common/cloud/mock_cloud_policy_client.h"
+#include "components/policy/core/common/cloud/mock_cloud_policy_store.h"
+#include "components/policy/core/common/cloud/policy_builder.h"
+#include "components/policy/core/common/cloud/resource_cache.h"
#include "components/policy/core/common/external_data_fetcher.h"
#include "components/policy/core/common/policy_map.h"
#include "components/policy/core/common/policy_types.h"
diff --git a/chrome/browser/policy/cloud/component_cloud_policy_store.cc b/components/policy/core/common/cloud/component_cloud_policy_store.cc
index 2ddc89b..32e8c5f 100644
--- a/chrome/browser/policy/cloud/component_cloud_policy_store.cc
+++ b/components/policy/core/common/cloud/component_cloud_policy_store.cc
@@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#include "chrome/browser/policy/cloud/component_cloud_policy_store.h"
+#include "components/policy/core/common/cloud/component_cloud_policy_store.h"
#include "base/callback.h"
#include "base/json/json_reader.h"
@@ -10,10 +10,10 @@
#include "base/sha1.h"
#include "base/strings/string_util.h"
#include "base/values.h"
-#include "chrome/browser/policy/cloud/cloud_policy_constants.h"
-#include "chrome/browser/policy/cloud/cloud_policy_validator.h"
#include "chrome/browser/policy/proto/cloud/chrome_extension_policy.pb.h"
#include "chrome/browser/policy/proto/cloud/device_management_backend.pb.h"
+#include "components/policy/core/common/cloud/cloud_policy_constants.h"
+#include "components/policy/core/common/cloud/cloud_policy_validator.h"
#include "components/policy/core/common/external_data_fetcher.h"
#include "components/policy/core/common/policy_map.h"
#include "url/gurl.h"
diff --git a/chrome/browser/policy/cloud/component_cloud_policy_store.h b/components/policy/core/common/cloud/component_cloud_policy_store.h
index b6f90da..8b9cf8c 100644
--- a/chrome/browser/policy/cloud/component_cloud_policy_store.h
+++ b/components/policy/core/common/cloud/component_cloud_policy_store.h
@@ -2,8 +2,8 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#ifndef CHROME_BROWSER_POLICY_CLOUD_COMPONENT_CLOUD_POLICY_STORE_H_
-#define CHROME_BROWSER_POLICY_CLOUD_COMPONENT_CLOUD_POLICY_STORE_H_
+#ifndef COMPONENTS_POLICY_CORE_COMMON_CLOUD_COMPONENT_CLOUD_POLICY_STORE_H_
+#define COMPONENTS_POLICY_CORE_COMMON_CLOUD_COMPONENT_CLOUD_POLICY_STORE_H_
#include <map>
#include <string>
@@ -11,9 +11,10 @@
#include "base/basictypes.h"
#include "base/memory/scoped_ptr.h"
#include "base/threading/non_thread_safe.h"
-#include "chrome/browser/policy/cloud/resource_cache.h"
+#include "components/policy/core/common/cloud/resource_cache.h"
#include "components/policy/core/common/policy_bundle.h"
#include "components/policy/core/common/policy_namespace.h"
+#include "components/policy/policy_export.h"
namespace enterprise_management {
class ExternalPolicyData;
@@ -25,9 +26,9 @@ namespace policy {
// Validates protobufs for external policy data, validates the data itself, and
// caches both locally.
-class ComponentCloudPolicyStore : public base::NonThreadSafe {
+class POLICY_EXPORT ComponentCloudPolicyStore : public base::NonThreadSafe {
public:
- class Delegate {
+ class POLICY_EXPORT Delegate {
public:
virtual ~Delegate();
@@ -141,4 +142,4 @@ class ComponentCloudPolicyStore : public base::NonThreadSafe {
} // namespace policy
-#endif // CHROME_BROWSER_POLICY_CLOUD_COMPONENT_CLOUD_POLICY_STORE_H_
+#endif // COMPONENTS_POLICY_CORE_COMMON_CLOUD_COMPONENT_CLOUD_POLICY_STORE_H_
diff --git a/chrome/browser/policy/cloud/component_cloud_policy_store_unittest.cc b/components/policy/core/common/cloud/component_cloud_policy_store_unittest.cc
index aed849b..03898b1 100644
--- a/chrome/browser/policy/cloud/component_cloud_policy_store_unittest.cc
+++ b/components/policy/core/common/cloud/component_cloud_policy_store_unittest.cc
@@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#include "chrome/browser/policy/cloud/component_cloud_policy_store.h"
+#include "components/policy/core/common/cloud/component_cloud_policy_store.h"
#include <map>
#include <string>
@@ -14,11 +14,11 @@
#include "base/memory/ref_counted.h"
#include "base/sha1.h"
#include "base/test/test_simple_task_runner.h"
-#include "chrome/browser/policy/cloud/cloud_policy_constants.h"
-#include "chrome/browser/policy/cloud/policy_builder.h"
-#include "chrome/browser/policy/cloud/resource_cache.h"
#include "chrome/browser/policy/proto/cloud/chrome_extension_policy.pb.h"
#include "chrome/browser/policy/proto/cloud/device_management_backend.pb.h"
+#include "components/policy/core/common/cloud/cloud_policy_constants.h"
+#include "components/policy/core/common/cloud/policy_builder.h"
+#include "components/policy/core/common/cloud/resource_cache.h"
#include "components/policy/core/common/external_data_fetcher.h"
#include "testing/gmock/include/gmock/gmock.h"
#include "testing/gtest/include/gtest/gtest.h"
diff --git a/chrome/browser/policy/cloud/component_cloud_policy_updater.cc b/components/policy/core/common/cloud/component_cloud_policy_updater.cc
index 43cfb27..e9fda10 100644
--- a/chrome/browser/policy/cloud/component_cloud_policy_updater.cc
+++ b/components/policy/core/common/cloud/component_cloud_policy_updater.cc
@@ -2,17 +2,17 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#include "chrome/browser/policy/cloud/component_cloud_policy_updater.h"
+#include "components/policy/core/common/cloud/component_cloud_policy_updater.h"
#include "base/bind.h"
#include "base/bind_helpers.h"
#include "base/logging.h"
#include "base/sequenced_task_runner.h"
#include "base/strings/string_number_conversions.h"
-#include "chrome/browser/policy/cloud/component_cloud_policy_store.h"
-#include "chrome/browser/policy/cloud/external_policy_data_fetcher.h"
#include "chrome/browser/policy/proto/cloud/chrome_extension_policy.pb.h"
#include "chrome/browser/policy/proto/cloud/device_management_backend.pb.h"
+#include "components/policy/core/common/cloud/component_cloud_policy_store.h"
+#include "components/policy/core/common/cloud/external_policy_data_fetcher.h"
namespace em = enterprise_management;
diff --git a/chrome/browser/policy/cloud/component_cloud_policy_updater.h b/components/policy/core/common/cloud/component_cloud_policy_updater.h
index f711607..9584b03 100644
--- a/chrome/browser/policy/cloud/component_cloud_policy_updater.h
+++ b/components/policy/core/common/cloud/component_cloud_policy_updater.h
@@ -2,16 +2,17 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#ifndef CHROME_BROWSER_POLICY_CLOUD_COMPONENT_CLOUD_POLICY_UPDATER_H_
-#define CHROME_BROWSER_POLICY_CLOUD_COMPONENT_CLOUD_POLICY_UPDATER_H_
+#ifndef COMPONENTS_POLICY_CORE_COMMON_CLOUD_COMPONENT_CLOUD_POLICY_UPDATER_H_
+#define COMPONENTS_POLICY_CORE_COMMON_CLOUD_COMPONENT_CLOUD_POLICY_UPDATER_H_
#include <string>
#include "base/basictypes.h"
#include "base/memory/ref_counted.h"
#include "base/memory/scoped_ptr.h"
-#include "chrome/browser/policy/cloud/external_policy_data_updater.h"
+#include "components/policy/core/common/cloud/external_policy_data_updater.h"
#include "components/policy/core/common/policy_namespace.h"
+#include "components/policy/policy_export.h"
namespace base {
class SequencedTaskRunner;
@@ -31,7 +32,7 @@ class ExternalPolicyDataFetcher;
// them in a ComponentCloudPolicyStore. It also enforces size limits on what's
// cached.
// It retries to download the policy data periodically when a download fails.
-class ComponentCloudPolicyUpdater {
+class POLICY_EXPORT ComponentCloudPolicyUpdater {
public:
// This class runs on the background thread represented by |task_runner|,
// which must support file I/O. All network I/O is delegated to the
@@ -63,4 +64,4 @@ class ComponentCloudPolicyUpdater {
} // namespace policy
-#endif // CHROME_BROWSER_POLICY_CLOUD_COMPONENT_CLOUD_POLICY_UPDATER_H_
+#endif // COMPONENTS_POLICY_CORE_COMMON_CLOUD_COMPONENT_CLOUD_POLICY_UPDATER_H_
diff --git a/chrome/browser/policy/cloud/component_cloud_policy_updater_unittest.cc b/components/policy/core/common/cloud/component_cloud_policy_updater_unittest.cc
index f5ca82b..21a5d30 100644
--- a/chrome/browser/policy/cloud/component_cloud_policy_updater_unittest.cc
+++ b/components/policy/core/common/cloud/component_cloud_policy_updater_unittest.cc
@@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#include "chrome/browser/policy/cloud/component_cloud_policy_updater.h"
+#include "components/policy/core/common/cloud/component_cloud_policy_updater.h"
#include "base/callback.h"
#include "base/compiler_specific.h"
@@ -11,13 +11,13 @@
#include "base/sha1.h"
#include "base/test/test_simple_task_runner.h"
#include "base/values.h"
-#include "chrome/browser/policy/cloud/cloud_policy_constants.h"
-#include "chrome/browser/policy/cloud/component_cloud_policy_store.h"
-#include "chrome/browser/policy/cloud/external_policy_data_fetcher.h"
-#include "chrome/browser/policy/cloud/policy_builder.h"
-#include "chrome/browser/policy/cloud/resource_cache.h"
#include "chrome/browser/policy/proto/cloud/chrome_extension_policy.pb.h"
#include "chrome/browser/policy/proto/cloud/device_management_backend.pb.h"
+#include "components/policy/core/common/cloud/cloud_policy_constants.h"
+#include "components/policy/core/common/cloud/component_cloud_policy_store.h"
+#include "components/policy/core/common/cloud/external_policy_data_fetcher.h"
+#include "components/policy/core/common/cloud/policy_builder.h"
+#include "components/policy/core/common/cloud/resource_cache.h"
#include "components/policy/core/common/external_data_fetcher.h"
#include "components/policy/core/common/policy_bundle.h"
#include "components/policy/core/common/policy_map.h"
diff --git a/chrome/browser/policy/cloud/device_management_service.cc b/components/policy/core/common/cloud/device_management_service.cc
index 51b3a904..5c96005 100644
--- a/chrome/browser/policy/cloud/device_management_service.cc
+++ b/components/policy/core/common/cloud/device_management_service.cc
@@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#include "chrome/browser/policy/cloud/device_management_service.h"
+#include "components/policy/core/common/cloud/device_management_service.h"
#include <utility>
diff --git a/chrome/browser/policy/cloud/device_management_service.h b/components/policy/core/common/cloud/device_management_service.h
index 12ee862..d76405e 100644
--- a/chrome/browser/policy/cloud/device_management_service.h
+++ b/components/policy/core/common/cloud/device_management_service.h
@@ -2,8 +2,8 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#ifndef CHROME_BROWSER_POLICY_CLOUD_DEVICE_MANAGEMENT_SERVICE_H_
-#define CHROME_BROWSER_POLICY_CLOUD_DEVICE_MANAGEMENT_SERVICE_H_
+#ifndef COMPONENTS_POLICY_CORE_COMMON_CLOUD_DEVICE_MANAGEMENT_SERVICE_H_
+#define COMPONENTS_POLICY_CORE_COMMON_CLOUD_DEVICE_MANAGEMENT_SERVICE_H_
#include <deque>
#include <map>
@@ -14,8 +14,9 @@
#include "base/callback.h"
#include "base/compiler_specific.h"
#include "base/memory/weak_ptr.h"
-#include "chrome/browser/policy/cloud/cloud_policy_constants.h"
#include "chrome/browser/policy/proto/cloud/device_management_backend.pb.h"
+#include "components/policy/core/common/cloud/cloud_policy_constants.h"
+#include "components/policy/policy_export.h"
#include "net/url_request/url_fetcher_delegate.h"
namespace net {
@@ -30,7 +31,7 @@ class DeviceManagementService;
// DeviceManagementRequestJob describes a request to send to the device
// management service. Jobs are created by DeviceManagementService. They can be
// canceled by deleting the object.
-class DeviceManagementRequestJob {
+class POLICY_EXPORT DeviceManagementRequestJob {
public:
// Describes the job type.
enum JobType {
@@ -98,13 +99,13 @@ class DeviceManagementRequestJob {
// communication with the device management server. It creates the backends
// objects that the device management policy provider and friends use to issue
// requests.
-class DeviceManagementService : public net::URLFetcherDelegate {
+class POLICY_EXPORT DeviceManagementService : public net::URLFetcherDelegate {
public:
// Obtains the parameters used to contact the server.
// This allows creating the DeviceManagementService early and getting these
// parameters later. Passing the parameters directly in the ctor isn't
// possible because some aren't ready during startup. http://crbug.com/302798
- class Configuration {
+ class POLICY_EXPORT Configuration {
public:
virtual ~Configuration() {}
@@ -187,4 +188,4 @@ class DeviceManagementService : public net::URLFetcherDelegate {
} // namespace policy
-#endif // CHROME_BROWSER_POLICY_CLOUD_DEVICE_MANAGEMENT_SERVICE_H_
+#endif // COMPONENTS_POLICY_CORE_COMMON_CLOUD_DEVICE_MANAGEMENT_SERVICE_H_
diff --git a/chrome/browser/policy/cloud/device_management_service_unittest.cc b/components/policy/core/common/cloud/device_management_service_unittest.cc
index e9a7490..1d92834 100644
--- a/chrome/browser/policy/cloud/device_management_service_unittest.cc
+++ b/components/policy/core/common/cloud/device_management_service_unittest.cc
@@ -10,9 +10,9 @@
#include "base/message_loop/message_loop_proxy.h"
#include "base/run_loop.h"
#include "base/strings/string_split.h"
-#include "chrome/browser/policy/cloud/cloud_policy_constants.h"
-#include "chrome/browser/policy/cloud/device_management_service.h"
-#include "chrome/browser/policy/cloud/mock_device_management_service.h"
+#include "components/policy/core/common/cloud/cloud_policy_constants.h"
+#include "components/policy/core/common/cloud/device_management_service.h"
+#include "components/policy/core/common/cloud/mock_device_management_service.h"
#include "net/base/escape.h"
#include "net/base/load_flags.h"
#include "net/base/net_errors.h"
diff --git a/chrome/browser/policy/cloud/enterprise_metrics.cc b/components/policy/core/common/cloud/enterprise_metrics.cc
index b9d4eda..12394fa 100644
--- a/chrome/browser/policy/cloud/enterprise_metrics.cc
+++ b/components/policy/core/common/cloud/enterprise_metrics.cc
@@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#include "chrome/browser/policy/cloud/enterprise_metrics.h"
+#include "components/policy/core/common/cloud/enterprise_metrics.h"
namespace policy {
diff --git a/chrome/browser/policy/cloud/enterprise_metrics.h b/components/policy/core/common/cloud/enterprise_metrics.h
index 1b0c920..c7c5e8a 100644
--- a/chrome/browser/policy/cloud/enterprise_metrics.h
+++ b/components/policy/core/common/cloud/enterprise_metrics.h
@@ -2,8 +2,10 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#ifndef CHROME_BROWSER_POLICY_CLOUD_ENTERPRISE_METRICS_H_
-#define CHROME_BROWSER_POLICY_CLOUD_ENTERPRISE_METRICS_H_
+#ifndef COMPONENTS_POLICY_CORE_COMMON_CLOUD_ENTERPRISE_METRICS_H_
+#define COMPONENTS_POLICY_CORE_COMMON_CLOUD_ENTERPRISE_METRICS_H_
+
+#include "components/policy/policy_export.h"
namespace policy {
@@ -189,12 +191,12 @@ enum MetricPolicyRefresh {
// Names for the UMA counters. They are shared from here since the events
// from the same enum above can be triggered in different files, and must use
// the same UMA histogram name.
-extern const char kMetricToken[];
-extern const char kMetricPolicy[];
-extern const char kMetricEnrollment[];
-extern const char kMetricPolicyRefresh[];
-extern const char kMetricPolicyInvalidations[];
+POLICY_EXPORT extern const char kMetricToken[];
+POLICY_EXPORT extern const char kMetricPolicy[];
+POLICY_EXPORT extern const char kMetricEnrollment[];
+POLICY_EXPORT extern const char kMetricPolicyRefresh[];
+POLICY_EXPORT extern const char kMetricPolicyInvalidations[];
} // namespace policy
-#endif // CHROME_BROWSER_POLICY_CLOUD_ENTERPRISE_METRICS_H_
+#endif // COMPONENTS_POLICY_CORE_COMMON_CLOUD_ENTERPRISE_METRICS_H_
diff --git a/chrome/browser/policy/cloud/external_policy_data_fetcher.cc b/components/policy/core/common/cloud/external_policy_data_fetcher.cc
index a2e00d5..cc9bd13 100644
--- a/chrome/browser/policy/cloud/external_policy_data_fetcher.cc
+++ b/components/policy/core/common/cloud/external_policy_data_fetcher.cc
@@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#include "chrome/browser/policy/cloud/external_policy_data_fetcher.h"
+#include "components/policy/core/common/cloud/external_policy_data_fetcher.h"
#include "base/bind.h"
#include "base/bind_helpers.h"
diff --git a/chrome/browser/policy/cloud/external_policy_data_fetcher.h b/components/policy/core/common/cloud/external_policy_data_fetcher.h
index 587f3a8..8f42aa8 100644
--- a/chrome/browser/policy/cloud/external_policy_data_fetcher.h
+++ b/components/policy/core/common/cloud/external_policy_data_fetcher.h
@@ -2,8 +2,8 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#ifndef CHROME_BROWSER_POLICY_CLOUD_EXTERNAL_POLICY_DATA_FETCHER_H_
-#define CHROME_BROWSER_POLICY_CLOUD_EXTERNAL_POLICY_DATA_FETCHER_H_
+#ifndef COMPONENTS_POLICY_CORE_COMMON_CLOUD_EXTERNAL_POLICY_DATA_FETCHER_H_
+#define COMPONENTS_POLICY_CORE_COMMON_CLOUD_EXTERNAL_POLICY_DATA_FETCHER_H_
#include <map>
#include <set>
@@ -15,6 +15,7 @@
#include "base/memory/ref_counted.h"
#include "base/memory/scoped_ptr.h"
#include "base/memory/weak_ptr.h"
+#include "components/policy/policy_export.h"
#include "net/url_request/url_fetcher_delegate.h"
#include "url/gurl.h"
@@ -38,7 +39,7 @@ class ExternalPolicyDataFetcherBackend;
// The class can be instantiated on any thread but from then on, it must be
// accessed and destroyed on the background thread that the
// ExternalPolicyDataUpdater runs on only.
-class ExternalPolicyDataFetcher {
+class POLICY_EXPORT ExternalPolicyDataFetcher {
public:
// The result of a fetch job.
enum Result {
@@ -122,7 +123,8 @@ class ExternalPolicyDataFetcher {
// CreateFrontend() may be called from the same thread after instantiation. From
// then on, it must be accessed and destroyed on the thread that handles network
// I/O only (in Chrome, this is the IO thread).
-class ExternalPolicyDataFetcherBackend : public net::URLFetcherDelegate {
+class POLICY_EXPORT ExternalPolicyDataFetcherBackend
+ : public net::URLFetcherDelegate {
public:
// Callback invoked when a fetch job finishes. If the fetch was successful,
// the Result is SUCCESS and the scoped_ptr contains the retrieved data.
@@ -179,4 +181,4 @@ class ExternalPolicyDataFetcherBackend : public net::URLFetcherDelegate {
} // namespace policy
-#endif // CHROME_BROWSER_POLICY_CLOUD_EXTERNAL_POLICY_DATA_FETCHER_H_
+#endif // COMPONENTS_POLICY_CORE_COMMON_CLOUD_EXTERNAL_POLICY_DATA_FETCHER_H_
diff --git a/chrome/browser/policy/cloud/external_policy_data_fetcher_unittest.cc b/components/policy/core/common/cloud/external_policy_data_fetcher_unittest.cc
index 4641c03..7c403fb 100644
--- a/chrome/browser/policy/cloud/external_policy_data_fetcher_unittest.cc
+++ b/components/policy/core/common/cloud/external_policy_data_fetcher_unittest.cc
@@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#include "chrome/browser/policy/cloud/external_policy_data_fetcher.h"
+#include "components/policy/core/common/cloud/external_policy_data_fetcher.h"
#include "base/bind.h"
#include "base/bind_helpers.h"
diff --git a/chrome/browser/policy/cloud/external_policy_data_updater.cc b/components/policy/core/common/cloud/external_policy_data_updater.cc
index da2e8f1..e584470 100644
--- a/chrome/browser/policy/cloud/external_policy_data_updater.cc
+++ b/components/policy/core/common/cloud/external_policy_data_updater.cc
@@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#include "chrome/browser/policy/cloud/external_policy_data_updater.h"
+#include "components/policy/core/common/cloud/external_policy_data_updater.h"
#include "base/bind.h"
#include "base/bind_helpers.h"
@@ -12,7 +12,7 @@
#include "base/sequenced_task_runner.h"
#include "base/sha1.h"
#include "base/stl_util.h"
-#include "chrome/browser/policy/cloud/external_policy_data_fetcher.h"
+#include "components/policy/core/common/cloud/external_policy_data_fetcher.h"
#include "net/base/backoff_entry.h"
#include "url/gurl.h"
diff --git a/chrome/browser/policy/cloud/external_policy_data_updater.h b/components/policy/core/common/cloud/external_policy_data_updater.h
index 2ac776b..78b6b7c 100644
--- a/chrome/browser/policy/cloud/external_policy_data_updater.h
+++ b/components/policy/core/common/cloud/external_policy_data_updater.h
@@ -2,8 +2,8 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#ifndef CHROME_BROWSER_POLICY_CLOUD_EXTERNAL_POLICY_DATA_UPDATER_H_
-#define CHROME_BROWSER_POLICY_CLOUD_EXTERNAL_POLICY_DATA_UPDATER_H_
+#ifndef COMPONENTS_POLICY_CORE_COMMON_CLOUD_EXTERNAL_POLICY_DATA_UPDATER_H_
+#define COMPONENTS_POLICY_CORE_COMMON_CLOUD_EXTERNAL_POLICY_DATA_UPDATER_H_
#include <map>
#include <queue>
@@ -14,6 +14,7 @@
#include "base/memory/ref_counted.h"
#include "base/memory/scoped_ptr.h"
#include "base/memory/weak_ptr.h"
+#include "components/policy/policy_export.h"
namespace base {
class SequencedTaskRunner;
@@ -31,9 +32,9 @@ class ExternalPolicyDataFetcher;
// with exponential backoff.
// The actual fetching is handled by an ExternalPolicyDataFetcher, allowing this
// class to run on a background thread where network I/O is not possible.
-class ExternalPolicyDataUpdater {
+class POLICY_EXPORT ExternalPolicyDataUpdater {
public:
- struct Request {
+ struct POLICY_EXPORT Request {
public:
Request();
Request(const std::string& url, const std::string& hash, int64 max_size);
@@ -123,4 +124,4 @@ class ExternalPolicyDataUpdater {
} // namespace policy
-#endif // CHROME_BROWSER_POLICY_CLOUD_EXTERNAL_POLICY_DATA_UPDATER_H_
+#endif // COMPONENTS_POLICY_CORE_COMMON_CLOUD_EXTERNAL_POLICY_DATA_UPDATER_H_
diff --git a/chrome/browser/policy/cloud/external_policy_data_updater_unittest.cc b/components/policy/core/common/cloud/external_policy_data_updater_unittest.cc
index 7ce8e17..4a45be2 100644
--- a/chrome/browser/policy/cloud/external_policy_data_updater_unittest.cc
+++ b/components/policy/core/common/cloud/external_policy_data_updater_unittest.cc
@@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#include "chrome/browser/policy/cloud/external_policy_data_updater.h"
+#include "components/policy/core/common/cloud/external_policy_data_updater.h"
#include "base/bind.h"
#include "base/bind_helpers.h"
@@ -13,7 +13,7 @@
#include "base/test/test_pending_task.h"
#include "base/test/test_simple_task_runner.h"
#include "base/time/time.h"
-#include "chrome/browser/policy/cloud/external_policy_data_fetcher.h"
+#include "components/policy/core/common/cloud/external_policy_data_fetcher.h"
#include "net/base/net_errors.h"
#include "net/url_request/test_url_fetcher_factory.h"
#include "net/url_request/url_fetcher_delegate.h"
diff --git a/chrome/browser/policy/cloud/mock_cloud_external_data_manager.cc b/components/policy/core/common/cloud/mock_cloud_external_data_manager.cc
index d1b0c16..9e73e46 100644
--- a/chrome/browser/policy/cloud/mock_cloud_external_data_manager.cc
+++ b/components/policy/core/common/cloud/mock_cloud_external_data_manager.cc
@@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#include "chrome/browser/policy/cloud/mock_cloud_external_data_manager.h"
+#include "components/policy/core/common/cloud/mock_cloud_external_data_manager.h"
#include "base/callback.h"
#include "base/memory/weak_ptr.h"
diff --git a/chrome/browser/policy/cloud/mock_cloud_external_data_manager.h b/components/policy/core/common/cloud/mock_cloud_external_data_manager.h
index c1e3c10..cb4c5c9 100644
--- a/chrome/browser/policy/cloud/mock_cloud_external_data_manager.h
+++ b/components/policy/core/common/cloud/mock_cloud_external_data_manager.h
@@ -2,15 +2,15 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#ifndef CHROME_BROWSER_POLICY_CLOUD_MOCK_CLOUD_EXTERNAL_DATA_MANAGER_H_
-#define CHROME_BROWSER_POLICY_CLOUD_MOCK_CLOUD_EXTERNAL_DATA_MANAGER_H_
+#ifndef COMPONENTS_POLICY_CORE_COMMON_CLOUD_MOCK_CLOUD_EXTERNAL_DATA_MANAGER_H_
+#define COMPONENTS_POLICY_CORE_COMMON_CLOUD_MOCK_CLOUD_EXTERNAL_DATA_MANAGER_H_
#include <string>
#include "base/basictypes.h"
#include "base/memory/ref_counted.h"
#include "base/memory/scoped_ptr.h"
-#include "chrome/browser/policy/cloud/cloud_external_data_manager.h"
+#include "components/policy/core/common/cloud/cloud_external_data_manager.h"
#include "components/policy/core/common/external_data_fetcher.h"
#include "testing/gmock/include/gmock/gmock.h"
@@ -42,4 +42,4 @@ class MockCloudExternalDataManager : public CloudExternalDataManager {
} // namespace policy
-#endif // CHROME_BROWSER_POLICY_CLOUD_MOCK_CLOUD_EXTERNAL_DATA_MANAGER_H_
+#endif // COMPONENTS_POLICY_CORE_COMMON_CLOUD_MOCK_CLOUD_EXTERNAL_DATA_MANAGER_H_
diff --git a/chrome/browser/policy/cloud/mock_cloud_policy_client.cc b/components/policy/core/common/cloud/mock_cloud_policy_client.cc
index 12d8648..06a1a07 100644
--- a/chrome/browser/policy/cloud/mock_cloud_policy_client.cc
+++ b/components/policy/core/common/cloud/mock_cloud_policy_client.cc
@@ -2,8 +2,8 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#include "chrome/browser/policy/cloud/mock_cloud_policy_client.h"
#include "chrome/browser/policy/proto/cloud/device_management_backend.pb.h"
+#include "components/policy/core/common/cloud/mock_cloud_policy_client.h"
#include "net/url_request/url_request_context_getter.h"
namespace em = enterprise_management;
diff --git a/chrome/browser/policy/cloud/mock_cloud_policy_client.h b/components/policy/core/common/cloud/mock_cloud_policy_client.h
index db9aca9..434d2d8 100644
--- a/chrome/browser/policy/cloud/mock_cloud_policy_client.h
+++ b/components/policy/core/common/cloud/mock_cloud_policy_client.h
@@ -2,14 +2,14 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#ifndef CHROME_BROWSER_POLICY_CLOUD_MOCK_CLOUD_POLICY_CLIENT_H_
-#define CHROME_BROWSER_POLICY_CLOUD_MOCK_CLOUD_POLICY_CLIENT_H_
+#ifndef COMPONENTS_POLICY_CORE_COMMON_CLOUD_MOCK_CLOUD_POLICY_CLIENT_H_
+#define COMPONENTS_POLICY_CORE_COMMON_CLOUD_MOCK_CLOUD_POLICY_CLIENT_H_
#include <string>
#include "base/basictypes.h"
-#include "chrome/browser/policy/cloud/cloud_policy_client.h"
-#include "chrome/browser/policy/cloud/cloud_policy_constants.h"
+#include "components/policy/core/common/cloud/cloud_policy_client.h"
+#include "components/policy/core/common/cloud/cloud_policy_constants.h"
#include "testing/gmock/include/gmock/gmock.h"
namespace policy {
@@ -74,4 +74,4 @@ class MockCloudPolicyClientObserver : public CloudPolicyClient::Observer {
} // namespace policy
-#endif // CHROME_BROWSER_POLICY_CLOUD_MOCK_CLOUD_POLICY_CLIENT_H_
+#endif // COMPONENTS_POLICY_CORE_COMMON_CLOUD_MOCK_CLOUD_POLICY_CLIENT_H_
diff --git a/chrome/browser/policy/cloud/mock_cloud_policy_store.cc b/components/policy/core/common/cloud/mock_cloud_policy_store.cc
index 8c2fb3b..f63393c 100644
--- a/chrome/browser/policy/cloud/mock_cloud_policy_store.cc
+++ b/components/policy/core/common/cloud/mock_cloud_policy_store.cc
@@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#include "chrome/browser/policy/cloud/mock_cloud_policy_store.h"
+#include "components/policy/core/common/cloud/mock_cloud_policy_store.h"
namespace policy {
diff --git a/chrome/browser/policy/cloud/mock_cloud_policy_store.h b/components/policy/core/common/cloud/mock_cloud_policy_store.h
index 684f37c..8479bef 100644
--- a/chrome/browser/policy/cloud/mock_cloud_policy_store.h
+++ b/components/policy/core/common/cloud/mock_cloud_policy_store.h
@@ -2,10 +2,10 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#ifndef CHROME_BROWSER_POLICY_CLOUD_MOCK_CLOUD_POLICY_STORE_H_
-#define CHROME_BROWSER_POLICY_CLOUD_MOCK_CLOUD_POLICY_STORE_H_
+#ifndef COMPONENTS_POLICY_CORE_COMMON_CLOUD_MOCK_CLOUD_POLICY_STORE_H_
+#define COMPONENTS_POLICY_CORE_COMMON_CLOUD_MOCK_CLOUD_POLICY_STORE_H_
-#include "chrome/browser/policy/cloud/cloud_policy_store.h"
+#include "components/policy/core/common/cloud/cloud_policy_store.h"
#include "testing/gmock/include/gmock/gmock.h"
namespace policy {
@@ -45,4 +45,4 @@ class MockCloudPolicyStoreObserver : public CloudPolicyStore::Observer {
} // namespace policy
-#endif // CHROME_BROWSER_POLICY_CLOUD_MOCK_CLOUD_POLICY_STORE_H_
+#endif // COMPONENTS_POLICY_CORE_COMMON_CLOUD_MOCK_CLOUD_POLICY_STORE_H_
diff --git a/chrome/browser/policy/cloud/mock_device_management_service.cc b/components/policy/core/common/cloud/mock_device_management_service.cc
index 6f51b3f..f79ee82 100644
--- a/chrome/browser/policy/cloud/mock_device_management_service.cc
+++ b/components/policy/core/common/cloud/mock_device_management_service.cc
@@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#include "chrome/browser/policy/cloud/mock_device_management_service.h"
+#include "components/policy/core/common/cloud/mock_device_management_service.h"
#include "base/strings/string_util.h"
#include "net/base/net_errors.h"
diff --git a/chrome/browser/policy/cloud/mock_device_management_service.h b/components/policy/core/common/cloud/mock_device_management_service.h
index c992c55f7..b53f728 100644
--- a/chrome/browser/policy/cloud/mock_device_management_service.h
+++ b/components/policy/core/common/cloud/mock_device_management_service.h
@@ -2,14 +2,14 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#ifndef CHROME_BROWSER_POLICY_CLOUD_MOCK_DEVICE_MANAGEMENT_SERVICE_H_
-#define CHROME_BROWSER_POLICY_CLOUD_MOCK_DEVICE_MANAGEMENT_SERVICE_H_
+#ifndef COMPONENTS_POLICY_CORE_COMMON_CLOUD_MOCK_DEVICE_MANAGEMENT_SERVICE_H_
+#define COMPONENTS_POLICY_CORE_COMMON_CLOUD_MOCK_DEVICE_MANAGEMENT_SERVICE_H_
#include <string>
#include "base/basictypes.h"
-#include "chrome/browser/policy/cloud/device_management_service.h"
#include "chrome/browser/policy/proto/cloud/device_management_backend.pb.h"
+#include "components/policy/core/common/cloud/device_management_service.h"
#include "testing/gmock/include/gmock/gmock.h"
namespace policy {
@@ -78,4 +78,4 @@ class MockDeviceManagementService : public DeviceManagementService {
} // namespace policy
-#endif // CHROME_BROWSER_POLICY_CLOUD_MOCK_DEVICE_MANAGEMENT_SERVICE_H_
+#endif // COMPONENTS_POLICY_CORE_COMMON_CLOUD_MOCK_DEVICE_MANAGEMENT_SERVICE_H_
diff --git a/chrome/browser/policy/cloud/policy_builder.cc b/components/policy/core/common/cloud/policy_builder.cc
index 28fad08..88ac828 100644
--- a/chrome/browser/policy/cloud/policy_builder.cc
+++ b/components/policy/core/common/cloud/policy_builder.cc
@@ -2,13 +2,13 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#include "chrome/browser/policy/cloud/policy_builder.h"
+#include "components/policy/core/common/cloud/policy_builder.h"
#include <vector>
#include "base/stl_util.h"
-#include "chrome/browser/policy/cloud/cloud_policy_constants.h"
#include "chrome/browser/policy/proto/cloud/chrome_extension_policy.pb.h"
+#include "components/policy/core/common/cloud/cloud_policy_constants.h"
#include "crypto/signature_creator.h"
#include "policy/proto/cloud_policy.pb.h"
diff --git a/chrome/browser/policy/cloud/policy_builder.h b/components/policy/core/common/cloud/policy_builder.h
index 5f3b530..625f8dd 100644
--- a/chrome/browser/policy/cloud/policy_builder.h
+++ b/components/policy/core/common/cloud/policy_builder.h
@@ -2,8 +2,8 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#ifndef CHROME_BROWSER_POLICY_CLOUD_POLICY_BUILDER_H_
-#define CHROME_BROWSER_POLICY_CLOUD_POLICY_BUILDER_H_
+#ifndef COMPONENTS_POLICY_CORE_COMMON_CLOUD_POLICY_BUILDER_H_
+#define COMPONENTS_POLICY_CORE_COMMON_CLOUD_POLICY_BUILDER_H_
#include <string>
@@ -137,4 +137,4 @@ typedef TypedPolicyBuilder<enterprise_management::ExternalPolicyData>
} // namespace policy
-#endif // CHROME_BROWSER_POLICY_CLOUD_POLICY_BUILDER_H_
+#endif // COMPONENTS_POLICY_CORE_COMMON_CLOUD_POLICY_BUILDER_H_
diff --git a/chrome/browser/policy/cloud/rate_limiter.cc b/components/policy/core/common/cloud/rate_limiter.cc
index b0992a6..010d7d2 100644
--- a/chrome/browser/policy/cloud/rate_limiter.cc
+++ b/components/policy/core/common/cloud/rate_limiter.cc
@@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#include "chrome/browser/policy/cloud/rate_limiter.h"
+#include "components/policy/core/common/cloud/rate_limiter.h"
#include "base/bind.h"
#include "base/bind_helpers.h"
diff --git a/chrome/browser/policy/cloud/rate_limiter.h b/components/policy/core/common/cloud/rate_limiter.h
index 00af48d..5949257 100644
--- a/chrome/browser/policy/cloud/rate_limiter.h
+++ b/components/policy/core/common/cloud/rate_limiter.h
@@ -2,8 +2,8 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#ifndef CHROME_BROWSER_POLICY_CLOUD_RATE_LIMITER_H_
-#define CHROME_BROWSER_POLICY_CLOUD_RATE_LIMITER_H_
+#ifndef COMPONENTS_POLICY_CORE_COMMON_CLOUD_RATE_LIMITER_H_
+#define COMPONENTS_POLICY_CORE_COMMON_CLOUD_RATE_LIMITER_H_
#include <queue>
@@ -14,6 +14,7 @@
#include "base/memory/scoped_ptr.h"
#include "base/threading/non_thread_safe.h"
#include "base/time/time.h"
+#include "components/policy/policy_export.h"
namespace base {
class SequencedTaskRunner;
@@ -23,7 +24,7 @@ class TickClock;
namespace policy {
// A simple class to limit the rate at which a callback is invoked.
-class RateLimiter : public base::NonThreadSafe {
+class POLICY_EXPORT RateLimiter : public base::NonThreadSafe {
public:
// Will limit invocations of |callback| to |max_requests| per |duration|.
// |task_runner| is used to post delayed tasks, and |clock| is used to
@@ -56,4 +57,4 @@ class RateLimiter : public base::NonThreadSafe {
} // namespace policy
-#endif // CHROME_BROWSER_POLICY_CLOUD_RATE_LIMITER_H_
+#endif // COMPONENTS_POLICY_CORE_COMMON_CLOUD_RATE_LIMITER_H_
diff --git a/chrome/browser/policy/cloud/rate_limiter_unittest.cc b/components/policy/core/common/cloud/rate_limiter_unittest.cc
index 18995aa..029ae81 100644
--- a/chrome/browser/policy/cloud/rate_limiter_unittest.cc
+++ b/components/policy/core/common/cloud/rate_limiter_unittest.cc
@@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#include "chrome/browser/policy/cloud/rate_limiter.h"
+#include "components/policy/core/common/cloud/rate_limiter.h"
#include "base/bind.h"
#include "base/bind_helpers.h"
diff --git a/chrome/browser/policy/cloud/resource_cache.cc b/components/policy/core/common/cloud/resource_cache.cc
index 0ee7e3a..e527679 100644
--- a/chrome/browser/policy/cloud/resource_cache.cc
+++ b/components/policy/core/common/cloud/resource_cache.cc
@@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#include "chrome/browser/policy/cloud/resource_cache.h"
+#include "components/policy/core/common/cloud/resource_cache.h"
#include "base/base64.h"
#include "base/callback.h"
diff --git a/chrome/browser/policy/cloud/resource_cache.h b/components/policy/core/common/cloud/resource_cache.h
index 1519a45..d6dbbab 100644
--- a/chrome/browser/policy/cloud/resource_cache.h
+++ b/components/policy/core/common/cloud/resource_cache.h
@@ -2,8 +2,8 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#ifndef CHROME_BROWSER_POLICY_CLOUD_RESOURCE_CACHE_H_
-#define CHROME_BROWSER_POLICY_CLOUD_RESOURCE_CACHE_H_
+#ifndef COMPONENTS_POLICY_CORE_COMMON_CLOUD_RESOURCE_CACHE_H_
+#define COMPONENTS_POLICY_CORE_COMMON_CLOUD_RESOURCE_CACHE_H_
#include <map>
#include <set>
@@ -13,6 +13,7 @@
#include "base/callback_forward.h"
#include "base/files/file_path.h"
#include "base/memory/ref_counted.h"
+#include "components/policy/policy_export.h"
namespace base {
class SequencedTaskRunner;
@@ -26,7 +27,7 @@ namespace policy {
// Purge*().
// The class can be instantiated on any thread but from then on, it must be
// accessed via the |task_runner| only. The |task_runner| must support file I/O.
-class ResourceCache {
+class POLICY_EXPORT ResourceCache {
public:
explicit ResourceCache(const base::FilePath& cache_path,
scoped_refptr<base::SequencedTaskRunner> task_runner);
@@ -93,4 +94,4 @@ class ResourceCache {
} // namespace policy
-#endif // CHROME_BROWSER_POLICY_CLOUD_RESOURCE_CACHE_H_
+#endif // COMPONENTS_POLICY_CORE_COMMON_CLOUD_RESOURCE_CACHE_H_
diff --git a/chrome/browser/policy/cloud/resource_cache_unittest.cc b/components/policy/core/common/cloud/resource_cache_unittest.cc
index afca625..3e5a5ee 100644
--- a/chrome/browser/policy/cloud/resource_cache_unittest.cc
+++ b/components/policy/core/common/cloud/resource_cache_unittest.cc
@@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#include "chrome/browser/policy/cloud/resource_cache.h"
+#include "components/policy/core/common/cloud/resource_cache.h"
#include "base/basictypes.h"
#include "base/bind.h"
diff --git a/chrome/browser/policy/cloud/system_policy_request_context.cc b/components/policy/core/common/cloud/system_policy_request_context.cc
index 7e8a442..ebbb876 100644
--- a/chrome/browser/policy/cloud/system_policy_request_context.cc
+++ b/components/policy/core/common/cloud/system_policy_request_context.cc
@@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#include "chrome/browser/policy/cloud/system_policy_request_context.h"
+#include "components/policy/core/common/cloud/system_policy_request_context.h"
#include "base/logging.h"
#include "base/single_thread_task_runner.h"
diff --git a/chrome/browser/policy/cloud/system_policy_request_context.h b/components/policy/core/common/cloud/system_policy_request_context.h
index 186f2b4..b421714 100644
--- a/chrome/browser/policy/cloud/system_policy_request_context.h
+++ b/components/policy/core/common/cloud/system_policy_request_context.h
@@ -3,11 +3,12 @@
// found in the LICENSE file.
#include "base/memory/scoped_ptr.h"
+#include "components/policy/policy_export.h"
#include "net/url_request/static_http_user_agent_settings.h"
#include "net/url_request/url_request_context_getter.h"
-#ifndef CHROME_BROWSER_POLICY_CLOUD_SYSTEM_POLICY_REQUEST_CONTEXT_H_
-#define CHROME_BROWSER_POLICY_CLOUD_SYSTEM_POLICY_REQUEST_CONTEXT_H_
+#ifndef COMPONENTS_POLICY_CORE_COMMON_CLOUD_SYSTEM_POLICY_REQUEST_CONTEXT_H_
+#define COMPONENTS_POLICY_CORE_COMMON_CLOUD_SYSTEM_POLICY_REQUEST_CONTEXT_H_
namespace net {
class HttpNetworkLayer;
@@ -15,7 +16,7 @@ class HttpNetworkLayer;
namespace policy {
-class SystemPolicyRequestContext
+class POLICY_EXPORT SystemPolicyRequestContext
: public net::URLRequestContextGetter {
public:
SystemPolicyRequestContext(
@@ -45,4 +46,4 @@ class SystemPolicyRequestContext
} // namespace policy
-#endif // CHROME_BROWSER_POLICY_CLOUD_SYSTEM_POLICY_REQUEST_CONTEXT_H_
+#endif // COMPONENTS_POLICY_CORE_COMMON_CLOUD_SYSTEM_POLICY_REQUEST_CONTEXT_H_
diff --git a/chrome/browser/policy/cloud/user_info_fetcher.cc b/components/policy/core/common/cloud/user_info_fetcher.cc
index 23088a5..b8f9f74d 100644
--- a/chrome/browser/policy/cloud/user_info_fetcher.cc
+++ b/components/policy/core/common/cloud/user_info_fetcher.cc
@@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#include "chrome/browser/policy/cloud/user_info_fetcher.h"
+#include "components/policy/core/common/cloud/user_info_fetcher.h"
#include "base/json/json_reader.h"
#include "base/logging.h"
diff --git a/chrome/browser/policy/cloud/user_info_fetcher.h b/components/policy/core/common/cloud/user_info_fetcher.h
index 1dab0ec..c248d81 100644
--- a/chrome/browser/policy/cloud/user_info_fetcher.h
+++ b/components/policy/core/common/cloud/user_info_fetcher.h
@@ -2,11 +2,12 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#ifndef CHROME_BROWSER_POLICY_CLOUD_USER_INFO_FETCHER_H_
-#define CHROME_BROWSER_POLICY_CLOUD_USER_INFO_FETCHER_H_
+#ifndef COMPONENTS_POLICY_CORE_COMMON_CLOUD_USER_INFO_FETCHER_H_
+#define COMPONENTS_POLICY_CORE_COMMON_CLOUD_USER_INFO_FETCHER_H_
#include <string>
#include "base/memory/scoped_ptr.h"
+#include "components/policy/policy_export.h"
#include "net/url_request/url_fetcher_delegate.h"
class GoogleServiceAuthError;
@@ -24,9 +25,9 @@ namespace policy {
// Class that makes a UserInfo request, parses the response, and notifies
// a provided Delegate when the request is complete.
-class UserInfoFetcher : public net::URLFetcherDelegate {
+class POLICY_EXPORT UserInfoFetcher : public net::URLFetcherDelegate {
public:
- class Delegate {
+ class POLICY_EXPORT Delegate {
public:
// Invoked when the UserInfo request has succeeded, passing the parsed
// response in |response|. Delegate may free the UserInfoFetcher in this
@@ -60,4 +61,4 @@ class UserInfoFetcher : public net::URLFetcherDelegate {
} // namespace policy
-#endif // CHROME_BROWSER_POLICY_CLOUD_USER_INFO_FETCHER_H_
+#endif // COMPONENTS_POLICY_CORE_COMMON_CLOUD_USER_INFO_FETCHER_H_
diff --git a/chrome/browser/policy/cloud/user_info_fetcher_unittest.cc b/components/policy/core/common/cloud/user_info_fetcher_unittest.cc
index e14422d..47a4121 100644
--- a/chrome/browser/policy/cloud/user_info_fetcher_unittest.cc
+++ b/components/policy/core/common/cloud/user_info_fetcher_unittest.cc
@@ -3,7 +3,7 @@
// found in the LICENSE file.
#include "base/values.h"
-#include "chrome/browser/policy/cloud/user_info_fetcher.h"
+#include "components/policy/core/common/cloud/user_info_fetcher.h"
#include "google_apis/gaia/google_service_auth_error.h"
#include "net/http/http_status_code.h"
#include "net/url_request/test_url_fetcher_factory.h"
diff --git a/chrome/browser/policy/cloud/user_policy_request_context.cc b/components/policy/core/common/cloud/user_policy_request_context.cc
index e12a2c1..09e20f1 100644
--- a/chrome/browser/policy/cloud/user_policy_request_context.cc
+++ b/components/policy/core/common/cloud/user_policy_request_context.cc
@@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#include "chrome/browser/policy/cloud/user_policy_request_context.h"
+#include "components/policy/core/common/cloud/user_policy_request_context.h"
#include "base/logging.h"
#include "base/single_thread_task_runner.h"
diff --git a/chrome/browser/policy/cloud/user_policy_request_context.h b/components/policy/core/common/cloud/user_policy_request_context.h
index 2643fd6..e1e1845 100644
--- a/chrome/browser/policy/cloud/user_policy_request_context.h
+++ b/components/policy/core/common/cloud/user_policy_request_context.h
@@ -3,11 +3,12 @@
// found in the LICENSE file.
#include "base/memory/scoped_ptr.h"
+#include "components/policy/policy_export.h"
#include "net/url_request/static_http_user_agent_settings.h"
#include "net/url_request/url_request_context_getter.h"
-#ifndef CHROME_BROWSER_POLICY_CLOUD_USER_POLICY_REQUEST_CONTEXT_H_
-#define CHROME_BROWSER_POLICY_CLOUD_USER_POLICY_REQUEST_CONTEXT_H_
+#ifndef COMPONENTS_POLICY_CORE_COMMON_CLOUD_USER_POLICY_REQUEST_CONTEXT_H_
+#define COMPONENTS_POLICY_CORE_COMMON_CLOUD_USER_POLICY_REQUEST_CONTEXT_H_
namespace net {
class HttpNetworkLayer;
@@ -15,7 +16,7 @@ class HttpNetworkLayer;
namespace policy {
-class UserPolicyRequestContext
+class POLICY_EXPORT UserPolicyRequestContext
: public net::URLRequestContextGetter {
public:
UserPolicyRequestContext(
@@ -47,4 +48,4 @@ class UserPolicyRequestContext
} // namespace policy
-#endif // CHROME_BROWSER_POLICY_CLOUD_USER_POLICY_REQUEST_CONTEXT_H_
+#endif // COMPONENTS_POLICY_CORE_COMMON_CLOUD_USER_POLICY_REQUEST_CONTEXT_H_
diff --git a/chrome/browser/policy/config_dir_policy_loader.cc b/components/policy/core/common/config_dir_policy_loader.cc
index b35064d..b8bd66a 100644
--- a/chrome/browser/policy/config_dir_policy_loader.cc
+++ b/components/policy/core/common/config_dir_policy_loader.cc
@@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#include "chrome/browser/policy/config_dir_policy_loader.h"
+#include "components/policy/core/common/config_dir_policy_loader.h"
#include <algorithm>
#include <set>
@@ -17,8 +17,8 @@
#include "base/logging.h"
#include "base/platform_file.h"
#include "base/stl_util.h"
-#include "chrome/browser/policy/policy_load_status.h"
#include "components/policy/core/common/policy_bundle.h"
+#include "components/policy/core/common/policy_load_status.h"
namespace policy {
diff --git a/chrome/browser/policy/config_dir_policy_loader.h b/components/policy/core/common/config_dir_policy_loader.h
index fc7cc5c3..054844b 100644
--- a/chrome/browser/policy/config_dir_policy_loader.h
+++ b/components/policy/core/common/config_dir_policy_loader.h
@@ -2,13 +2,14 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#ifndef CHROME_BROWSER_POLICY_CONFIG_DIR_POLICY_LOADER_H_
-#define CHROME_BROWSER_POLICY_CONFIG_DIR_POLICY_LOADER_H_
+#ifndef COMPONENTS_POLICY_CORE_COMMON_CONFIG_DIR_POLICY_LOADER_H_
+#define COMPONENTS_POLICY_CORE_COMMON_CONFIG_DIR_POLICY_LOADER_H_
#include "base/files/file_path.h"
#include "base/files/file_path_watcher.h"
#include "components/policy/core/common/async_policy_loader.h"
#include "components/policy/core/common/policy_types.h"
+#include "components/policy/policy_export.h"
namespace base {
class Value;
@@ -21,7 +22,7 @@ namespace policy {
// merged together and the result is returned in a PolicyBundle.
// The files are consulted in lexicographic file name order, so the
// last value read takes precedence in case of policy key collisions.
-class ConfigDirPolicyLoader : public AsyncPolicyLoader {
+class POLICY_EXPORT ConfigDirPolicyLoader : public AsyncPolicyLoader {
public:
ConfigDirPolicyLoader(scoped_refptr<base::SequencedTaskRunner> task_runner,
const base::FilePath& config_dir,
@@ -63,4 +64,4 @@ class ConfigDirPolicyLoader : public AsyncPolicyLoader {
} // namespace policy
-#endif // CHROME_BROWSER_POLICY_CONFIG_DIR_POLICY_LOADER_H_
+#endif // COMPONENTS_POLICY_CORE_COMMON_CONFIG_DIR_POLICY_LOADER_H_
diff --git a/chrome/browser/policy/config_dir_policy_loader_unittest.cc b/components/policy/core/common/config_dir_policy_loader_unittest.cc
index c2838cd..de74964 100644
--- a/chrome/browser/policy/config_dir_policy_loader_unittest.cc
+++ b/components/policy/core/common/config_dir_policy_loader_unittest.cc
@@ -12,8 +12,8 @@
#include "base/sequenced_task_runner.h"
#include "base/strings/string_number_conversions.h"
#include "base/values.h"
-#include "chrome/browser/policy/config_dir_policy_loader.h"
#include "components/policy/core/common/async_policy_provider.h"
+#include "components/policy/core/common/config_dir_policy_loader.h"
#include "components/policy/core/common/configuration_policy_provider_test.h"
#include "components/policy/core/common/policy_bundle.h"
#include "components/policy/core/common/policy_map.h"
diff --git a/chrome/browser/policy/mock_policy_service.cc b/components/policy/core/common/mock_policy_service.cc
index bc56c65..6e3e0c1 100644
--- a/chrome/browser/policy/mock_policy_service.cc
+++ b/components/policy/core/common/mock_policy_service.cc
@@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#include "chrome/browser/policy/mock_policy_service.h"
+#include "components/policy/core/common/mock_policy_service.h"
namespace policy {
diff --git a/chrome/browser/policy/mock_policy_service.h b/components/policy/core/common/mock_policy_service.h
index 3c609d4..584f093 100644
--- a/chrome/browser/policy/mock_policy_service.h
+++ b/components/policy/core/common/mock_policy_service.h
@@ -2,10 +2,10 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#ifndef CHROME_BROWSER_POLICY_MOCK_POLICY_SERVICE_H_
-#define CHROME_BROWSER_POLICY_MOCK_POLICY_SERVICE_H_
+#ifndef COMPONENTS_POLICY_CORE_COMMON_MOCK_POLICY_SERVICE_H_
+#define COMPONENTS_POLICY_CORE_COMMON_MOCK_POLICY_SERVICE_H_
-#include "chrome/browser/policy/policy_service.h"
+#include "components/policy/core/common/policy_service.h"
#include "testing/gmock/include/gmock/gmock.h"
namespace policy {
@@ -36,4 +36,4 @@ class MockPolicyService : public PolicyService {
} // namespace policy
-#endif // CHROME_BROWSER_POLICY_MOCK_POLICY_SERVICE_H_
+#endif // COMPONENTS_POLICY_CORE_COMMON_MOCK_POLICY_SERVICE_H_
diff --git a/chrome/browser/policy/policy_load_status.cc b/components/policy/core/common/policy_load_status.cc
index eb632fa..71c5059 100644
--- a/chrome/browser/policy/policy_load_status.cc
+++ b/components/policy/core/common/policy_load_status.cc
@@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#include "chrome/browser/policy/policy_load_status.h"
+#include "components/policy/core/common/policy_load_status.h"
#include "base/metrics/histogram.h"
#include "base/strings/stringprintf.h"
diff --git a/chrome/browser/policy/policy_load_status.h b/components/policy/core/common/policy_load_status.h
index 4f29de5..5f4d017 100644
--- a/chrome/browser/policy/policy_load_status.h
+++ b/components/policy/core/common/policy_load_status.h
@@ -2,12 +2,13 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#ifndef CHROME_BROWSER_POLICY_POLICY_LOAD_STATUS_H_
-#define CHROME_BROWSER_POLICY_POLICY_LOAD_STATUS_H_
+#ifndef COMPONENTS_POLICY_CORE_COMMON_POLICY_LOAD_STATUS_H_
+#define COMPONENTS_POLICY_CORE_COMMON_POLICY_LOAD_STATUS_H_
#include <bitset>
#include "base/basictypes.h"
+#include "components/policy/policy_export.h"
namespace base {
class HistogramBase;
@@ -46,7 +47,7 @@ enum PolicyLoadStatus {
// A helper for generating policy load status UMA statistics that'll collect
// histogram samples for a policy load operation and records histogram samples
// for the status codes that were seen on destruction.
-class PolicyLoadStatusSample {
+class POLICY_EXPORT PolicyLoadStatusSample {
public:
PolicyLoadStatusSample();
~PolicyLoadStatusSample();
@@ -63,4 +64,4 @@ class PolicyLoadStatusSample {
} // namespace policy
-#endif // CHROME_BROWSER_POLICY_POLICY_LOAD_STATUS_H_
+#endif // COMPONENTS_POLICY_CORE_COMMON_POLICY_LOAD_STATUS_H_
diff --git a/chrome/browser/policy/policy_loader_mac.cc b/components/policy/core/common/policy_loader_mac.cc
index 1ee42ee..6337898 100644
--- a/chrome/browser/policy/policy_loader_mac.cc
+++ b/components/policy/core/common/policy_loader_mac.cc
@@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#include "chrome/browser/policy/policy_loader_mac.h"
+#include "components/policy/core/common/policy_loader_mac.h"
#include "base/bind.h"
#include "base/bind_helpers.h"
@@ -15,9 +15,9 @@
#include "base/sequenced_task_runner.h"
#include "base/strings/sys_string_conversions.h"
#include "base/values.h"
-#include "chrome/browser/policy/policy_load_status.h"
#include "components/policy/core/common/external_data_fetcher.h"
#include "components/policy/core/common/policy_bundle.h"
+#include "components/policy/core/common/policy_load_status.h"
#include "components/policy/core/common/policy_map.h"
#include "components/policy/core/common/preferences_mac.h"
#include "components/policy/core/common/schema.h"
diff --git a/chrome/browser/policy/policy_loader_mac.h b/components/policy/core/common/policy_loader_mac.h
index 93063a0..3cd83f7 100644
--- a/chrome/browser/policy/policy_loader_mac.h
+++ b/components/policy/core/common/policy_loader_mac.h
@@ -2,8 +2,8 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#ifndef CHROME_BROWSER_POLICY_POLICY_LOADER_MAC_H_
-#define CHROME_BROWSER_POLICY_POLICY_LOADER_MAC_H_
+#ifndef COMPONENTS_POLICY_CORE_COMMON_POLICY_LOADER_MAC_H_
+#define COMPONENTS_POLICY_CORE_COMMON_POLICY_LOADER_MAC_H_
#include <string>
@@ -14,6 +14,7 @@
#include "base/memory/ref_counted.h"
#include "components/policy/core/common/async_policy_loader.h"
#include "components/policy/core/common/policy_namespace.h"
+#include "components/policy/policy_export.h"
class MacPreferences;
@@ -30,7 +31,7 @@ class Schema;
// A policy loader that loads policies from the Mac preferences system, and
// watches the managed preferences files for updates.
-class PolicyLoaderMac : public AsyncPolicyLoader {
+class POLICY_EXPORT PolicyLoaderMac : public AsyncPolicyLoader {
public:
PolicyLoaderMac(scoped_refptr<base::SequencedTaskRunner> task_runner,
const base::FilePath& managed_policy_path,
@@ -79,4 +80,4 @@ class PolicyLoaderMac : public AsyncPolicyLoader {
} // namespace policy
-#endif // CHROME_BROWSER_POLICY_POLICY_LOADER_MAC_H_
+#endif // COMPONENTS_POLICY_CORE_COMMON_POLICY_LOADER_MAC_H_
diff --git a/chrome/browser/policy/policy_loader_mac_unittest.cc b/components/policy/core/common/policy_loader_mac_unittest.cc
index 5445447..a37c8e6 100644
--- a/chrome/browser/policy/policy_loader_mac_unittest.cc
+++ b/components/policy/core/common/policy_loader_mac_unittest.cc
@@ -10,11 +10,11 @@
#include "base/mac/scoped_cftyperef.h"
#include "base/strings/sys_string_conversions.h"
#include "base/values.h"
-#include "chrome/browser/policy/policy_loader_mac.h"
#include "components/policy/core/common/async_policy_provider.h"
#include "components/policy/core/common/configuration_policy_provider_test.h"
#include "components/policy/core/common/external_data_fetcher.h"
#include "components/policy/core/common/policy_bundle.h"
+#include "components/policy/core/common/policy_loader_mac.h"
#include "components/policy/core/common/policy_map.h"
#include "components/policy/core/common/preferences_mock_mac.h"
#include "testing/gtest/include/gtest/gtest.h"
diff --git a/chrome/browser/policy/policy_loader_win.cc b/components/policy/core/common/policy_loader_win.cc
index 8d89206..799b2b2 100644
--- a/chrome/browser/policy/policy_loader_win.cc
+++ b/components/policy/core/common/policy_loader_win.cc
@@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#include "chrome/browser/policy/policy_loader_win.h"
+#include "components/policy/core/common/policy_loader_win.h"
#include <windows.h>
#include <rpc.h> // For struct GUID
@@ -27,12 +27,12 @@
#include "base/stl_util.h"
#include "base/strings/string16.h"
#include "base/strings/string_util.h"
-#include "chrome/browser/policy/policy_load_status.h"
-#include "chrome/browser/policy/preg_parser_win.h"
#include "components/json_schema/json_schema_constants.h"
#include "components/policy/core/common/policy_bundle.h"
+#include "components/policy/core/common/policy_load_status.h"
#include "components/policy/core/common/policy_map.h"
#include "components/policy/core/common/policy_namespace.h"
+#include "components/policy/core/common/preg_parser_win.h"
#include "components/policy/core/common/registry_dict_win.h"
#include "components/policy/core/common/schema.h"
diff --git a/chrome/browser/policy/policy_loader_win.h b/components/policy/core/common/policy_loader_win.h
index eb5387c..4e86b0c 100644
--- a/chrome/browser/policy/policy_loader_win.h
+++ b/components/policy/core/common/policy_loader_win.h
@@ -2,8 +2,8 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#ifndef CHROME_BROWSER_POLICY_POLICY_LOADER_WIN_H_
-#define CHROME_BROWSER_POLICY_POLICY_LOADER_WIN_H_
+#ifndef COMPONENTS_POLICY_CORE_COMMON_POLICY_LOADER_WIN_H_
+#define COMPONENTS_POLICY_CORE_COMMON_POLICY_LOADER_WIN_H_
#include <windows.h>
#include <userenv.h>
@@ -18,6 +18,7 @@
#include "base/win/object_watcher.h"
#include "components/policy/core/common/async_policy_loader.h"
#include "components/policy/core/common/policy_types.h"
+#include "components/policy/policy_export.h"
namespace base {
class SequencedTaskRunner;
@@ -31,7 +32,7 @@ class PolicyMap;
class RegistryDict;
// Interface for mocking out GPO enumeration in tests.
-class AppliedGPOListProvider {
+class POLICY_EXPORT AppliedGPOListProvider {
public:
virtual ~AppliedGPOListProvider() {}
virtual DWORD GetAppliedGPOList(DWORD flags,
@@ -44,8 +45,9 @@ class AppliedGPOListProvider {
// Loads policies from the Windows registry, and watches for Group Policy
// notifications to trigger reloads.
-class PolicyLoaderWin : public AsyncPolicyLoader,
- public base::win::ObjectWatcher::Delegate {
+class POLICY_EXPORT PolicyLoaderWin
+ : public AsyncPolicyLoader,
+ public base::win::ObjectWatcher::Delegate {
public:
// The PReg file name used by GPO.
static const base::FilePath::CharType kPRegFileName[];
@@ -125,4 +127,4 @@ class PolicyLoaderWin : public AsyncPolicyLoader,
} // namespace policy
-#endif // CHROME_BROWSER_POLICY_POLICY_LOADER_WIN_H_
+#endif // COMPONENTS_POLICY_CORE_COMMON_POLICY_LOADER_WIN_H_
diff --git a/chrome/browser/policy/policy_loader_win_unittest.cc b/components/policy/core/common/policy_loader_win_unittest.cc
index 12ee9f6..8bd8000 100644
--- a/chrome/browser/policy/policy_loader_win_unittest.cc
+++ b/components/policy/core/common/policy_loader_win_unittest.cc
@@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#include "chrome/browser/policy/policy_loader_win.h"
+#include "components/policy/core/common/policy_loader_win.h"
#include <windows.h>
#include <userenv.h>
@@ -28,13 +28,13 @@
#include "base/strings/utf_string_conversions.h"
#include "base/sys_byteorder.h"
#include "base/win/registry.h"
-#include "chrome/browser/policy/preg_parser_win.h"
#include "components/json_schema/json_schema_constants.h"
#include "components/policy/core/common/async_policy_provider.h"
#include "components/policy/core/common/configuration_policy_provider_test.h"
#include "components/policy/core/common/external_data_fetcher.h"
#include "components/policy/core/common/policy_bundle.h"
#include "components/policy/core/common/policy_map.h"
+#include "components/policy/core/common/preg_parser_win.h"
#include "components/policy/core/common/schema_map.h"
#include "testing/gtest/include/gtest/gtest.h"
diff --git a/chrome/browser/policy/policy_service.cc b/components/policy/core/common/policy_service.cc
index cd07867..fe4bb303 100644
--- a/chrome/browser/policy/policy_service.cc
+++ b/components/policy/core/common/policy_service.cc
@@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#include "chrome/browser/policy/policy_service.h"
+#include "components/policy/core/common/policy_service.h"
#include "base/values.h"
diff --git a/chrome/browser/policy/policy_service.h b/components/policy/core/common/policy_service.h
index 259f70a..4293e5c 100644
--- a/chrome/browser/policy/policy_service.h
+++ b/components/policy/core/common/policy_service.h
@@ -2,8 +2,8 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#ifndef CHROME_BROWSER_POLICY_POLICY_SERVICE_H_
-#define CHROME_BROWSER_POLICY_POLICY_SERVICE_H_
+#ifndef COMPONENTS_POLICY_CORE_COMMON_POLICY_SERVICE_H_
+#define COMPONENTS_POLICY_CORE_COMMON_POLICY_SERVICE_H_
#include <map>
#include <string>
@@ -12,6 +12,7 @@
#include "base/callback.h"
#include "components/policy/core/common/policy_map.h"
#include "components/policy/core/common/policy_namespace.h"
+#include "components/policy/policy_export.h"
namespace policy {
@@ -22,9 +23,9 @@ namespace policy {
// The PolicyService is available from BrowserProcess as a global singleton.
// There is also a PolicyService for browser-wide policies available from
// BrowserProcess as a global singleton.
-class PolicyService {
+class POLICY_EXPORT PolicyService {
public:
- class Observer {
+ class POLICY_EXPORT Observer {
public:
// Invoked whenever policies for the given |ns| namespace are modified.
// This is only invoked for changes that happen after AddObserver is called.
@@ -75,7 +76,7 @@ class PolicyService {
// A registrar that only observes changes to particular policies within the
// PolicyMap for the given policy namespace.
-class PolicyChangeRegistrar : public PolicyService::Observer {
+class POLICY_EXPORT PolicyChangeRegistrar : public PolicyService::Observer {
public:
typedef base::Callback<void(const Value*, const Value*)> UpdateCallback;
@@ -111,4 +112,4 @@ class PolicyChangeRegistrar : public PolicyService::Observer {
} // namespace policy
-#endif // CHROME_BROWSER_POLICY_POLICY_SERVICE_H_
+#endif // COMPONENTS_POLICY_CORE_COMMON_POLICY_SERVICE_H_
diff --git a/chrome/browser/policy/policy_service_impl.cc b/components/policy/core/common/policy_service_impl.cc
index 6515cf9..8fdd265 100644
--- a/chrome/browser/policy/policy_service_impl.cc
+++ b/components/policy/core/common/policy_service_impl.cc
@@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#include "chrome/browser/policy/policy_service_impl.h"
+#include "components/policy/core/common/policy_service_impl.h"
#include <algorithm>
diff --git a/chrome/browser/policy/policy_service_impl.h b/components/policy/core/common/policy_service_impl.h
index 1628df5..a10e881 100644
--- a/chrome/browser/policy/policy_service_impl.h
+++ b/components/policy/core/common/policy_service_impl.h
@@ -2,8 +2,8 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#ifndef CHROME_BROWSER_POLICY_POLICY_SERVICE_IMPL_H_
-#define CHROME_BROWSER_POLICY_POLICY_SERVICE_IMPL_H_
+#ifndef COMPONENTS_POLICY_CORE_COMMON_POLICY_SERVICE_IMPL_H_
+#define COMPONENTS_POLICY_CORE_COMMON_POLICY_SERVICE_IMPL_H_
#include <map>
#include <set>
@@ -14,16 +14,18 @@
#include "base/callback.h"
#include "base/memory/weak_ptr.h"
#include "base/observer_list.h"
-#include "chrome/browser/policy/policy_service.h"
#include "components/policy/core/common/configuration_policy_provider.h"
#include "components/policy/core/common/policy_bundle.h"
+#include "components/policy/core/common/policy_service.h"
+#include "components/policy/policy_export.h"
namespace policy {
class PolicyMap;
-class PolicyServiceImpl : public PolicyService,
- public ConfigurationPolicyProvider::Observer {
+class POLICY_EXPORT PolicyServiceImpl
+ : public PolicyService,
+ public ConfigurationPolicyProvider::Observer {
public:
typedef std::vector<ConfigurationPolicyProvider*> Providers;
typedef base::Callback<void(PolicyBundle*)> PreprocessCallback;
@@ -104,4 +106,4 @@ class PolicyServiceImpl : public PolicyService,
} // namespace policy
-#endif // CHROME_BROWSER_POLICY_POLICY_SERVICE_IMPL_H_
+#endif // COMPONENTS_POLICY_CORE_COMMON_POLICY_SERVICE_IMPL_H_
diff --git a/chrome/browser/policy/policy_service_impl_unittest.cc b/components/policy/core/common/policy_service_impl_unittest.cc
index 8bf2b8b..e95a1fb 100644
--- a/chrome/browser/policy/policy_service_impl_unittest.cc
+++ b/components/policy/core/common/policy_service_impl_unittest.cc
@@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#include "chrome/browser/policy/policy_service_impl.h"
+#include "components/policy/core/common/policy_service_impl.h"
#include "base/bind.h"
#include "base/bind_helpers.h"
@@ -10,9 +10,9 @@
#include "base/memory/scoped_ptr.h"
#include "base/run_loop.h"
#include "base/values.h"
-#include "chrome/browser/policy/mock_policy_service.h"
#include "components/policy/core/common/external_data_fetcher.h"
#include "components/policy/core/common/mock_configuration_policy_provider.h"
+#include "components/policy/core/common/mock_policy_service.h"
#include "testing/gmock/include/gmock/gmock.h"
#include "testing/gtest/include/gtest/gtest.h"
diff --git a/chrome/browser/policy/policy_service_stub.cc b/components/policy/core/common/policy_service_stub.cc
index c25b50f..1f9682b 100644
--- a/chrome/browser/policy/policy_service_stub.cc
+++ b/components/policy/core/common/policy_service_stub.cc
@@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#include "chrome/browser/policy/policy_service_stub.h"
+#include "components/policy/core/common/policy_service_stub.h"
#include "base/message_loop/message_loop.h"
diff --git a/chrome/browser/policy/policy_service_stub.h b/components/policy/core/common/policy_service_stub.h
index 30c2f51..f7dee23 100644
--- a/chrome/browser/policy/policy_service_stub.h
+++ b/components/policy/core/common/policy_service_stub.h
@@ -2,18 +2,19 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#ifndef CHROME_BROWSER_POLICY_POLICY_SERVICE_STUB_H_
-#define CHROME_BROWSER_POLICY_POLICY_SERVICE_STUB_H_
+#ifndef COMPONENTS_POLICY_CORE_COMMON_POLICY_SERVICE_STUB_H_
+#define COMPONENTS_POLICY_CORE_COMMON_POLICY_SERVICE_STUB_H_
#include "base/basictypes.h"
-#include "chrome/browser/policy/policy_service.h"
#include "components/policy/core/common/policy_map.h"
+#include "components/policy/core/common/policy_service.h"
+#include "components/policy/policy_export.h"
namespace policy {
// A stub implementation, that is used when ENABLE_CONFIGURATION_POLICY is not
// set. This allows client code to compile without requiring #ifdefs.
-class PolicyServiceStub : public PolicyService {
+class POLICY_EXPORT PolicyServiceStub : public PolicyService {
public:
PolicyServiceStub();
virtual ~PolicyServiceStub();
@@ -38,4 +39,4 @@ class PolicyServiceStub : public PolicyService {
} // namespace policy
-#endif // CHROME_BROWSER_POLICY_POLICY_SERVICE_STUB_H_
+#endif // COMPONENTS_POLICY_CORE_COMMON_POLICY_SERVICE_STUB_H_
diff --git a/chrome/browser/policy/policy_statistics_collector.cc b/components/policy/core/common/policy_statistics_collector.cc
index 51fe04c..3e6a588 100644
--- a/chrome/browser/policy/policy_statistics_collector.cc
+++ b/components/policy/core/common/policy_statistics_collector.cc
@@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#include "chrome/browser/policy/policy_statistics_collector.h"
+#include "components/policy/core/common/policy_statistics_collector.h"
#include <algorithm>
#include <string>
@@ -15,8 +15,8 @@
#include "base/prefs/pref_registry_simple.h"
#include "base/prefs/pref_service.h"
#include "base/task_runner.h"
-#include "chrome/browser/policy/policy_service.h"
#include "components/policy/core/common/policy_pref_names.h"
+#include "components/policy/core/common/policy_service.h"
namespace policy {
diff --git a/chrome/browser/policy/policy_statistics_collector.h b/components/policy/core/common/policy_statistics_collector.h
index e0444cc..f062ea3 100644
--- a/chrome/browser/policy/policy_statistics_collector.h
+++ b/components/policy/core/common/policy_statistics_collector.h
@@ -2,8 +2,8 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#ifndef CHROME_BROWSER_POLICY_POLICY_STATISTICS_COLLECTOR_H_
-#define CHROME_BROWSER_POLICY_POLICY_STATISTICS_COLLECTOR_H_
+#ifndef COMPONENTS_POLICY_CORE_COMMON_POLICY_STATISTICS_COLLECTOR_H_
+#define COMPONENTS_POLICY_CORE_COMMON_POLICY_STATISTICS_COLLECTOR_H_
#include "base/basictypes.h"
#include "base/cancelable_callback.h"
@@ -11,6 +11,7 @@
#include "base/time/time.h"
#include "components/policy/core/common/policy_details.h"
#include "components/policy/core/common/schema.h"
+#include "components/policy/policy_export.h"
class PrefService;
class PrefRegistrySimple;
@@ -24,7 +25,7 @@ namespace policy {
class PolicyService;
// Manages regular updates of policy usage UMA histograms.
-class PolicyStatisticsCollector {
+class POLICY_EXPORT PolicyStatisticsCollector {
public:
// Policy usage statistics update rate, in milliseconds.
static const int kStatisticsUpdateRate;
@@ -65,4 +66,4 @@ class PolicyStatisticsCollector {
} // namespace policy
-#endif // CHROME_BROWSER_POLICY_POLICY_STATISTICS_COLLECTOR_H_
+#endif // COMPONENTS_POLICY_CORE_COMMON_POLICY_STATISTICS_COLLECTOR_H_
diff --git a/chrome/browser/policy/policy_statistics_collector_unittest.cc b/components/policy/core/common/policy_statistics_collector_unittest.cc
index dbffb06..3c1a0ca 100644
--- a/chrome/browser/policy/policy_statistics_collector_unittest.cc
+++ b/components/policy/core/common/policy_statistics_collector_unittest.cc
@@ -12,12 +12,12 @@
#include "base/prefs/testing_pref_service.h"
#include "base/test/test_simple_task_runner.h"
#include "base/values.h"
-#include "chrome/browser/policy/mock_policy_service.h"
-#include "chrome/browser/policy/policy_statistics_collector.h"
-#include "chrome/browser/policy/test/policy_test_utils.h"
#include "components/policy/core/common/external_data_fetcher.h"
+#include "components/policy/core/common/mock_policy_service.h"
#include "components/policy/core/common/policy_map.h"
#include "components/policy/core/common/policy_pref_names.h"
+#include "components/policy/core/common/policy_statistics_collector.h"
+#include "components/policy/core/common/policy_test_utils.h"
#include "components/policy/core/common/policy_types.h"
#include "testing/gmock/include/gmock/gmock.h"
#include "testing/gtest/include/gtest/gtest.h"
diff --git a/chrome/browser/policy/test/policy_test_utils.cc b/components/policy/core/common/policy_test_utils.cc
index 2915abd..b80867a 100644
--- a/chrome/browser/policy/test/policy_test_utils.cc
+++ b/components/policy/core/common/policy_test_utils.cc
@@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#include "chrome/browser/policy/test/policy_test_utils.h"
+#include "components/policy/core/common/policy_test_utils.h"
#include <string>
diff --git a/chrome/browser/policy/test/policy_test_utils.h b/components/policy/core/common/policy_test_utils.h
index 4ea452e..e2c0c73 100644
--- a/chrome/browser/policy/test/policy_test_utils.h
+++ b/components/policy/core/common/policy_test_utils.h
@@ -2,18 +2,18 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#ifndef CHROME_BROWSER_POLICY_TEST_POLICY_TEST_UTILS_H_
-#define CHROME_BROWSER_POLICY_TEST_POLICY_TEST_UTILS_H_
+#ifndef COMPONENTS_POLICY_CORE_COMMON_POLICY_TEST_UTILS_H_
+#define COMPONENTS_POLICY_CORE_COMMON_POLICY_TEST_UTILS_H_
#include <map>
#include <ostream>
#include <string>
#include "base/basictypes.h"
-#include "chrome/browser/policy/policy_service.h"
+#include "components/policy/core/common/policy_details.h"
#include "components/policy/core/common/policy_map.h"
+#include "components/policy/core/common/policy_service.h"
#include "components/policy/core/common/policy_types.h"
-#include "policy/policy_constants.h"
namespace policy {
@@ -57,4 +57,4 @@ std::ostream& operator<<(std::ostream& os, const policy::PolicyMap& policies);
std::ostream& operator<<(std::ostream& os, const policy::PolicyMap::Entry& e);
std::ostream& operator<<(std::ostream& os, const policy::PolicyNamespace& ns);
-#endif // CHROME_BROWSER_POLICY_TEST_POLICY_TEST_UTILS_H_
+#endif // COMPONENTS_POLICY_CORE_COMMON_POLICY_TEST_UTILS_H_
diff --git a/chrome/browser/policy/preg_parser_win.cc b/components/policy/core/common/preg_parser_win.cc
index a30714a..abd629e 100644
--- a/chrome/browser/policy/preg_parser_win.cc
+++ b/components/policy/core/common/preg_parser_win.cc
@@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#include "chrome/browser/policy/preg_parser_win.h"
+#include "components/policy/core/common/preg_parser_win.h"
#include <windows.h>
@@ -20,7 +20,7 @@
#include "base/strings/utf_string_conversions.h"
#include "base/sys_byteorder.h"
#include "base/values.h"
-#include "chrome/browser/policy/policy_load_status.h"
+#include "components/policy/core/common/policy_load_status.h"
#include "components/policy/core/common/registry_dict_win.h"
namespace policy {
diff --git a/chrome/browser/policy/preg_parser_win.h b/components/policy/core/common/preg_parser_win.h
index dbd54c7..e01657b 100644
--- a/chrome/browser/policy/preg_parser_win.h
+++ b/components/policy/core/common/preg_parser_win.h
@@ -7,13 +7,14 @@
//
// http://msdn.microsoft.com/en-us/library/windows/desktop/aa374407(v=vs.85).aspx
-#ifndef CHROME_BROWSER_POLICY_PREG_PARSER_WIN_H_
-#define CHROME_BROWSER_POLICY_PREG_PARSER_WIN_H_
+#ifndef COMPONENTS_POLICY_CORE_COMMON_PREG_PARSER_WIN_H_
+#define COMPONENTS_POLICY_CORE_COMMON_PREG_PARSER_WIN_H_
#include <vector>
#include "base/memory/scoped_ptr.h"
#include "base/strings/string16.h"
+#include "components/policy/policy_export.h"
namespace base {
class FilePath;
@@ -27,17 +28,17 @@ class RegistryDict;
namespace preg_parser {
// The magic header in PReg files: ASCII "PReg" + version (0x0001).
-extern const char kPRegFileHeader[8];
+POLICY_EXPORT extern const char kPRegFileHeader[8];
// Reads the PReg file at |file_path| and writes the registry data to |dict|.
// |root| specifies the registry subtree the caller is interested in,
// everything else gets ignored.
-bool ReadFile(const base::FilePath& file_path,
- const string16& root,
- RegistryDict* dict,
- PolicyLoadStatusSample* status);
+POLICY_EXPORT bool ReadFile(const base::FilePath& file_path,
+ const string16& root,
+ RegistryDict* dict,
+ PolicyLoadStatusSample* status);
} // namespace preg_parser
} // namespace policy
-#endif // CHROME_BROWSER_POLICY_PREG_PARSER_WIN_H_
+#endif // COMPONENTS_POLICY_CORE_COMMON_PREG_PARSER_WIN_H_
diff --git a/chrome/browser/policy/preg_parser_win_unittest.cc b/components/policy/core/common/preg_parser_win_unittest.cc
index ede4e97..d6b71b6 100644
--- a/chrome/browser/policy/preg_parser_win_unittest.cc
+++ b/components/policy/core/common/preg_parser_win_unittest.cc
@@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#include "chrome/browser/policy/preg_parser_win.h"
+#include "components/policy/core/common/preg_parser_win.h"
#include "base/base_paths.h"
#include "base/files/file_path.h"
@@ -10,7 +10,7 @@
#include "base/logging.h"
#include "base/path_service.h"
#include "base/values.h"
-#include "chrome/browser/policy/policy_load_status.h"
+#include "components/policy/core/common/policy_load_status.h"
#include "components/policy/core/common/registry_dict_win.h"
#include "testing/gtest/include/gtest/gtest.h"
diff --git a/components/policy/core/common/schema_registry.h b/components/policy/core/common/schema_registry.h
index 5f56589..b9f7fa8 100644
--- a/components/policy/core/common/schema_registry.h
+++ b/components/policy/core/common/schema_registry.h
@@ -15,6 +15,7 @@
#include "components/policy/core/common/policy_namespace.h"
#include "components/policy/core/common/schema.h"
#include "components/policy/core/common/schema_map.h"
+#include "components/policy/policy_export.h"
namespace policy {