| 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 CHROME_BROWSER_POLICY_CONFIG_DIR_POLICY_LOADER_H_ | 5 #ifndef CHROME_BROWSER_POLICY_CONFIG_DIR_POLICY_LOADER_H_ |
| 6 #define CHROME_BROWSER_POLICY_CONFIG_DIR_POLICY_LOADER_H_ | 6 #define CHROME_BROWSER_POLICY_CONFIG_DIR_POLICY_LOADER_H_ |
| 7 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include "base/file_path.h" | 9 #include "base/file_path.h" |
| 10 #include "base/files/file_path_watcher.h" | 10 #include "base/files/file_path_watcher.h" |
| 11 #include "chrome/browser/policy/async_policy_loader.h" | 11 #include "chrome/browser/policy/async_policy_loader.h" |
| 12 #include "chrome/browser/policy/policy_constants.h" | 12 #include "chrome/browser/policy/policy_constants.h" |
| 13 | 13 |
| 14 namespace base { | 14 namespace base { |
| 15 class Value; | 15 class Value; |
| 16 } | 16 } |
| 17 | 17 |
| 18 namespace policy { | 18 namespace policy { |
| 19 | 19 |
| 20 struct PolicyDefinitionList; | |
| 21 | |
| 22 // A policy loader implementation backed by a set of files in a given | 20 // A policy loader implementation backed by a set of files in a given |
| 23 // directory. The files should contain JSON-formatted policy settings. They are | 21 // directory. The files should contain JSON-formatted policy settings. They are |
| 24 // merged together and the result is returned in a PolicyBundle. | 22 // merged together and the result is returned in a PolicyBundle. |
| 25 // The files are consulted in lexicographic file name order, so the | 23 // The files are consulted in lexicographic file name order, so the |
| 26 // last value read takes precedence in case of policy key collisions. | 24 // last value read takes precedence in case of policy key collisions. |
| 27 class ConfigDirPolicyLoader : public AsyncPolicyLoader { | 25 class ConfigDirPolicyLoader : public AsyncPolicyLoader { |
| 28 public: | 26 public: |
| 29 ConfigDirPolicyLoader(const FilePath& config_dir, PolicyScope scope); | 27 ConfigDirPolicyLoader(const FilePath& config_dir, PolicyScope scope); |
| 30 virtual ~ConfigDirPolicyLoader(); | 28 virtual ~ConfigDirPolicyLoader(); |
| 31 | 29 |
| (...skipping 26 matching lines...) Expand all Loading... |
| 58 // |config_dir_|. | 56 // |config_dir_|. |
| 59 base::files::FilePathWatcher mandatory_watcher_; | 57 base::files::FilePathWatcher mandatory_watcher_; |
| 60 base::files::FilePathWatcher recommended_watcher_; | 58 base::files::FilePathWatcher recommended_watcher_; |
| 61 | 59 |
| 62 DISALLOW_COPY_AND_ASSIGN(ConfigDirPolicyLoader); | 60 DISALLOW_COPY_AND_ASSIGN(ConfigDirPolicyLoader); |
| 63 }; | 61 }; |
| 64 | 62 |
| 65 } // namespace policy | 63 } // namespace policy |
| 66 | 64 |
| 67 #endif // CHROME_BROWSER_POLICY_CONFIG_DIR_POLICY_LOADER_H_ | 65 #endif // CHROME_BROWSER_POLICY_CONFIG_DIR_POLICY_LOADER_H_ |
| OLD | NEW |