| 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_POLICY_LOADER_MAC_H_ | 5 #ifndef COMPONENTS_POLICY_CORE_COMMON_POLICY_LOADER_MAC_H_ |
| 6 #define COMPONENTS_POLICY_CORE_COMMON_POLICY_LOADER_MAC_H_ | 6 #define COMPONENTS_POLICY_CORE_COMMON_POLICY_LOADER_MAC_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "base/files/file_path.h" | 10 #include "base/files/file_path.h" |
| (...skipping 15 matching lines...) Expand all Loading... |
| 26 class PolicyMap; | 26 class PolicyMap; |
| 27 class Schema; | 27 class Schema; |
| 28 | 28 |
| 29 // A policy loader that loads policies from the Mac preferences system, and | 29 // A policy loader that loads policies from the Mac preferences system, and |
| 30 // watches the managed preferences files for updates. | 30 // watches the managed preferences files for updates. |
| 31 class POLICY_EXPORT PolicyLoaderMac : public AsyncPolicyLoader { | 31 class POLICY_EXPORT PolicyLoaderMac : public AsyncPolicyLoader { |
| 32 public: | 32 public: |
| 33 PolicyLoaderMac(scoped_refptr<base::SequencedTaskRunner> task_runner, | 33 PolicyLoaderMac(scoped_refptr<base::SequencedTaskRunner> task_runner, |
| 34 const base::FilePath& managed_policy_path, | 34 const base::FilePath& managed_policy_path, |
| 35 MacPreferences* preferences); | 35 MacPreferences* preferences); |
| 36 virtual ~PolicyLoaderMac(); | 36 ~PolicyLoaderMac() override; |
| 37 | 37 |
| 38 // AsyncPolicyLoader implementation. | 38 // AsyncPolicyLoader implementation. |
| 39 virtual void InitOnBackgroundThread() override; | 39 void InitOnBackgroundThread() override; |
| 40 virtual scoped_ptr<PolicyBundle> Load() override; | 40 scoped_ptr<PolicyBundle> Load() override; |
| 41 virtual base::Time LastModificationTime() override; | 41 base::Time LastModificationTime() override; |
| 42 | 42 |
| 43 private: | 43 private: |
| 44 // Callback for the FilePathWatcher. | 44 // Callback for the FilePathWatcher. |
| 45 void OnFileUpdated(const base::FilePath& path, bool error); | 45 void OnFileUpdated(const base::FilePath& path, bool error); |
| 46 | 46 |
| 47 // Loads policies for the components described in the current schema_map() | 47 // Loads policies for the components described in the current schema_map() |
| 48 // which belong to the domain |domain_name|, and stores them in the |bundle|. | 48 // which belong to the domain |domain_name|, and stores them in the |bundle|. |
| 49 void LoadPolicyForDomain( | 49 void LoadPolicyForDomain( |
| 50 PolicyDomain domain, | 50 PolicyDomain domain, |
| 51 const std::string& domain_name, | 51 const std::string& domain_name, |
| (...skipping 13 matching lines...) Expand all Loading... |
| 65 | 65 |
| 66 // Watches for events on the |managed_policy_path_|. | 66 // Watches for events on the |managed_policy_path_|. |
| 67 base::FilePathWatcher watcher_; | 67 base::FilePathWatcher watcher_; |
| 68 | 68 |
| 69 DISALLOW_COPY_AND_ASSIGN(PolicyLoaderMac); | 69 DISALLOW_COPY_AND_ASSIGN(PolicyLoaderMac); |
| 70 }; | 70 }; |
| 71 | 71 |
| 72 } // namespace policy | 72 } // namespace policy |
| 73 | 73 |
| 74 #endif // COMPONENTS_POLICY_CORE_COMMON_POLICY_LOADER_MAC_H_ | 74 #endif // COMPONENTS_POLICY_CORE_COMMON_POLICY_LOADER_MAC_H_ |
| OLD | NEW |