| 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_SERVICE_IMPL_H_ | 5 #ifndef COMPONENTS_POLICY_CORE_COMMON_POLICY_SERVICE_IMPL_H_ |
| 6 #define CHROME_BROWSER_POLICY_POLICY_SERVICE_IMPL_H_ | 6 #define COMPONENTS_POLICY_CORE_COMMON_POLICY_SERVICE_IMPL_H_ |
| 7 | 7 |
| 8 #include <map> | 8 #include <map> |
| 9 #include <set> | 9 #include <set> |
| 10 #include <string> | 10 #include <string> |
| 11 #include <vector> | 11 #include <vector> |
| 12 | 12 |
| 13 #include "base/basictypes.h" | 13 #include "base/basictypes.h" |
| 14 #include "base/callback.h" | 14 #include "base/callback.h" |
| 15 #include "base/memory/weak_ptr.h" | 15 #include "base/memory/weak_ptr.h" |
| 16 #include "base/observer_list.h" | 16 #include "base/observer_list.h" |
| 17 #include "chrome/browser/policy/policy_service.h" | |
| 18 #include "components/policy/core/common/configuration_policy_provider.h" | 17 #include "components/policy/core/common/configuration_policy_provider.h" |
| 19 #include "components/policy/core/common/policy_bundle.h" | 18 #include "components/policy/core/common/policy_bundle.h" |
| 19 #include "components/policy/core/common/policy_service.h" |
| 20 #include "components/policy/policy_export.h" |
| 20 | 21 |
| 21 namespace policy { | 22 namespace policy { |
| 22 | 23 |
| 23 class PolicyMap; | 24 class PolicyMap; |
| 24 | 25 |
| 25 class PolicyServiceImpl : public PolicyService, | 26 class POLICY_EXPORT PolicyServiceImpl |
| 26 public ConfigurationPolicyProvider::Observer { | 27 : public PolicyService, |
| 28 public ConfigurationPolicyProvider::Observer { |
| 27 public: | 29 public: |
| 28 typedef std::vector<ConfigurationPolicyProvider*> Providers; | 30 typedef std::vector<ConfigurationPolicyProvider*> Providers; |
| 29 typedef base::Callback<void(PolicyBundle*)> PreprocessCallback; | 31 typedef base::Callback<void(PolicyBundle*)> PreprocessCallback; |
| 30 | 32 |
| 31 // The PolicyServiceImpl will merge policies from |providers|. |providers| | 33 // The PolicyServiceImpl will merge policies from |providers|. |providers| |
| 32 // must be sorted in decreasing order of priority; the first provider will | 34 // must be sorted in decreasing order of priority; the first provider will |
| 33 // have the highest priority. The PolicyServiceImpl does not take ownership of | 35 // have the highest priority. The PolicyServiceImpl does not take ownership of |
| 34 // the providers, and they must outlive the PolicyServiceImpl. | 36 // the providers, and they must outlive the PolicyServiceImpl. |
| 35 // |preprocess_callback| will be applied every PolicyBundle before merginng. | 37 // |preprocess_callback| will be applied every PolicyBundle before merginng. |
| 36 PolicyServiceImpl(const Providers& providers, | 38 PolicyServiceImpl(const Providers& providers, |
| (...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 97 | 99 |
| 98 // Used to create tasks to delay new policy updates while we may be already | 100 // Used to create tasks to delay new policy updates while we may be already |
| 99 // processing previous policy updates. | 101 // processing previous policy updates. |
| 100 base::WeakPtrFactory<PolicyServiceImpl> update_task_ptr_factory_; | 102 base::WeakPtrFactory<PolicyServiceImpl> update_task_ptr_factory_; |
| 101 | 103 |
| 102 DISALLOW_COPY_AND_ASSIGN(PolicyServiceImpl); | 104 DISALLOW_COPY_AND_ASSIGN(PolicyServiceImpl); |
| 103 }; | 105 }; |
| 104 | 106 |
| 105 } // namespace policy | 107 } // namespace policy |
| 106 | 108 |
| 107 #endif // CHROME_BROWSER_POLICY_POLICY_SERVICE_IMPL_H_ | 109 #endif // COMPONENTS_POLICY_CORE_COMMON_POLICY_SERVICE_IMPL_H_ |
| OLD | NEW |