Logo Search packages:      
Sourcecode: chromium-browser version File versions  Download package


// Copyright (c) 2010 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.


#include "base/basictypes.h"
#include "base/file_path.h"
#include "chrome/browser/configuration_policy_provider.h"

class DictionaryValue;

// A policy provider implementation backed by a set of files in a given
// directory. The files should contain JSON-formatted policy settings. They are
// merged together and the result is returned via the
// ConfigurationPolicyProvider interface. The files are consulted in
// lexicographic file name order, so the last value read takes precedence in
// case of preference key collisions.
class ConfigDirPolicyProvider : public ConfigurationPolicyProvider {
  explicit ConfigDirPolicyProvider(const FilePath& config_dir);
  virtual ~ConfigDirPolicyProvider() { }

  // ConfigurationPolicyProvider implementation.
  virtual bool Provide(ConfigurationPolicyStore* store);

  // Read and merge the files from the configuration directory.
  DictionaryValue* ReadPolicies();

  // Decodes the value tree and writes the configuration to the given |store|.
  void DecodePolicyValueTree(DictionaryValue* policies,
                             ConfigurationPolicyStore* store);

  // The directory in which we look for configuration files.
  const FilePath config_dir_;



Generated by  Doxygen 1.6.0   Back to index