OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 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 | 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_FILE_BASED_POLICY_PROVIDER_H_ | 5 #ifndef CHROME_BROWSER_POLICY_FILE_BASED_POLICY_PROVIDER_H_ |
6 #define CHROME_BROWSER_POLICY_FILE_BASED_POLICY_PROVIDER_H_ | 6 #define CHROME_BROWSER_POLICY_FILE_BASED_POLICY_PROVIDER_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include "base/basictypes.h" | 9 #include "base/basictypes.h" |
10 #include "base/file_path.h" | 10 #include "base/file_path.h" |
(...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
99 // called on the file thread. | 99 // called on the file thread. |
100 void Reload(); | 100 void Reload(); |
101 | 101 |
102 // Gets the current dictionary value object. Ownership of the returned value | 102 // Gets the current dictionary value object. Ownership of the returned value |
103 // is transferred to the caller. | 103 // is transferred to the caller. |
104 DictionaryValue* GetPolicy(); | 104 DictionaryValue* GetPolicy(); |
105 | 105 |
106 const FilePath& config_file_path() { return delegate_->config_file_path(); } | 106 const FilePath& config_file_path() { return delegate_->config_file_path(); } |
107 | 107 |
108 // FilePathWatcher::Delegate implementation: | 108 // FilePathWatcher::Delegate implementation: |
109 void OnFilePathChanged(const FilePath& path); | 109 virtual void OnFilePathChanged(const FilePath& path); |
110 void OnError(); | 110 virtual void OnError(); |
111 | 111 |
112 private: | 112 private: |
113 // FileBasedPolicyLoader objects should only be deleted by | 113 // FileBasedPolicyLoader objects should only be deleted by |
114 // RefCountedThreadSafe. | 114 // RefCountedThreadSafe. |
115 friend class base::RefCountedThreadSafe<FileBasedPolicyLoader>; | 115 friend class base::RefCountedThreadSafe<FileBasedPolicyLoader>; |
116 virtual ~FileBasedPolicyLoader(); | 116 virtual ~FileBasedPolicyLoader(); |
117 | 117 |
118 // Checks whether reading policy information is safe to do. If not, returns | 118 // Checks whether reading policy information is safe to do. If not, returns |
119 // false and the delay until it is considered safe to reload in |delay|. | 119 // false and the delay until it is considered safe to reload in |delay|. |
120 bool IsSafeToReloadPolicy(const base::Time& now, base::TimeDelta* delay); | 120 bool IsSafeToReloadPolicy(const base::Time& now, base::TimeDelta* delay); |
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
190 | 190 |
191 // Wrapped watcher that takes care of the actual watching. | 191 // Wrapped watcher that takes care of the actual watching. |
192 FilePathWatcher watcher_; | 192 FilePathWatcher watcher_; |
193 | 193 |
194 DISALLOW_COPY_AND_ASSIGN(FileBasedPolicyWatcher); | 194 DISALLOW_COPY_AND_ASSIGN(FileBasedPolicyWatcher); |
195 }; | 195 }; |
196 | 196 |
197 } // namespace policy | 197 } // namespace policy |
198 | 198 |
199 #endif // CHROME_BROWSER_POLICY_FILE_BASED_POLICY_PROVIDER_H_ | 199 #endif // CHROME_BROWSER_POLICY_FILE_BASED_POLICY_PROVIDER_H_ |
OLD | NEW |