Home | History | Annotate | Download | only in policy
      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
      3 // found in the LICENSE file.
      4 
      5 #ifndef CHROME_BROWSER_CHROMEOS_POLICY_PROXY_POLICY_PROVIDER_H_
      6 #define CHROME_BROWSER_CHROMEOS_POLICY_PROXY_POLICY_PROVIDER_H_
      7 
      8 #include "base/basictypes.h"
      9 #include "base/memory/scoped_ptr.h"
     10 #include "components/policy/core/common/configuration_policy_provider.h"
     11 
     12 namespace policy {
     13 
     14 // A policy provider implementation that acts as a proxy for another policy
     15 // provider, swappable at any point.
     16 class ProxyPolicyProvider : public ConfigurationPolicyProvider,
     17                             public ConfigurationPolicyProvider::Observer {
     18  public:
     19   ProxyPolicyProvider();
     20   virtual ~ProxyPolicyProvider();
     21 
     22   // Updates the provider this proxy delegates to.
     23   void SetDelegate(ConfigurationPolicyProvider* delegate);
     24 
     25   // ConfigurationPolicyProvider:
     26   virtual void Shutdown() OVERRIDE;
     27   virtual void RefreshPolicies() OVERRIDE;
     28 
     29   // ConfigurationPolicyProvider::Observer:
     30   virtual void OnUpdatePolicy(ConfigurationPolicyProvider* provider) OVERRIDE;
     31 
     32  private:
     33   ConfigurationPolicyProvider* delegate_;
     34 
     35   DISALLOW_COPY_AND_ASSIGN(ProxyPolicyProvider);
     36 };
     37 
     38 }  // namespace policy
     39 
     40 #endif  // CHROME_BROWSER_CHROMEOS_POLICY_PROXY_POLICY_PROVIDER_H_
     41