summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--chrome/browser/policy/cloud/policy_header_service_factory.cc2
-rw-r--r--chrome/browser/profiles/profile_io_data.cc4
-rw-r--r--chrome/browser/renderer_host/chrome_resource_dispatcher_host_delegate.cc2
-rw-r--r--chrome/chrome_browser.gypi2
-rw-r--r--chrome/chrome_tests_unit.gypi1
-rw-r--r--components/components_tests.gyp3
-rw-r--r--components/policy.gypi6
-rw-r--r--components/policy/core/common/cloud/policy_header_io_helper.cc (renamed from components/policy/core/browser/policy_header_io_helper.cc)2
-rw-r--r--components/policy/core/common/cloud/policy_header_io_helper.h (renamed from components/policy/core/browser/policy_header_io_helper.h)6
-rw-r--r--components/policy/core/common/cloud/policy_header_io_helper_unittest.cc (renamed from components/policy/core/browser/policy_header_io_helper_unittest.cc)5
-rw-r--r--components/policy/core/common/cloud/policy_header_service.cc (renamed from chrome/browser/policy/cloud/policy_header_service.cc)4
-rw-r--r--components/policy/core/common/cloud/policy_header_service.h (renamed from chrome/browser/policy/cloud/policy_header_service.h)9
-rw-r--r--components/policy/core/common/cloud/policy_header_service_unittest.cc (renamed from chrome/browser/policy/cloud/policy_header_service_unittest.cc)4
13 files changed, 26 insertions, 24 deletions
diff --git a/chrome/browser/policy/cloud/policy_header_service_factory.cc b/chrome/browser/policy/cloud/policy_header_service_factory.cc
index 83f94d9..98d2ffc 100644
--- a/chrome/browser/policy/cloud/policy_header_service_factory.cc
+++ b/chrome/browser/policy/cloud/policy_header_service_factory.cc
@@ -7,11 +7,11 @@
#include "base/memory/scoped_ptr.h"
#include "chrome/browser/browser_process.h"
#include "chrome/browser/policy/browser_policy_connector.h"
-#include "chrome/browser/policy/cloud/policy_header_service.h"
#include "chrome/browser/profiles/profile.h"
#include "components/browser_context_keyed_service/browser_context_dependency_manager.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/policy_header_service.h"
#if defined(OS_CHROMEOS)
#include "chrome/browser/chromeos/policy/device_cloud_policy_manager_chromeos.h"
diff --git a/chrome/browser/profiles/profile_io_data.cc b/chrome/browser/profiles/profile_io_data.cc
index ce23822..1c5c53b 100644
--- a/chrome/browser/profiles/profile_io_data.cc
+++ b/chrome/browser/profiles/profile_io_data.cc
@@ -81,10 +81,10 @@
#include "net/url_request/url_request_job_factory_impl.h"
#if defined(ENABLE_CONFIGURATION_POLICY)
-#include "chrome/browser/policy/cloud/policy_header_service.h"
#include "chrome/browser/policy/cloud/policy_header_service_factory.h"
#include "chrome/browser/policy/cloud/user_cloud_policy_manager_factory.h"
-#include "components/policy/core/browser/policy_header_io_helper.h"
+#include "components/policy/core/common/cloud/policy_header_io_helper.h"
+#include "components/policy/core/common/cloud/policy_header_service.h"
#include "components/policy/core/common/cloud/user_cloud_policy_manager.h"
#endif
diff --git a/chrome/browser/renderer_host/chrome_resource_dispatcher_host_delegate.cc b/chrome/browser/renderer_host/chrome_resource_dispatcher_host_delegate.cc
index 18e9568..9dd6550 100644
--- a/chrome/browser/renderer_host/chrome_resource_dispatcher_host_delegate.cc
+++ b/chrome/browser/renderer_host/chrome_resource_dispatcher_host_delegate.cc
@@ -59,7 +59,7 @@
#include "net/url_request/url_request.h"
#if defined(ENABLE_CONFIGURATION_POLICY)
-#include "components/policy/core/browser/policy_header_io_helper.h"
+#include "components/policy/core/common/cloud/policy_header_io_helper.h"
#endif
#if defined(ENABLE_MANAGED_USERS)
diff --git a/chrome/chrome_browser.gypi b/chrome/chrome_browser.gypi
index c60fd2c..89984af 100644
--- a/chrome/chrome_browser.gypi
+++ b/chrome/chrome_browser.gypi
@@ -1465,8 +1465,6 @@
'browser/policy/browser_policy_connector.h',
'browser/policy/cloud/cloud_policy_invalidator.cc',
'browser/policy/cloud/cloud_policy_invalidator.h',
- 'browser/policy/cloud/policy_header_service.h',
- 'browser/policy/cloud/policy_header_service.cc',
'browser/policy/cloud/policy_header_service_factory.h',
'browser/policy/cloud/policy_header_service_factory.cc',
'browser/policy/cloud/user_cloud_policy_invalidator_factory.cc',
diff --git a/chrome/chrome_tests_unit.gypi b/chrome/chrome_tests_unit.gypi
index cc30a5c..d07dba3 100644
--- a/chrome/chrome_tests_unit.gypi
+++ b/chrome/chrome_tests_unit.gypi
@@ -1089,7 +1089,6 @@
'browser/policy/autofill_policy_handler_unittest.cc',
'browser/policy/browser_policy_connector_unittest.cc',
'browser/policy/cloud/cloud_policy_invalidator_unittest.cc',
- 'browser/policy/cloud/policy_header_service_unittest.cc',
'browser/policy/cloud/user_policy_signin_service_unittest.cc',
'browser/policy/configuration_policy_handler_unittest.cc',
'browser/policy/configuration_policy_pref_store_test.cc',
diff --git a/components/components_tests.gyp b/components/components_tests.gyp
index 2229538..294970f 100644
--- a/components/components_tests.gyp
+++ b/components/components_tests.gyp
@@ -197,7 +197,6 @@
'components.gyp:policy_component_test_support',
],
'sources': [
- 'policy/core/browser/policy_header_io_helper_unittest.cc',
'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',
@@ -211,6 +210,8 @@
'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/policy_header_io_helper_unittest.cc',
+ 'policy/core/common/cloud/policy_header_service_unittest.cc',
'policy/core/common/cloud/rate_limiter_unittest.cc',
'policy/core/common/cloud/resource_cache_unittest.cc',
'policy/core/common/cloud/user_cloud_policy_manager_unittest.cc',
diff --git a/components/policy.gypi b/components/policy.gypi
index a69a1f1..4e05b54 100644
--- a/components/policy.gypi
+++ b/components/policy.gypi
@@ -41,8 +41,6 @@
'policy/core/browser/configuration_policy_pref_store.h',
'policy/core/browser/policy_error_map.cc',
'policy/core/browser/policy_error_map.h',
- 'policy/core/browser/policy_header_io_helper.cc',
- 'policy/core/browser/policy_header_io_helper.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',
@@ -77,6 +75,10 @@
'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/policy_header_io_helper.cc',
+ 'policy/core/common/cloud/policy_header_io_helper.h',
+ 'policy/core/common/cloud/policy_header_service.cc',
+ 'policy/core/common/cloud/policy_header_service.h',
'policy/core/common/cloud/rate_limiter.cc',
'policy/core/common/cloud/rate_limiter.h',
'policy/core/common/cloud/resource_cache.cc',
diff --git a/components/policy/core/browser/policy_header_io_helper.cc b/components/policy/core/common/cloud/policy_header_io_helper.cc
index 1eb1898..a749dda 100644
--- a/components/policy/core/browser/policy_header_io_helper.cc
+++ b/components/policy/core/common/cloud/policy_header_io_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 "components/policy/core/browser/policy_header_io_helper.h"
+#include "components/policy/core/common/cloud/policy_header_io_helper.h"
#include "base/bind.h"
#include "base/location.h"
diff --git a/components/policy/core/browser/policy_header_io_helper.h b/components/policy/core/common/cloud/policy_header_io_helper.h
index 345b9cc..01a0765 100644
--- a/components/policy/core/browser/policy_header_io_helper.h
+++ b/components/policy/core/common/cloud/policy_header_io_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 COMPONENTS_POLICY_CORE_BROWSER_POLICY_HEADER_IO_HELPER_H_
-#define COMPONENTS_POLICY_CORE_BROWSER_POLICY_HEADER_IO_HELPER_H_
+#ifndef COMPONENTS_POLICY_CORE_COMMON_CLOUD_POLICY_HEADER_IO_HELPER_H_
+#define COMPONENTS_POLICY_CORE_COMMON_CLOUD_POLICY_HEADER_IO_HELPER_H_
#include <string>
@@ -59,4 +59,4 @@ class POLICY_EXPORT PolicyHeaderIOHelper {
} // namespace policy
-#endif // COMPONENTS_POLICY_CORE_BROWSER_POLICY_HEADER_IO_HELPER_H_
+#endif // COMPONENTS_POLICY_CORE_COMMON_CLOUD_POLICY_HEADER_IO_HELPER_H_
diff --git a/components/policy/core/browser/policy_header_io_helper_unittest.cc b/components/policy/core/common/cloud/policy_header_io_helper_unittest.cc
index 054168d..b86b260 100644
--- a/components/policy/core/browser/policy_header_io_helper_unittest.cc
+++ b/components/policy/core/common/cloud/policy_header_io_helper_unittest.cc
@@ -3,7 +3,7 @@
// found in the LICENSE file.
#include "base/test/test_simple_task_runner.h"
-#include "components/policy/core/browser/policy_header_io_helper.h"
+#include "components/policy/core/common/cloud/policy_header_io_helper.h"
#include "net/http/http_request_headers.h"
#include "net/url_request/url_request_test_util.h"
#include "testing/gtest/include/gtest/gtest.h"
@@ -14,7 +14,6 @@ namespace {
const char kDMServerURL[] = "http://server_url";
const char kPolicyHeaderName[] = "Chrome-Policy-Posture";
const char kInitialPolicyHeader[] = "initial_header";
-} // namespace
class PolicyHeaderIOHelperTest : public testing::Test {
public:
@@ -47,6 +46,8 @@ class PolicyHeaderIOHelperTest : public testing::Test {
scoped_refptr<base::TestSimpleTaskRunner> task_runner_;
};
+} // namespace
+
TEST_F(PolicyHeaderIOHelperTest, InitialHeader) {
net::TestURLRequest request(
GURL(kDMServerURL), net::DEFAULT_PRIORITY, NULL, &context_);
diff --git a/chrome/browser/policy/cloud/policy_header_service.cc b/components/policy/core/common/cloud/policy_header_service.cc
index 92c50d0..af261f8 100644
--- a/chrome/browser/policy/cloud/policy_header_service.cc
+++ b/components/policy/core/common/cloud/policy_header_service.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/policy_header_service.h"
+#include "components/policy/core/common/cloud/policy_header_service.h"
-#include "components/policy/core/browser/policy_header_io_helper.h"
#include "components/policy/core/common/cloud/cloud_policy_store.h"
+#include "components/policy/core/common/cloud/policy_header_io_helper.h"
namespace policy {
diff --git a/chrome/browser/policy/cloud/policy_header_service.h b/components/policy/core/common/cloud/policy_header_service.h
index 4ea75f2..1d4346b 100644
--- a/chrome/browser/policy/cloud/policy_header_service.h
+++ b/components/policy/core/common/cloud/policy_header_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_POLICY_HEADER_SERVICE_H_
-#define CHROME_BROWSER_POLICY_CLOUD_POLICY_HEADER_SERVICE_H_
+#ifndef COMPONENTS_POLICY_CORE_COMMON_CLOUD_POLICY_HEADER_SERVICE_H_
+#define COMPONENTS_POLICY_CORE_COMMON_CLOUD_POLICY_HEADER_SERVICE_H_
#include <string>
#include <vector>
@@ -11,6 +11,7 @@
#include "base/memory/ref_counted.h"
#include "base/memory/scoped_ptr.h"
#include "components/policy/core/common/cloud/cloud_policy_store.h"
+#include "components/policy/policy_export.h"
namespace base {
class SequencedTaskRunner;
@@ -23,7 +24,7 @@ class PolicyHeaderIOHelper;
// Per-profile service used to generate PolicyHeaderIOHelper objects, and
// keep them up-to-date as policy changes.
// TODO(atwilson): Move to components/policy once CloudPolicyStore is moved.
-class PolicyHeaderService : public CloudPolicyStore::Observer {
+class POLICY_EXPORT PolicyHeaderService : public CloudPolicyStore::Observer {
public:
// |device_policy_store| can be null on platforms that do not support
// device policy. Both |user_policy_store| and |device_policy_store| must
@@ -66,4 +67,4 @@ class PolicyHeaderService : public CloudPolicyStore::Observer {
} // namespace policy
-#endif // CHROME_BROWSER_POLICY_CLOUD_POLICY_HEADER_SERVICE_H_
+#endif // COMPONENTS_POLICY_CORE_COMMON_CLOUD_POLICY_HEADER_SERVICE_H_
diff --git a/chrome/browser/policy/cloud/policy_header_service_unittest.cc b/components/policy/core/common/cloud/policy_header_service_unittest.cc
index cc10a12..d15725b 100644
--- a/chrome/browser/policy/cloud/policy_header_service_unittest.cc
+++ b/components/policy/core/common/cloud/policy_header_service_unittest.cc
@@ -3,9 +3,9 @@
// found in the LICENSE file.
#include "base/test/test_simple_task_runner.h"
-#include "chrome/browser/policy/cloud/policy_header_service.h"
-#include "components/policy/core/browser/policy_header_io_helper.h"
#include "components/policy/core/common/cloud/mock_cloud_policy_store.h"
+#include "components/policy/core/common/cloud/policy_header_io_helper.h"
+#include "components/policy/core/common/cloud/policy_header_service.h"
#include "net/http/http_request_headers.h"
#include "net/url_request/url_request_test_util.h"
#include "testing/gtest/include/gtest/gtest.h"