| 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_COMMON_CONFIG_DIR_POLICY_LOADER_H_ | 5 #ifndef COMPONENTS_POLICY_CORE_COMMON_CONFIG_DIR_POLICY_LOADER_H_ |
| 6 #define COMPONENTS_POLICY_CORE_COMMON_CONFIG_DIR_POLICY_LOADER_H_ | 6 #define COMPONENTS_POLICY_CORE_COMMON_CONFIG_DIR_POLICY_LOADER_H_ |
| 7 | 7 |
| 8 #include "base/files/file_path.h" | 8 #include "base/files/file_path.h" |
| 9 #include "base/files/file_path_watcher.h" | 9 #include "base/files/file_path_watcher.h" |
| 10 #include "base/macros.h" | 10 #include "base/macros.h" |
| (...skipping 14 matching lines...) Expand all Loading... |
| 25 // last value read takes precedence in case of policy key collisions. | 25 // last value read takes precedence in case of policy key collisions. |
| 26 class POLICY_EXPORT ConfigDirPolicyLoader : public AsyncPolicyLoader { | 26 class POLICY_EXPORT ConfigDirPolicyLoader : public AsyncPolicyLoader { |
| 27 public: | 27 public: |
| 28 ConfigDirPolicyLoader(scoped_refptr<base::SequencedTaskRunner> task_runner, | 28 ConfigDirPolicyLoader(scoped_refptr<base::SequencedTaskRunner> task_runner, |
| 29 const base::FilePath& config_dir, | 29 const base::FilePath& config_dir, |
| 30 PolicyScope scope); | 30 PolicyScope scope); |
| 31 ~ConfigDirPolicyLoader() override; | 31 ~ConfigDirPolicyLoader() override; |
| 32 | 32 |
| 33 // AsyncPolicyLoader implementation. | 33 // AsyncPolicyLoader implementation. |
| 34 void InitOnBackgroundThread() override; | 34 void InitOnBackgroundThread() override; |
| 35 scoped_ptr<PolicyBundle> Load() override; | 35 std::unique_ptr<PolicyBundle> Load() override; |
| 36 base::Time LastModificationTime() override; | 36 base::Time LastModificationTime() override; |
| 37 | 37 |
| 38 private: | 38 private: |
| 39 // Loads the policy files at |path| into the |bundle|, with the given |level|. | 39 // Loads the policy files at |path| into the |bundle|, with the given |level|. |
| 40 void LoadFromPath(const base::FilePath& path, | 40 void LoadFromPath(const base::FilePath& path, |
| 41 PolicyLevel level, | 41 PolicyLevel level, |
| 42 PolicyBundle* bundle); | 42 PolicyBundle* bundle); |
| 43 | 43 |
| 44 // Merges the 3rd party |policies| into the |bundle|, with the given |level|. | 44 // Merges the 3rd party |policies| into the |bundle|, with the given |level|. |
| 45 void Merge3rdPartyPolicy(const base::Value* policies, | 45 void Merge3rdPartyPolicy(const base::Value* policies, |
| (...skipping 13 matching lines...) Expand all Loading... |
| 59 // |config_dir_|. | 59 // |config_dir_|. |
| 60 base::FilePathWatcher mandatory_watcher_; | 60 base::FilePathWatcher mandatory_watcher_; |
| 61 base::FilePathWatcher recommended_watcher_; | 61 base::FilePathWatcher recommended_watcher_; |
| 62 | 62 |
| 63 DISALLOW_COPY_AND_ASSIGN(ConfigDirPolicyLoader); | 63 DISALLOW_COPY_AND_ASSIGN(ConfigDirPolicyLoader); |
| 64 }; | 64 }; |
| 65 | 65 |
| 66 } // namespace policy | 66 } // namespace policy |
| 67 | 67 |
| 68 #endif // COMPONENTS_POLICY_CORE_COMMON_CONFIG_DIR_POLICY_LOADER_H_ | 68 #endif // COMPONENTS_POLICY_CORE_COMMON_CONFIG_DIR_POLICY_LOADER_H_ |
| OLD | NEW |