| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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_ASYNCHRONOUS_POLICY_LOADER_H_ | 5 #ifndef CHROME_BROWSER_POLICY_ASYNCHRONOUS_POLICY_LOADER_H_ |
| 6 #define CHROME_BROWSER_POLICY_ASYNCHRONOUS_POLICY_LOADER_H_ | 6 #define CHROME_BROWSER_POLICY_ASYNCHRONOUS_POLICY_LOADER_H_ |
| 7 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include "base/callback.h" | 9 #include "base/callback.h" |
| 10 #include "base/memory/ref_counted.h" | 10 #include "base/memory/ref_counted.h" |
| (...skipping 14 matching lines...) Expand all Loading... |
| 25 : public base::RefCountedThreadSafe<AsynchronousPolicyLoader> { | 25 : public base::RefCountedThreadSafe<AsynchronousPolicyLoader> { |
| 26 public: | 26 public: |
| 27 AsynchronousPolicyLoader(AsynchronousPolicyProvider::Delegate* delegate, | 27 AsynchronousPolicyLoader(AsynchronousPolicyProvider::Delegate* delegate, |
| 28 int reload_interval_minutes); | 28 int reload_interval_minutes); |
| 29 | 29 |
| 30 // Triggers initial policy load, and installs |callback| as the callback to | 30 // Triggers initial policy load, and installs |callback| as the callback to |
| 31 // invoke on policy updates. | 31 // invoke on policy updates. |
| 32 virtual void Init(const base::Closure& callback); | 32 virtual void Init(const base::Closure& callback); |
| 33 | 33 |
| 34 // Reloads policy, sending notification of changes if necessary. Must be | 34 // Reloads policy, sending notification of changes if necessary. Must be |
| 35 // called on the FILE thread. | 35 // called on the FILE thread. When |force| is true, the loader should do an |
| 36 virtual void Reload(); | 36 // immediate full reload. |
| 37 virtual void Reload(bool force); |
| 37 | 38 |
| 38 // Stops any pending reload tasks. Updates callbacks won't be performed | 39 // Stops any pending reload tasks. Updates callbacks won't be performed |
| 39 // anymore once the loader is stopped. | 40 // anymore once the loader is stopped. |
| 40 virtual void Stop(); | 41 virtual void Stop(); |
| 41 | 42 |
| 42 const DictionaryValue* policy() const { return policy_.get(); } | 43 const DictionaryValue* policy() const { return policy_.get(); } |
| 43 | 44 |
| 44 protected: | 45 protected: |
| 45 // AsynchronousPolicyLoader objects should only be deleted by | 46 // AsynchronousPolicyLoader objects should only be deleted by |
| 46 // RefCountedThreadSafe. | 47 // RefCountedThreadSafe. |
| (...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 110 | 111 |
| 111 // Callback to invoke on policy updates. | 112 // Callback to invoke on policy updates. |
| 112 base::Closure updates_callback_; | 113 base::Closure updates_callback_; |
| 113 | 114 |
| 114 DISALLOW_COPY_AND_ASSIGN(AsynchronousPolicyLoader); | 115 DISALLOW_COPY_AND_ASSIGN(AsynchronousPolicyLoader); |
| 115 }; | 116 }; |
| 116 | 117 |
| 117 } // namespace policy | 118 } // namespace policy |
| 118 | 119 |
| 119 #endif // CHROME_BROWSER_POLICY_ASYNCHRONOUS_POLICY_LOADER_H_ | 120 #endif // CHROME_BROWSER_POLICY_ASYNCHRONOUS_POLICY_LOADER_H_ |
| OLD | NEW |