OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef COMPONENTS_POLICY_CORE_BROWSER_CONFIGURATION_POLICY_HANDLER_H_ | 5 #ifndef COMPONENTS_POLICY_CORE_BROWSER_CONFIGURATION_POLICY_HANDLER_H_ |
6 #define COMPONENTS_POLICY_CORE_BROWSER_CONFIGURATION_POLICY_HANDLER_H_ | 6 #define COMPONENTS_POLICY_CORE_BROWSER_CONFIGURATION_POLICY_HANDLER_H_ |
7 | 7 |
8 #include <memory> | 8 #include <memory> |
9 #include <string> | 9 #include <string> |
10 #include <vector> | 10 #include <vector> |
(...skipping 18 matching lines...) Expand all Loading... |
29 struct POLICY_EXPORT PolicyToPreferenceMapEntry { | 29 struct POLICY_EXPORT PolicyToPreferenceMapEntry { |
30 const char* const policy_name; | 30 const char* const policy_name; |
31 const char* const preference_path; | 31 const char* const preference_path; |
32 const base::Value::Type value_type; | 32 const base::Value::Type value_type; |
33 }; | 33 }; |
34 | 34 |
35 // An abstract super class that subclasses should implement to map policies to | 35 // An abstract super class that subclasses should implement to map policies to |
36 // their corresponding preferences, and to check whether the policies are valid. | 36 // their corresponding preferences, and to check whether the policies are valid. |
37 class POLICY_EXPORT ConfigurationPolicyHandler { | 37 class POLICY_EXPORT ConfigurationPolicyHandler { |
38 public: | 38 public: |
39 // TODO(thestig): Replace with base::Value::GetTypeName(). | |
40 static std::string ValueTypeToString(base::Value::Type type); | |
41 | |
42 ConfigurationPolicyHandler(); | 39 ConfigurationPolicyHandler(); |
43 virtual ~ConfigurationPolicyHandler(); | 40 virtual ~ConfigurationPolicyHandler(); |
44 | 41 |
45 // Returns whether the policy settings handled by this | 42 // Returns whether the policy settings handled by this |
46 // ConfigurationPolicyHandler can be applied. Fills |errors| with error | 43 // ConfigurationPolicyHandler can be applied. Fills |errors| with error |
47 // messages or warnings. |errors| may contain error messages even when | 44 // messages or warnings. |errors| may contain error messages even when |
48 // |CheckPolicySettings()| returns true. | 45 // |CheckPolicySettings()| returns true. |
49 virtual bool CheckPolicySettings(const PolicyMap& policies, | 46 virtual bool CheckPolicySettings(const PolicyMap& policies, |
50 PolicyErrorMap* errors) = 0; | 47 PolicyErrorMap* errors) = 0; |
51 | 48 |
(...skipping 303 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
355 private: | 352 private: |
356 ScopedVector<ConfigurationPolicyHandler> legacy_policy_handlers_; | 353 ScopedVector<ConfigurationPolicyHandler> legacy_policy_handlers_; |
357 std::unique_ptr<SchemaValidatingPolicyHandler> new_policy_handler_; | 354 std::unique_ptr<SchemaValidatingPolicyHandler> new_policy_handler_; |
358 | 355 |
359 DISALLOW_COPY_AND_ASSIGN(LegacyPoliciesDeprecatingPolicyHandler); | 356 DISALLOW_COPY_AND_ASSIGN(LegacyPoliciesDeprecatingPolicyHandler); |
360 }; | 357 }; |
361 | 358 |
362 } // namespace policy | 359 } // namespace policy |
363 | 360 |
364 #endif // COMPONENTS_POLICY_CORE_BROWSER_CONFIGURATION_POLICY_HANDLER_H_ | 361 #endif // COMPONENTS_POLICY_CORE_BROWSER_CONFIGURATION_POLICY_HANDLER_H_ |
OLD | NEW |