#ifndef COMPONENTS_POLICY_CORE_BROWSER_CONFIGURATION_POLICY_HANDLER_LIST_H_
#define COMPONENTS_POLICY_CORE_BROWSER_CONFIGURATION_POLICY_HANDLER_LIST_H_
#include <vector>
#include "base/basictypes.h"
#include "base/callback.h"
#include "base/memory/scoped_ptr.h"
#include "components/policy/core/common/policy_details.h"
#include "components/policy/policy_export.h"
class PrefValueMap;
namespace policy {
class ConfigurationPolicyHandler;
class PolicyErrorMap;
struct PolicyHandlerParameters;
class PolicyMap;
struct PolicyToPreferenceMapEntry;
class Schema;
class POLICY_EXPORT ConfigurationPolicyHandlerList {
public:
typedef base::Callback<void(PolicyHandlerParameters*)>
PopulatePolicyHandlerParametersCallback;
explicit ConfigurationPolicyHandlerList(
const PopulatePolicyHandlerParametersCallback& parameters_callback,
const GetChromePolicyDetailsCallback& details_callback);
~ConfigurationPolicyHandlerList();
void AddHandler(scoped_ptr<ConfigurationPolicyHandler> handler);
void ApplyPolicySettings(const PolicyMap& policies,
PrefValueMap* prefs,
PolicyErrorMap* errors) const;
void PrepareForDisplaying(PolicyMap* policies) const;
private:
std::vector<ConfigurationPolicyHandler*> handlers_;
const PopulatePolicyHandlerParametersCallback parameters_callback_;
const GetChromePolicyDetailsCallback details_callback_;
DISALLOW_COPY_AND_ASSIGN(ConfigurationPolicyHandlerList);
};
typedef base::Callback<scoped_ptr<ConfigurationPolicyHandlerList>(
const Schema&)> HandlerListFactory;
}
#endif