| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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_FORWARDING_POLICY_PROVIDER_H_ | 5 #ifndef COMPONENTS_POLICY_CORE_COMMON_FORWARDING_POLICY_PROVIDER_H_ |
| 6 #define CHROME_BROWSER_POLICY_FORWARDING_POLICY_PROVIDER_H_ | 6 #define COMPONENTS_POLICY_CORE_COMMON_FORWARDING_POLICY_PROVIDER_H_ |
| 7 | 7 |
| 8 #include "base/basictypes.h" | 8 #include "base/basictypes.h" |
| 9 #include "base/compiler_specific.h" | 9 #include "base/compiler_specific.h" |
| 10 #include "components/policy/core/common/configuration_policy_provider.h" | 10 #include "components/policy/core/common/configuration_policy_provider.h" |
| 11 #include "components/policy/core/common/policy_namespace.h" | 11 #include "components/policy/core/common/policy_namespace.h" |
| 12 #include "components/policy/policy_export.h" |
| 12 | 13 |
| 13 namespace policy { | 14 namespace policy { |
| 14 | 15 |
| 15 // A policy provider that forwards calls to another provider. | 16 // A policy provider that forwards calls to another provider. |
| 16 // This provider also tracks the SchemaRegistry, and becomes ready after making | 17 // This provider also tracks the SchemaRegistry, and becomes ready after making |
| 17 // sure the delegate provider has refreshed its policies with an updated view | 18 // sure the delegate provider has refreshed its policies with an updated view |
| 18 // of the complete schema. It is expected that the delegate's SchemaRegistry | 19 // of the complete schema. It is expected that the delegate's SchemaRegistry |
| 19 // is a CombinedSchemaRegistry tracking the forwarding provider's registry. | 20 // is a CombinedSchemaRegistry tracking the forwarding provider's registry. |
| 20 class ForwardingPolicyProvider : public ConfigurationPolicyProvider, | 21 class POLICY_EXPORT ForwardingPolicyProvider |
| 21 public ConfigurationPolicyProvider::Observer { | 22 : public ConfigurationPolicyProvider, |
| 23 public ConfigurationPolicyProvider::Observer { |
| 22 public: | 24 public: |
| 23 // The |delegate| must outlive this provider. | 25 // The |delegate| must outlive this provider. |
| 24 explicit ForwardingPolicyProvider(ConfigurationPolicyProvider* delegate); | 26 explicit ForwardingPolicyProvider(ConfigurationPolicyProvider* delegate); |
| 25 virtual ~ForwardingPolicyProvider(); | 27 virtual ~ForwardingPolicyProvider(); |
| 26 | 28 |
| 27 // ConfigurationPolicyProvider: | 29 // ConfigurationPolicyProvider: |
| 28 // | 30 // |
| 29 // Note that Init() and Shutdown() are not forwarded to the |delegate_|, since | 31 // Note that Init() and Shutdown() are not forwarded to the |delegate_|, since |
| 30 // this provider does not own it and its up to the |delegate_|'s owner to | 32 // this provider does not own it and its up to the |delegate_|'s owner to |
| 31 // initialize it and shut it down. | 33 // initialize it and shut it down. |
| (...skipping 26 matching lines...) Expand all Loading... |
| 58 }; | 60 }; |
| 59 | 61 |
| 60 ConfigurationPolicyProvider* delegate_; | 62 ConfigurationPolicyProvider* delegate_; |
| 61 InitializationState state_; | 63 InitializationState state_; |
| 62 | 64 |
| 63 DISALLOW_COPY_AND_ASSIGN(ForwardingPolicyProvider); | 65 DISALLOW_COPY_AND_ASSIGN(ForwardingPolicyProvider); |
| 64 }; | 66 }; |
| 65 | 67 |
| 66 } // namespace policy | 68 } // namespace policy |
| 67 | 69 |
| 68 #endif // CHROME_BROWSER_POLICY_FORWARDING_POLICY_PROVIDER_H_ | 70 #endif // COMPONENTS_POLICY_CORE_COMMON_FORWARDING_POLICY_PROVIDER_H_ |
| OLD | NEW |