Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(482)

Unified Diff: components/policy/core/browser/configuration_policy_handler.h

Issue 109743002: Move policy code into components/policy. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: moar fixes Created 7 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: components/policy/core/browser/configuration_policy_handler.h
diff --git a/chrome/browser/policy/configuration_policy_handler.h b/components/policy/core/browser/configuration_policy_handler.h
similarity index 88%
rename from chrome/browser/policy/configuration_policy_handler.h
rename to components/policy/core/browser/configuration_policy_handler.h
index f7b7eae5d1035070ce6a7f9aea36f7fa350f5e50..2c9c5df5c2d92c31efca1c3176c985692690341f 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_
« no previous file with comments | « components/policy/core/browser/cloud/message_util.cc ('k') | components/policy/core/browser/configuration_policy_handler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698