| 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_ASYNC_POLICY_PROVIDER_H_ | 5 #ifndef CHROME_BROWSER_POLICY_ASYNC_POLICY_PROVIDER_H_ |
| 6 #define CHROME_BROWSER_POLICY_ASYNC_POLICY_PROVIDER_H_ | 6 #define CHROME_BROWSER_POLICY_ASYNC_POLICY_PROVIDER_H_ |
| 7 | 7 |
| 8 #include "base/cancelable_callback.h" | 8 #include "base/cancelable_callback.h" |
| 9 #include "base/memory/ref_counted.h" | 9 #include "base/memory/ref_counted.h" |
| 10 #include "base/memory/scoped_ptr.h" | 10 #include "base/memory/scoped_ptr.h" |
| (...skipping 16 matching lines...) Expand all Loading... |
| 27 class AsyncPolicyProvider : public ConfigurationPolicyProvider, | 27 class AsyncPolicyProvider : public ConfigurationPolicyProvider, |
| 28 public base::NonThreadSafe { | 28 public base::NonThreadSafe { |
| 29 public: | 29 public: |
| 30 explicit AsyncPolicyProvider(scoped_ptr<AsyncPolicyLoader> loader); | 30 explicit AsyncPolicyProvider(scoped_ptr<AsyncPolicyLoader> loader); |
| 31 virtual ~AsyncPolicyProvider(); | 31 virtual ~AsyncPolicyProvider(); |
| 32 | 32 |
| 33 // ConfigurationPolicyProvider implementation. | 33 // ConfigurationPolicyProvider implementation. |
| 34 virtual void Init() OVERRIDE; | 34 virtual void Init() OVERRIDE; |
| 35 virtual void Shutdown() OVERRIDE; | 35 virtual void Shutdown() OVERRIDE; |
| 36 virtual void RefreshPolicies() OVERRIDE; | 36 virtual void RefreshPolicies() OVERRIDE; |
| 37 virtual void RegisterPolicyDomain( |
| 38 scoped_refptr<const PolicyDomainDescriptor> descriptor) OVERRIDE; |
| 37 | 39 |
| 38 private: | 40 private: |
| 39 // Helper for RefreshPolicies(). | 41 // Helper for RefreshPolicies(). |
| 40 void ReloadAfterRefreshSync(); | 42 void ReloadAfterRefreshSync(); |
| 41 | 43 |
| 42 // Invoked with the latest bundle loaded by the |loader_|. | 44 // Invoked with the latest bundle loaded by the |loader_|. |
| 43 void OnLoaderReloaded(scoped_ptr<PolicyBundle> bundle); | 45 void OnLoaderReloaded(scoped_ptr<PolicyBundle> bundle); |
| 44 | 46 |
| 45 // Callback passed to the loader that it uses to pass back the current policy | 47 // Callback passed to the loader that it uses to pass back the current policy |
| 46 // bundle to the provider. This is invoked on the FILE thread and forwards | 48 // bundle to the provider. This is invoked on the FILE thread and forwards |
| (...skipping 14 matching lines...) Expand all Loading... |
| 61 // Callback used to synchronize RefreshPolicies() calls with the FILE thread. | 63 // Callback used to synchronize RefreshPolicies() calls with the FILE thread. |
| 62 // See the implementation for the details. | 64 // See the implementation for the details. |
| 63 base::CancelableClosure refresh_callback_; | 65 base::CancelableClosure refresh_callback_; |
| 64 | 66 |
| 65 DISALLOW_COPY_AND_ASSIGN(AsyncPolicyProvider); | 67 DISALLOW_COPY_AND_ASSIGN(AsyncPolicyProvider); |
| 66 }; | 68 }; |
| 67 | 69 |
| 68 } // namespace policy | 70 } // namespace policy |
| 69 | 71 |
| 70 #endif // CHROME_BROWSER_POLICY_ASYNC_POLICY_PROVIDER_H_ | 72 #endif // CHROME_BROWSER_POLICY_ASYNC_POLICY_PROVIDER_H_ |
| OLD | NEW |