| 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_POLICY_LOADER_MAC_H_ | 5 #ifndef COMPONENTS_POLICY_CORE_COMMON_POLICY_LOADER_MAC_H_ |
| 6 #define CHROME_BROWSER_POLICY_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 <CoreFoundation/CoreFoundation.h> | 10 #include <CoreFoundation/CoreFoundation.h> |
| 11 | 11 |
| 12 #include "base/files/file_path.h" | 12 #include "base/files/file_path.h" |
| 13 #include "base/files/file_path_watcher.h" | 13 #include "base/files/file_path_watcher.h" |
| 14 #include "base/memory/ref_counted.h" | 14 #include "base/memory/ref_counted.h" |
| 15 #include "components/policy/core/common/async_policy_loader.h" | 15 #include "components/policy/core/common/async_policy_loader.h" |
| 16 #include "components/policy/core/common/policy_namespace.h" | 16 #include "components/policy/core/common/policy_namespace.h" |
| 17 #include "components/policy/policy_export.h" |
| 17 | 18 |
| 18 class MacPreferences; | 19 class MacPreferences; |
| 19 | 20 |
| 20 namespace base { | 21 namespace base { |
| 21 class SequencedTaskRunner; | 22 class SequencedTaskRunner; |
| 22 class Value; | 23 class Value; |
| 23 } // namespace base | 24 } // namespace base |
| 24 | 25 |
| 25 namespace policy { | 26 namespace policy { |
| 26 | 27 |
| 27 class PolicyBundle; | 28 class PolicyBundle; |
| 28 class PolicyMap; | 29 class PolicyMap; |
| 29 class Schema; | 30 class Schema; |
| 30 | 31 |
| 31 // A policy loader that loads policies from the Mac preferences system, and | 32 // A policy loader that loads policies from the Mac preferences system, and |
| 32 // watches the managed preferences files for updates. | 33 // watches the managed preferences files for updates. |
| 33 class PolicyLoaderMac : public AsyncPolicyLoader { | 34 class POLICY_EXPORT PolicyLoaderMac : public AsyncPolicyLoader { |
| 34 public: | 35 public: |
| 35 PolicyLoaderMac(scoped_refptr<base::SequencedTaskRunner> task_runner, | 36 PolicyLoaderMac(scoped_refptr<base::SequencedTaskRunner> task_runner, |
| 36 const base::FilePath& managed_policy_path, | 37 const base::FilePath& managed_policy_path, |
| 37 MacPreferences* preferences); | 38 MacPreferences* preferences); |
| 38 virtual ~PolicyLoaderMac(); | 39 virtual ~PolicyLoaderMac(); |
| 39 | 40 |
| 40 // AsyncPolicyLoader implementation. | 41 // AsyncPolicyLoader implementation. |
| 41 virtual void InitOnBackgroundThread() OVERRIDE; | 42 virtual void InitOnBackgroundThread() OVERRIDE; |
| 42 virtual scoped_ptr<PolicyBundle> Load() OVERRIDE; | 43 virtual scoped_ptr<PolicyBundle> Load() OVERRIDE; |
| 43 virtual base::Time LastModificationTime() OVERRIDE; | 44 virtual base::Time LastModificationTime() OVERRIDE; |
| (...skipping 28 matching lines...) Expand all Loading... |
| 72 base::FilePath managed_policy_path_; | 73 base::FilePath managed_policy_path_; |
| 73 | 74 |
| 74 // Watches for events on the |managed_policy_path_|. | 75 // Watches for events on the |managed_policy_path_|. |
| 75 base::FilePathWatcher watcher_; | 76 base::FilePathWatcher watcher_; |
| 76 | 77 |
| 77 DISALLOW_COPY_AND_ASSIGN(PolicyLoaderMac); | 78 DISALLOW_COPY_AND_ASSIGN(PolicyLoaderMac); |
| 78 }; | 79 }; |
| 79 | 80 |
| 80 } // namespace policy | 81 } // namespace policy |
| 81 | 82 |
| 82 #endif // CHROME_BROWSER_POLICY_POLICY_LOADER_MAC_H_ | 83 #endif // COMPONENTS_POLICY_CORE_COMMON_POLICY_LOADER_MAC_H_ |
| OLD | NEW |