diff options
Diffstat (limited to 'chrome/browser/policy/configuration_policy_provider_keeper.h')
| -rw-r--r-- | chrome/browser/policy/configuration_policy_provider_keeper.h | 46 |
1 files changed, 46 insertions, 0 deletions
diff --git a/chrome/browser/policy/configuration_policy_provider_keeper.h b/chrome/browser/policy/configuration_policy_provider_keeper.h new file mode 100644 index 0000000..6994de4 --- /dev/null +++ b/chrome/browser/policy/configuration_policy_provider_keeper.h @@ -0,0 +1,46 @@ +// Copyright (c) 2011 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#ifndef CHROME_BROWSER_POLICY_CONFIGURATION_POLICY_PROVIDER_KEEPER_H_ +#define CHROME_BROWSER_POLICY_CONFIGURATION_POLICY_PROVIDER_KEEPER_H_ +#pragma once + +#include "base/scoped_ptr.h" +#include "chrome/browser/policy/configuration_policy_provider.h" + +namespace policy { + +// Manages the lifecycle of the shared platform-specific policy providers for +// managed platform, device management and recommended policy. +class ConfigurationPolicyProviderKeeper { + public: + ConfigurationPolicyProviderKeeper(); + // Tests can pass in their own (dummy) providers using this c'tor. + ConfigurationPolicyProviderKeeper( + ConfigurationPolicyProvider* managed_platform_provider, + ConfigurationPolicyProvider* device_management_provider, + ConfigurationPolicyProvider* recommended_provider); + virtual ~ConfigurationPolicyProviderKeeper() {} + + ConfigurationPolicyProvider* managed_platform_provider() const; + + ConfigurationPolicyProvider* device_management_provider() const; + + ConfigurationPolicyProvider* recommended_provider() const; + + private: + scoped_ptr<ConfigurationPolicyProvider> managed_platform_provider_; + scoped_ptr<ConfigurationPolicyProvider> device_management_provider_; + scoped_ptr<ConfigurationPolicyProvider> recommended_provider_; + + static ConfigurationPolicyProvider* CreateManagedPlatformProvider(); + static ConfigurationPolicyProvider* CreateDeviceManagementProvider(); + static ConfigurationPolicyProvider* CreateRecommendedProvider(); + + DISALLOW_COPY_AND_ASSIGN(ConfigurationPolicyProviderKeeper); +}; + +} // namespace policy + +#endif // CHROME_BROWSER_POLICY_CONFIGURATION_POLICY_PROVIDER_KEEPER_H_ |
