OLD | NEW |
(Empty) | |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #ifndef CHROME_BROWSER_CONFIG_DIR_POLICY_PROVIDER_H_ |
| 6 #define CHROME_BROWSER_CONFIG_DIR_POLICY_PROVIDER_H_ |
| 7 |
| 8 #include "base/basictypes.h" |
| 9 #include "base/file_path.h" |
| 10 #include "chrome/browser/configuration_policy_provider.h" |
| 11 |
| 12 class DictionaryValue; |
| 13 |
| 14 // A policy provider implementation backed by a set of files in a given |
| 15 // directory. The files should contain JSON-formatted policy settings. They are |
| 16 // merged together and the result is returned via the |
| 17 // ConfigurationPolicyProvider interface. The files are consulted in |
| 18 // lexicographic file name order, so the last value read takes precedence in |
| 19 // case of preference key collisions. |
| 20 class ConfigDirPolicyProvider : public ConfigurationPolicyProvider { |
| 21 public: |
| 22 explicit ConfigDirPolicyProvider(const FilePath& config_dir); |
| 23 virtual ~ConfigDirPolicyProvider() { } |
| 24 |
| 25 // ConfigurationPolicyProvider implementation. |
| 26 virtual bool Provide(ConfigurationPolicyStore* store); |
| 27 |
| 28 private: |
| 29 // Read and merge the files from the configuration directory. |
| 30 DictionaryValue* ReadPolicies(); |
| 31 |
| 32 // The directory in which we look for configuration files. |
| 33 const FilePath config_dir_; |
| 34 |
| 35 DISALLOW_COPY_AND_ASSIGN(ConfigDirPolicyProvider); |
| 36 }; |
| 37 |
| 38 #endif // CHROME_BROWSER_CONFIG_DIR_POLICY_PROVIDER_H_ |
OLD | NEW |